changeset 1648:a57336c3b1cc

use intltool for desktop file translation - desktop files are translated via .po files together with other strings - make update-po is replaced with intltool-update [lang]
author nadvornik
date Mon, 15 Jun 2009 20:50:35 +0000
parents 2a779a1855d7
children 82de367f2d72
files Makefile.am autogen.sh configure.in geeqie.desktop plugins/rotate/Makefile.am plugins/rotate/rotate.desktop.in plugins/symlink/Makefile.am plugins/symlink/symlink.desktop plugins/symlink/symlink.desktop.in po/Makefile.in.in.patch po/POTFILES.in po/README
diffstat 12 files changed, 65 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Mon Jun 15 19:13:45 2009 +0000
+++ b/Makefile.am	Mon Jun 15 20:50:35 2009 +0000
@@ -11,7 +11,9 @@
 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
--- a/autogen.sh	Mon Jun 15 19:13:45 2009 +0000
+++ b/autogen.sh	Mon Jun 15 20:50:35 2009 +0000
@@ -35,6 +35,12 @@
   }
 }
 
+(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 @@
 	  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
--- a/configure.in	Mon Jun 15 19:13:45 2009 +0000
+++ b/configure.in	Mon Jun 15 20:50:35 2009 +0000
@@ -128,6 +128,8 @@
 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)
--- a/geeqie.desktop	Mon Jun 15 19:13:45 2009 +0000
+++ b/geeqie.desktop	Mon Jun 15 20:50:35 2009 +0000
@@ -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
--- a/plugins/rotate/Makefile.am	Mon Jun 15 19:13:45 2009 +0000
+++ b/plugins/rotate/Makefile.am	Mon Jun 15 20:50:35 2009 +0000
@@ -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)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/rotate/rotate.desktop.in	Mon Jun 15 20:50:35 2009 +0000
@@ -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;
--- a/plugins/symlink/Makefile.am	Mon Jun 15 19:13:45 2009 +0000
+++ b/plugins/symlink/Makefile.am	Mon Jun 15 20:50:35 2009 +0000
@@ -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)
--- a/plugins/symlink/symlink.desktop	Mon Jun 15 19:13:45 2009 +0000
+++ b/plugins/symlink/symlink.desktop	Mon Jun 15 20:50:35 2009 +0000
@@ -2,7 +2,6 @@
 Version=1.0
 Type=Application
 Name=Symlink
-#Name[cs]=
 
 # call the helper script
 Exec=geeqie-symlink %f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/symlink/symlink.desktop.in	Mon Jun 15 20:50:35 2009 +0000
@@ -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
--- a/po/Makefile.in.in.patch	Mon Jun 15 19:13:45 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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 \
--- a/po/POTFILES.in	Mon Jun 15 19:13:45 2009 +0000
+++ b/po/POTFILES.in	Mon Jun 15 20:50:35 2009 +0000
@@ -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
--- a/po/README	Mon Jun 15 19:13:45 2009 +0000
+++ b/po/README	Mon Jun 15 20:50:35 2009 +0000
@@ -4,8 +4,8 @@
 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).