]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
examples: Utilize msgfmt --desktop
authorDaiki Ueno <ueno@gnu.org>
Wed, 16 Apr 2014 03:10:43 +0000 (12:10 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 16 Apr 2014 09:10:41 +0000 (18:10 +0900)
gettext-tools/examples/Makefile.am
gettext-tools/examples/hello-c-gnome3/Makefile.am
gettext-tools/examples/hello-c-gnome3/configure.ac
gettext-tools/examples/hello-c-gnome3/hello.desktop.in.in [moved from gettext-tools/examples/hello-c-gnome3/hello.desktop.in with 79% similarity]
gettext-tools/examples/hello-c-gnome3/po/POTFILES.in
gettext-tools/examples/po/Makefile.am

index c2eb6395f8295855d0fbc52be83d44780859d694..4f9f340a6a7da4afc786a126119907bc03fb8c83 100644 (file)
@@ -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 \
index a4be9333ddacef36eaa64b1e48588c487986cb36..0dc68b80b1c11fb901c612d950904823f56cf80f 100644 (file)
@@ -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
index d06536236cc000ca396a27164cd925fee1b4a4de..e51d4d82c970ca6f3f3f963255cd312bf3896416 100644 (file)
@@ -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
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 d5d9b49f4d526945954fb2d23b6f920f906142b1..a31bf93375d7754ef52943e022d0a8cbf22ddd86 100644 (file)
@@ -1,5 +1,6 @@
 [Desktop Entry]
 Type=Application
 Name=Hello
+Comment=Hello, world!
 StartupNotify=true
 Exec=@bindir@/hello
index fef36f6c6d9db5ce0c8a8aacb6bed35e81584a3e..ce9a16e1bb4a47756f5c6695822ee1a383f2dc5e 100644 (file)
@@ -3,5 +3,5 @@
 #
 # List of files which contain translatable strings.
 hello.c
-hello.desktop
+hello.desktop.in.in
 hello.ui
index ac6b4c03445082b09a7bf10190827a7c0031245b..50abd132e7676b6b5d783533ce7239e827edc939 100644 (file)
@@ -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 \