use intltool for desktop file translation
authorVladimir Nadvornik <nadvornik@suse.cz>
Mon, 15 Jun 2009 20:50:35 +0000 (20:50 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Mon, 15 Jun 2009 20:50:35 +0000 (20:50 +0000)
- desktop files are translated via .po files together with other strings
- make update-po is replaced with intltool-update [lang]

12 files changed:
Makefile.am
autogen.sh
configure.in
geeqie.desktop
plugins/rotate/Makefile.am
plugins/rotate/rotate.desktop.in [new file with mode: 0644]
plugins/symlink/Makefile.am
plugins/symlink/symlink.desktop
plugins/symlink/symlink.desktop.in [new file with mode: 0644]
po/Makefile.in.in.patch [deleted file]
po/POTFILES.in
po/README

index db9144c..2100671 100644 (file)
@@ -11,7 +11,9 @@ readmedir = @readmedir@
 readme_DATA = README COPYING ChangeLog TODO README.lirc
 
 desktopdir = $(datadir)/applications
-desktop_DATA = geeqie.desktop
+desktop_in_files = geeqie.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+@INTLTOOL_DESKTOP_RULE@
 
 icondir = $(datadir)/pixmaps
 icon_DATA = geeqie.png
index 8a188e3..ef64ec1 100755 (executable)
@@ -35,6 +35,12 @@ DIE=0
   }
 }
 
