From: Daiki Ueno Date: Wed, 16 Apr 2014 03:10:43 +0000 (+0900) Subject: examples: Utilize msgfmt --desktop X-Git-Tag: v0.19~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43be67d5278994ef7819232cc8414e213e3db71f;p=thirdparty%2Fgettext.git examples: Utilize msgfmt --desktop --- diff --git a/gettext-tools/examples/Makefile.am b/gettext-tools/examples/Makefile.am index c2eb6395f..4f9f340a6 100644 --- a/gettext-tools/examples/Makefile.am +++ b/gettext-tools/examples/Makefile.am @@ -55,7 +55,7 @@ EXAMPLESFILES = \ hello-c-gnome3/autogen.sh \ hello-c-gnome3/autoclean.sh \ hello-c-gnome3/hello.c \ - hello-c-gnome3/hello.desktop.in \ + hello-c-gnome3/hello.desktop.in.in \ hello-c-gnome3/hello.gresource.xml \ hello-c-gnome3/hello.ui \ hello-c-gnome3/Makefile.am \ diff --git a/gettext-tools/examples/hello-c-gnome3/Makefile.am b/gettext-tools/examples/hello-c-gnome3/Makefile.am index a4be9333d..0dc68b80b 100644 --- a/gettext-tools/examples/hello-c-gnome3/Makefile.am +++ b/gettext-tools/examples/hello-c-gnome3/Makefile.am @@ -32,9 +32,20 @@ resources.c: hello.gresource.xml hello.ui $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/hello.gresource.xml \ --target=$@ --sourcedir=$(srcdir) --generate-source +# Merge translations into a Desktop Entry file. desktopdir = $(datadir)/applications desktop_DATA = hello.desktop +hello.desktop.in: hello.desktop.in.in + $(AM_V_GEN) sed -e "s|@bindir[@]|$(bindir)|" \ + -e "s|@VERSION[@]|$(VERSION)|" \ + $< > $@ || rm $@ + +hello.desktop: hello.desktop.in + $(AM_V_GEN) $(MSGFMT) --desktop --template $< -o $@ -d $(top_srcdir)/po + +CLEANFILES = $(BUILT_SOURCES) hello.desktop.in $(desktop_DATA) + # Additional files to be distributed. EXTRA_DIST = autogen.sh autoclean.sh \ - hello.ui hello.desktop.in hello.gresource.xml + hello.ui hello.desktop.in.in hello.gresource.xml diff --git a/gettext-tools/examples/hello-c-gnome3/configure.ac b/gettext-tools/examples/hello-c-gnome3/configure.ac index d06536236..e51d4d82c 100644 --- a/gettext-tools/examples/hello-c-gnome3/configure.ac +++ b/gettext-tools/examples/hello-c-gnome3/configure.ac @@ -46,7 +46,6 @@ GTK_LIBS=`"$PKG_CONFIG" --libs "$GTK"` AC_SUBST(GTK_LIBS) AC_CONFIG_FILES([Makefile]) -AC_CONFIG_FILES([hello.desktop]) AC_CONFIG_FILES([m4/Makefile]) AC_CONFIG_FILES([po/Makefile.in]) AC_OUTPUT diff --git a/gettext-tools/examples/hello-c-gnome3/hello.desktop.in b/gettext-tools/examples/hello-c-gnome3/hello.desktop.in.in similarity index 79% rename from gettext-tools/examples/hello-c-gnome3/hello.desktop.in rename to gettext-tools/examples/hello-c-gnome3/hello.desktop.in.in index d5d9b49f4..a31bf9337 100644 --- a/gettext-tools/examples/hello-c-gnome3/hello.desktop.in +++ b/gettext-tools/examples/hello-c-gnome3/hello.desktop.in.in @@ -1,5 +1,6 @@ [Desktop Entry] Type=Application Name=Hello +Comment=Hello, world! StartupNotify=true Exec=@bindir@/hello diff --git a/gettext-tools/examples/hello-c-gnome3/po/POTFILES.in b/gettext-tools/examples/hello-c-gnome3/po/POTFILES.in index fef36f6c6..ce9a16e1b 100644 --- a/gettext-tools/examples/hello-c-gnome3/po/POTFILES.in +++ b/gettext-tools/examples/hello-c-gnome3/po/POTFILES.in @@ -3,5 +3,5 @@ # # List of files which contain translatable strings. hello.c -hello.desktop +hello.desktop.in.in hello.ui diff --git a/gettext-tools/examples/po/Makefile.am b/gettext-tools/examples/po/Makefile.am index ac6b4c034..50abd132e 100644 --- a/gettext-tools/examples/po/Makefile.am +++ b/gettext-tools/examples/po/Makefile.am @@ -23,7 +23,7 @@ POTFILES = \ hello-c/hello.c \ hello-c-gnome/hello.c \ hello-c-gnome3/hello.c \ - hello-c-gnome3/hello.desktop.in \ + hello-c-gnome3/hello.desktop.in.in \ hello-c-gnome3/hello.gresource.xml \ hello-c-gnome3/hello.ui \ hello-c++/hello.cc \