+(intltoolize --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "**Error**: You must have \`intltoolize' installed" 
+  DIE=1
+}
+
 (automake --version) < /dev/null > /dev/null 2>&1 || {
   echo
   echo "**Error**: You must have \`automake' installed."
@@ -99,9 +105,8 @@ do
          test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
          echo "Running glib-gettextize..."
          echo "no" | glib-gettextize --force --copy
-         if [ -r po/Makefile.in.in.patch ]; then
-               patch po/Makefile.in.in < po/Makefile.in.in.patch
-         fi
+         echo "Running intltoolize"
+         intltoolize --copy --force --automake
          echo "Making $dr/aclocal.m4 writable ..."
          test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
         fi
index f4327a3..e52de57 100644 (file)
@@ -128,6 +128,8 @@ AC_PROG_CC
 AC_PROG_CXX
 AC_STDC_HEADERS
 AC_ARG_PROGRAM
+IT_PROG_INTLTOOL([0.35.0])
+
 
 dnl checks for functions
 AC_CHECK_FUNCS(strverscmp access fsync fflush)
index 4f582b8..e74a0dd 100644 (file)
@@ -1,14 +1,7 @@
 [Desktop Entry]
 Name=Geeqie
 GenericName=Image Viewer
-GenericName[et]=Piltide vaatur
-GenericName[tr]=Resim göstericisi
-GenericName[fr]=Explorateur d'images
-GenericName[hu]=Képnéző
-GenericName[es]=Visor de imágenes
 Comment=View and manage images
-Comment[hu]=Képek megjelenítése és rendszerezése
-Comment[es]=Visualiza y administra imágenes
 Exec=geeqie -r %F
 Icon=geeqie
 Type=Application
index 97cf9b0..284cdec 100644 (file)
@@ -1,7 +1,9 @@
 dist_pkglib_SCRIPTS = geeqie-rotate
 
-qq_desktopdir = $(pkgdatadir)/applications
-qq_desktop_DATA = rotate.desktop
+gq_desktopdir = $(pkgdatadir)/applications
+gq_desktop_in_files = rotate.desktop.in
+gq_desktop_DATA = $(gq_desktop_in_files:.desktop.in=.desktop)
+@INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST = $(qq_desktop_DATA)
 
diff --git a/plugins/rotate/rotate.desktop.in b/plugins/rotate/rotate.desktop.in
new file mode 100644 (file)
index 0000000..a403591
--- /dev/null
@@ -0,0 +1,19 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+_Name=Apply the orientation to image content
+
+# call the helper script
+Exec=geeqie-rotate %f
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=X-Geeqie;
+OnlyShowIn=X-Geeqie;
+
+# Show in menu "Edit/Orientation"
+X-Geeqie-Menu-Path=EditMenu/OrientationMenu
+
+# It can be made verbose
+# X-Geeqie-Verbose=true
+
+MimeType=image/jpeg;image/png;image/tiff;
index 4d1e71c..161cdde 100644 (file)
@@ -1,7 +1,9 @@
 dist_pkglib_SCRIPTS = geeqie-symlink
 
-qq_desktopdir = $(pkgdatadir)/applications
-qq_desktop_DATA = symlink.desktop
+gq_desktopdir = $(pkgdatadir)/applications
+gq_desktop_in_files = symlink.desktop.in
+gq_desktop_DATA = $(gq_desktop_in_files:.desktop.in=.desktop)
+@INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST = \
        $(qq_desktop_DATA)
index 88bb3da..f82a706 100644 (file)
@@ -2,7 +2,6 @@
 Version=1.0
 Type=Application
 Name=Symlink
-#Name[cs]=
 
 # call the helper script
 Exec=geeqie-symlink %f
diff --git a/plugins/symlink/symlink.desktop.in b/plugins/symlink/symlink.desktop.in
new file mode 100644 (file)
index 0000000..678d8db
--- /dev/null
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+_Name=Symlink
+
+# call the helper script
+Exec=geeqie-symlink %f
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=X-Geeqie;
+OnlyShowIn=X-Geeqie;
+
+# Show in menu "File"
+X-Geeqie-Menu-Path=FileMenu/FileOpsSection
+
+# This is a filter - $GEEQIE_DESTINATION is required
+X-Geeqie-Filter=true
+
+# It can be made verbose
+# X-Geeqie-Verbose=true
diff --git a/po/Makefile.in.in.patch b/po/Makefile.in.in.patch
deleted file mode 100644 (file)
index 03b8b27..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
---- Makefile.in.in     2009-04-28 23:27:08.000000000 +0200
-+++ Makefile.in.in.new 2009-04-28 23:25:22.000000000 +0200
-@@ -92,7 +92,7 @@
- all-yes: $(CATALOGS)
- all-no:
--$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
-+$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
-       $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
-         --add-comments --keyword=_ --keyword=N_ \
-           --flag=g_strdup_printf:1:c-format \
-@@ -216,8 +216,31 @@
-           || cp -p $(srcdir)/$$file $(distdir); \
-       done
--update-po: Makefile
--      $(MAKE) $(GETTEXT_PACKAGE).pot
-+### Updating po and gmo files
-+#
-+# Update by merging all .po files with the .po template master file.
-+#
-+# It is possible to update only a single .po file by setting the PO variable to
-+# either <lang> or <lang>.po when calling make. Example: make update-po PO=is
-+
-+update-po: Makefile $(srcdir)/$(GETTEXT_PACKAGE).pot
-+      @cd $(srcdir); \
-+      $(foreach lang,$(basename $(if $(strip $(PO)),$(PO),$(CATALOGS))), \
-+        echo -n "$(lang): "; \
-+        if $(MSGMERGE) $(lang).po $(srcdir)/$(GETTEXT_PACKAGE).pot -o $(lang).new.po; then \
-+          mv -f $(lang).new.po $(lang).po; \
-+        else \
-+          echo "msgmerge failed!"; \
-+          rm -f $(lang).new.po; \
-+        fi; \
-+      )
-+      $(MAKE) update-gmo
-+
-+update-gmo: Makefile $(CATALOGS)
-+      @:
-+
-+update-po-orig: Makefile
-+      $(MAKE) $(srcdir)/$(GETTEXT_PACKAGE).pot
-       tmpdir=`pwd`; \
-       cd $(srcdir); \
-       catalogs='$(CATALOGS)'; \
-@@ -225,7 +248,7 @@
-         cat=`basename $$cat`; \
-         lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
-         echo "$$lang:"; \
--        if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
-+        if $(MSGMERGE) $$lang.po $(srcdir)/$(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
-           if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
-             rm -f $$tmpdir/$$lang.new.po; \
-             else \
index 0f374bf..3e1818e 100644 (file)
@@ -1,3 +1,6 @@
+./geeqie.desktop.in
+./plugins/rotate/rotate.desktop.in
+./plugins/symlink/symlink.desktop.in
 ./src/advanced_exif.c
 ./src/bar.c
 ./src/bar_comment.c
index 540d6a8..12a5af4 100644 (file)
--- a/po/README
+++ b/po/README
@@ -4,8 +4,8 @@ Basically: Add your language code to the   ALL_LINGUAS=   line in configure.in,
 then get started translating the strings in your ??.po file. Note: The strings
 for debug output is intentionally not marked for translation.
 
-To update a specific translation, one may use make update-po PO=[lang]  (ie.
-make update-po PO=fr).
+To update a specific translation, one may use intltool-update [lang]  (ie. 
+intltool-update fr).
 
 To update all translation files, use make update-po. You should only use it when
 needed (before a release or when there were many changes in source code).