bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] [PATCH] examples: Add new example 'hello-c-gnome3'


From: Daiki Ueno
Subject: [bug-gettext] [PATCH] examples: Add new example 'hello-c-gnome3'
Date: Tue, 15 Apr 2014 16:59:50 +0900

---
 gettext-tools/examples/ChangeLog                   |  13 ++
 gettext-tools/examples/Makefile.am                 |  14 ++
 gettext-tools/examples/README                      |   7 +-
 gettext-tools/examples/hello-c-gnome3/INSTALL      |  16 +++
 gettext-tools/examples/hello-c-gnome3/Makefile.am  |  40 ++++++
 gettext-tools/examples/hello-c-gnome3/autoclean.sh |  59 +++++++++
 gettext-tools/examples/hello-c-gnome3/autogen.sh   |  29 +++++
 gettext-tools/examples/hello-c-gnome3/configure.ac |  52 ++++++++
 gettext-tools/examples/hello-c-gnome3/hello.c      | 143 +++++++++++++++++++++
 .../examples/hello-c-gnome3/hello.desktop.in       |   5 +
 .../examples/hello-c-gnome3/hello.gresource.xml    |   6 +
 gettext-tools/examples/hello-c-gnome3/hello.ui     |  56 ++++++++
 .../examples/hello-c-gnome3/m4/Makefile.am         |   6 +
 gettext-tools/examples/hello-c-gnome3/po/LINGUAS   |   5 +
 gettext-tools/examples/hello-c-gnome3/po/Makevars  |  67 ++++++++++
 .../examples/hello-c-gnome3/po/POTFILES.in         |   7 +
 gettext-tools/examples/po/Makefile.am              |  12 ++
 17 files changed, 534 insertions(+), 3 deletions(-)
 create mode 100644 gettext-tools/examples/hello-c-gnome3/INSTALL
 create mode 100644 gettext-tools/examples/hello-c-gnome3/Makefile.am
 create mode 100755 gettext-tools/examples/hello-c-gnome3/autoclean.sh
 create mode 100755 gettext-tools/examples/hello-c-gnome3/autogen.sh
 create mode 100644 gettext-tools/examples/hello-c-gnome3/configure.ac
 create mode 100644 gettext-tools/examples/hello-c-gnome3/hello.c
 create mode 100644 gettext-tools/examples/hello-c-gnome3/hello.desktop.in
 create mode 100644 gettext-tools/examples/hello-c-gnome3/hello.gresource.xml
 create mode 100644 gettext-tools/examples/hello-c-gnome3/hello.ui
 create mode 100644 gettext-tools/examples/hello-c-gnome3/m4/Makefile.am
 create mode 100644 gettext-tools/examples/hello-c-gnome3/po/LINGUAS
 create mode 100644 gettext-tools/examples/hello-c-gnome3/po/Makevars
 create mode 100644 gettext-tools/examples/hello-c-gnome3/po/POTFILES.in

diff --git a/gettext-tools/examples/ChangeLog b/gettext-tools/examples/ChangeLog
index a8bda3d..dbef733 100644
--- a/gettext-tools/examples/ChangeLog
+++ b/gettext-tools/examples/ChangeLog
@@ -1,3 +1,16 @@
+2014-04-15  Daiki Ueno  <address@hidden>
+
+       examples: Add a new example 'hello-c-gnome3'
+       * hello-c-gnome3: New subdirectory.
+       * README: Mention it.
+       * Makefile.am (EXAMPLESFILES): Add the files in hello-c-gnome3.
+       (EXAMPLESDIRS): Add hello-c-gnome3.
+       * po/Makefile.am (POTFILES): Add hello-c-gnome3 source.
+       (SMALLPOTS): Add hello-c-gnome3.pot.
+       (hello-c-gnome3.pot): New rule.
+       (SMALLPOFILES_FOR_lang): Add hello-c-gnome3 elements.
+       (../hello-c-gnome3/po/$(LL).po): New rule.
+
 2013-06-10  Daiki Ueno  <address@hidden>
 
        * Makefile.am: Use $(MKDIR_P) instead of $(mkdir_p).
diff --git a/gettext-tools/examples/Makefile.am 
b/gettext-tools/examples/Makefile.am
index 63a1c8b..c2eb639 100644
--- a/gettext-tools/examples/Makefile.am
+++ b/gettext-tools/examples/Makefile.am
@@ -51,6 +51,19 @@ EXAMPLESFILES = \
   hello-c-gnome/po/Makevars \
   hello-c-gnome/po/POTFILES.in \
   \
+  hello-c-gnome3/INSTALL \
+  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.gresource.xml \
+  hello-c-gnome3/hello.ui \
+  hello-c-gnome3/Makefile.am \
+  hello-c-gnome3/configure.ac \
+  hello-c-gnome3/m4/Makefile.am \
+  hello-c-gnome3/po/Makevars \
+  hello-c-gnome3/po/POTFILES.in \
+  \
   hello-c++/INSTALL \
   hello-c++/autogen.sh \
   hello-c++/autoclean.sh \
@@ -361,6 +374,7 @@ EXAMPLESFILES = \
 EXAMPLESDIRS = \
   hello-c \
   hello-c-gnome \
+  hello-c-gnome3 \
   hello-c++ \
   hello-c++-qt \
   hello-c++-kde \
diff --git a/gettext-tools/examples/README b/gettext-tools/examples/README
index b57664b..4eff716 100644
--- a/gettext-tools/examples/README
+++ b/gettext-tools/examples/README
@@ -6,15 +6,16 @@ environment.
     Example                    Language          GUI Environment
 
     hello-c                    C
-    hello-c-gnome              C                 GNOME
+    hello-c-gnome              C                 GNOME (obsolete)
+    hello-c-gnome3             C                 GNOME 3.10 or later
     hello-c++                  C++
     hello-c++-qt               C++               Qt
     hello-c++-kde              C++               KDE
-    hello-c++-gnome            C++               GNOME
+    hello-c++-gnome            C++               GNOME (obsolete)
     hello-c++-wxwidgets        C++               wxWidgets
     hello-objc                 ObjectiveC
     hello-objc-gnustep         ObjectiveC        GNUstep
-    hello-objc-gnome           ObjectiveC        GNOME
+    hello-objc-gnome           ObjectiveC        GNOME (obsolete)
     hello-sh                   Shell
     hello-python               Python
     hello-clisp                Lisp
diff --git a/gettext-tools/examples/hello-c-gnome3/INSTALL 
b/gettext-tools/examples/hello-c-gnome3/INSTALL
new file mode 100644
index 0000000..6a6db9a
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/INSTALL
@@ -0,0 +1,16 @@
+This example relies on:
+  - the GNOME libraries (libgnomeui, libgnome, libgnomesupport, libart_lgpl)
+    and their dependencies: imlib (libgdk_imlib), audiofile (libaudiofile),
+    esound (libesd), zlib (libz).
+  - the GTK libraries (libgtk, libgdk)
+  - the glib libraries (libglib, libgmodule)
+  - the X11 libraries
+
+Installation:
+  ./autogen.sh
+  ./configure --prefix=/some/prefix
+  make
+  make install
+Cleanup:
+  make distclean
+  ./autoclean.sh
diff --git a/gettext-tools/examples/hello-c-gnome3/Makefile.am 
b/gettext-tools/examples/hello-c-gnome3/Makefile.am
new file mode 100644
index 0000000..a4be933
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/Makefile.am
@@ -0,0 +1,40 @@
+# Example for use of GNU gettext.
+# This file is in the public domain.
+#
+# Makefile configuration - processed by automake.
+
+# General automake options.
+AUTOMAKE_OPTIONS = foreign no-dependencies
+ACLOCAL_AMFLAGS = -I m4
+
+# The list of subdirectories containing Makefiles.
+SUBDIRS = m4 po
+
+# The list of programs that are built.
+bin_PROGRAMS = hello
+
+# The source files of the 'hello' program.
+hello_SOURCES = hello.c resources.c
+
+# Define a C macro LOCALEDIR indicating where catalogs will be installed.
+DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
+# Make sure the gnome.h include file is found.
+AM_CPPFLAGS = $(GTK_CFLAGS)
+
+# Link time dependencies.
+LDADD = $(GTK_LIBS) @LIBINTL@
+
+# Compile assets into a C source and link it with the application.
+BUILT_SOURCES = resources.c
+
+resources.c: hello.gresource.xml hello.ui
+       $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/hello.gresource.xml \
+               --target=$@ --sourcedir=$(srcdir) --generate-source
+
+desktopdir = $(datadir)/applications
+desktop_DATA = hello.desktop
+
+# Additional files to be distributed.
+EXTRA_DIST = autogen.sh autoclean.sh \
+       hello.ui hello.desktop.in hello.gresource.xml
diff --git a/gettext-tools/examples/hello-c-gnome3/autoclean.sh 
b/gettext-tools/examples/hello-c-gnome3/autoclean.sh
new file mode 100755
index 0000000..2968f90
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/autoclean.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Example for use of GNU gettext.
+# This file is in the public domain.
+#
+# Script for cleaning all autogenerated files.
+
+test ! -f Makefile || make distclean
+
+# Brought in by autopoint.
+rm -f ABOUT-NLS
+rm -f config.rpath
+rm -f m4/codeset.m4
+rm -f m4/gettext.m4
+rm -f m4/glibc2.m4
+rm -f m4/glibc21.m4
+rm -f m4/iconv.m4
+rm -f m4/intdiv0.m4
+rm -f m4/intl.m4
+rm -f m4/intldir.m4
+rm -f m4/intlmacosx.m4
+rm -f m4/intmax.m4
+rm -f m4/inttypes-pri.m4
+rm -f m4/inttypes_h.m4
+rm -f m4/lcmessage.m4
+rm -f m4/lib-ld.m4
+rm -f m4/lib-link.m4
+rm -f m4/lib-prefix.m4
+rm -f m4/lock.m4
+rm -f m4/longlong.m4
+rm -f m4/nls.m4
+rm -f m4/po.m4
+rm -f m4/printf-posix.m4
+rm -f m4/progtest.m4
+rm -f m4/size_max.m4
+rm -f m4/stdint_h.m4
+rm -f m4/uintmax_t.m4
+rm -f m4/visibility.m4
+rm -f m4/wchar_t.m4
+rm -f m4/wint_t.m4
+rm -f m4/xsize.m4
+rm -f po/Makefile.in.in
+rm -f po/remove-potcdate.sin
+
+# Generated by aclocal.
+rm -f aclocal.m4
+
+# Generated by autoconf.
+rm -f configure
+
+# Generated or brought in by automake.
+rm -f Makefile.in
+rm -f m4/Makefile.in
+rm -f install-sh
+rm -f missing
+rm -f config.guess
+rm -f config.sub
+rm -f po/*.pot
+rm -f po/stamp-po
+rm -f po/*.gmo
diff --git a/gettext-tools/examples/hello-c-gnome3/autogen.sh 
b/gettext-tools/examples/hello-c-gnome3/autogen.sh
new file mode 100755
index 0000000..7fc2283
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/autogen.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Example for use of GNU gettext.
+# This file is in the public domain.
+#
+# Script for regenerating all autogenerated files.
+
+autopoint -f # was: gettextize -f -c
+rm po/Makevars.template
+rm po/Rules-quot
+rm po/boldquot.sed
+rm po/address@hidden
+rm po/address@hidden
+rm po/insert-header.sin
+rm po/quot.sed
+
+aclocal -I m4
+
+autoconf
+
+automake -a -c
+
+cd po
+for f in *.po; do
+  if test -r "$f"; then
+    lang=`echo $f | sed -e 's,\.po$,,'`
+    msgfmt -c -o $lang.gmo $lang.po
+  fi
+done
+cd ..
diff --git a/gettext-tools/examples/hello-c-gnome3/configure.ac 
b/gettext-tools/examples/hello-c-gnome3/configure.ac
new file mode 100644
index 0000000..d065362
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/configure.ac
@@ -0,0 +1,52 @@
+dnl Example for use of GNU gettext.
+dnl This file is in the public domain.
+dnl
+dnl Configuration file - processed by autoconf.
+
+AC_INIT
+AC_CONFIG_SRCDIR(hello.c)
+AM_INIT_AUTOMAKE(hello-c-gnome3, 0)
+
+AC_PROG_CC
+AC_CHECK_HEADERS([unistd.h])
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION(0.18.3)
+
+dnl Check GNOME specific stuff.
+dnl
+dnl If you have full GNOME development environment installed on your
+dnl system, you should be able to use the following macros:
+dnl
+dnl   AM_PATH_GLIB_2_0
+dnl   PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.10], ,
+dnl     [AC_MSG_ERROR([can't find gtk+-3.0])])
+dnl
+dnl Here, in gettext-tools/examples, we do the checks manually for
+dnl simplicity.
+
+AC_PATH_PROG(GLIB_COMPILE_RESOURCES, [glib-compile-resources])
+AS_IF([test -z "$GLIB_COMPILE_RESOURCES"], [
+  AC_MSG_ERROR([can't find glib-compile-resources])
+])
+
+AC_PATH_PROG([PKG_CONFIG], [pkg-config])
+AS_IF([test -z "$PKG_CONFIG"], [
+  AC_MSG_ERROR([can't find pkg-config])
+])
+
+GTK="gtk+-3.0 >= 3.10"
+AS_IF(["$PKG_CONFIG" --exists "$GTK"], , [
+  AC_MSG_ERROR([can't find $GTK])
+])
+
+GTK_CFLAGS=`"$PKG_CONFIG" --cflags "$GTK"`
+AC_SUBST(GTK_CFLAGS)
+
+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.c 
b/gettext-tools/examples/hello-c-gnome3/hello.c
new file mode 100644
index 0000000..d079e8d
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/hello.c
@@ -0,0 +1,143 @@
+/* Example for use of GNU gettext.
+   This file is in the public domain.
+
+   Source code of the C program.  */
+
+
+/* Get GTK declarations.  */
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+/* Get getpid() declaration.  */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+static void
+quit_callback (GtkWidget *widget, void *data)
+{
+  g_application_quit (G_APPLICATION (data));
+}
+
+/* Forward declaration of GObject types.  */
+#define HELLO_TYPE_APPLICATION_WINDOW (hello_application_window_get_type ())
+#define HELLO_APPLICATION_WINDOW(obj)                           \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj),                           \
+                               HELLO_TYPE_APPLICATION_WINDOW,   \
+                               HelloApplicationWindow))
+
+typedef struct _HelloApplicationWindow HelloApplicationWindow;
+typedef struct _HelloApplicationWindowClass HelloApplicationWindowClass;
+
+#define HELLO_TYPE_APPLICATION (hello_application_get_type ())
+#define HELLO_APPLICATION(obj)                          \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj),                   \
+                               HELLO_TYPE_APPLICATION,  \
+                               HelloApplication))
+
+typedef struct _HelloApplication HelloApplication;
+typedef struct _HelloApplicationClass HelloApplicationClass;
+
+/* Custom application window implementation.  */
+
+struct _HelloApplicationWindow
+{
+  GtkApplicationWindow parent;
+  GtkWidget *label2;
+  GtkWidget *button;
+};
+
+struct _HelloApplicationWindowClass
+{
+  GtkApplicationWindowClass parent_class;
+};
+
+G_DEFINE_TYPE (HelloApplicationWindow, hello_application_window,
+               GTK_TYPE_APPLICATION_WINDOW);
+
+static void
+hello_application_window_init (HelloApplicationWindow *window)
+{
+  char *label;
+
+  gtk_widget_init_template (GTK_WIDGET (window));
+  label = g_strdup_printf (_("This program is running as process number %d."),
+                           getpid ());
+  gtk_label_set_label (GTK_LABEL (window->label2), label);
+  g_free (label);
+}
+
+static void
+hello_application_window_class_init (HelloApplicationWindowClass *klass)
+{
+  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
+                                               
"/org/gnu/gettext/examples/hello/hello.ui");
+  gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (klass),
+                                        HelloApplicationWindow, label2);
+  gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (klass),
+                                        HelloApplicationWindow, button);
+}
+
+static HelloApplicationWindow *
+hello_application_window_new (HelloApplication *application)
+{
+  return g_object_new (HELLO_TYPE_APPLICATION_WINDOW,
+                       "application", application,
+                       NULL);
+}
+
+/* Custom application implementation.  */
+
+struct _HelloApplication
+{
+  GtkApplication parent;
+};
+
+struct _HelloApplicationClass
+{
+  GtkApplicationClass parent_class;
+};
+
+G_DEFINE_TYPE (HelloApplication, hello_application, GTK_TYPE_APPLICATION);
+
+static void
+hello_application_init (HelloApplication *application)
+{
+}
+
+static void
+hello_application_activate (GApplication *application)
+{
+  HelloApplicationWindow *window;
+
+  window = hello_application_window_new (HELLO_APPLICATION (application));
+  g_signal_connect (window->button, "clicked",
+                    G_CALLBACK (quit_callback), application);
+  gtk_window_present (GTK_WINDOW (window));
+}
+
+static void
+hello_application_class_init (HelloApplicationClass *klass)
+{
+  G_APPLICATION_CLASS (klass)->activate = hello_application_activate;
+}
+
+static HelloApplication *
+hello_application_new (void)
+{
+  return g_object_new (HELLO_TYPE_APPLICATION,
+                       "application-id", "org.gnu.gettext-examples.hello",
+                       NULL);
+}
+
+int
+main (int argc, char *argv[])
+{
+  /* Initializations.  */
+  textdomain ("hello-c-gnome3");
+  bindtextdomain ("hello-c-gnome3", LOCALEDIR);
+
+  /* Start the application.  */
+  return g_application_run (G_APPLICATION (hello_application_new ()),
+                            argc, argv);
+}
diff --git a/gettext-tools/examples/hello-c-gnome3/hello.desktop.in 
b/gettext-tools/examples/hello-c-gnome3/hello.desktop.in
new file mode 100644
index 0000000..d5d9b49
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/hello.desktop.in
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Type=Application
+Name=Hello
+StartupNotify=true
address@hidden@/hello
diff --git a/gettext-tools/examples/hello-c-gnome3/hello.gresource.xml 
b/gettext-tools/examples/hello-c-gnome3/hello.gresource.xml
new file mode 100644
index 0000000..4d2c278
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/hello.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnu/gettext/examples/hello">
+    <file preprocess="xml-stripblanks">hello.ui</file>
+  </gresource>
+</gresources>
diff --git a/gettext-tools/examples/hello-c-gnome3/hello.ui 
b/gettext-tools/examples/hello-c-gnome3/hello.ui
new file mode 100644
index 0000000..9dc5c08
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/hello.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.10 -->
+  <template class="HelloApplicationWindow" parent="GtkApplicationWindow">
+    <property name="title" translatable="yes">Example Application</property>
+    <property name="default-width">600</property>
+    <property name="default-height">400</property>
+    <child>
+      <object class="GtkBox" id="panel">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <child>
+         <object class="GtkAlignment" id="label1aligned">
+            <property name="visible">True</property>
+            <property name="xalign">0.0</property>
+            <property name="yalign">0.5</property>
+            <property name="xscale">0</property>
+            <property name="yscale">0</property>
+            <child>
+             <object class="GtkLabel" id="label1">
+               <property name="visible">True</property>
+                <property name="label" translatable="yes">Hello, 
world!</property>
+             </object>
+           </child>
+         </object>
+        </child>
+        <child>
+         <object class="GtkAlignment" id="label2aligned">
+            <property name="visible">True</property>
+            <property name="xalign">0.0</property>
+            <property name="yalign">0.5</property>
+            <property name="xscale">0</property>
+            <property name="yscale">0</property>
+            <child>
+             <object class="GtkLabel" id="label2">
+               <property name="visible">True</property>
+             </object>
+           </child>
+         </object>
+        </child>
+        <child>
+         <object class="GtkHButtonBox" id="buttonbar">
+            <property name="visible">True</property>
+           <child>
+             <object class="GtkButton" id="button">
+               <property name="visible">True</property>
+                <property name="label">gtk-ok</property>
+                <property name="use_stock">True</property>
+             </object>
+           </child>
+         </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>
diff --git a/gettext-tools/examples/hello-c-gnome3/m4/Makefile.am 
b/gettext-tools/examples/hello-c-gnome3/m4/Makefile.am
new file mode 100644
index 0000000..dc63c0f
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/m4/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = \
+  codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 \
+  inttypes_h.m4 inttypes-pri.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 \
+  lib-prefix.m4 lock.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 \
+  uintmax_t.m4 visibility.m4 \
+  gnome.m4 gnome-gnorba-check.m4 gnome-orbit-check.m4
diff --git a/gettext-tools/examples/hello-c-gnome3/po/LINGUAS 
b/gettext-tools/examples/hello-c-gnome3/po/LINGUAS
new file mode 100644
index 0000000..9f5ec65
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/po/LINGUAS
@@ -0,0 +1,5 @@
+# Example for use of GNU gettext.
+# This file is in the public domain.
+#
+# Set of available languages.
+af ast bg ca cs da de el eo es fi fr ga gl hr hu id it ja ky lv ms mt nb nl pl 
pt ro ru sk sl sr sv tr uk vi zh_CN zh_HK zh_TW
diff --git a/gettext-tools/examples/hello-c-gnome3/po/Makevars 
b/gettext-tools/examples/hello-c-gnome3/po/Makevars
new file mode 100644
index 0000000..7b158ff
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/po/Makevars
@@ -0,0 +1,67 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = \
+  --keyword=_ --flag=_:1:pass-c-format \
+  --keyword=N_ --flag=N_:1:pass-c-format \
+  --flag=g_log:3:c-format --flag=g_logv:3:c-format \
+  --flag=g_error:1:c-format --flag=g_message:1:c-format \
+  --flag=g_critical:1:c-format --flag=g_warning:1:c-format \
+  --flag=g_print:1:c-format \
+  --flag=g_printerr:1:c-format \
+  --flag=g_strdup_printf:1:c-format --flag=g_strdup_vprintf:1:c-format \
+  --flag=g_printf_string_upper_bound:1:c-format \
+  --flag=g_snprintf:3:c-format --flag=g_vsnprintf:3:c-format \
+  --flag=g_string_sprintf:2:c-format \
+  --flag=g_string_sprintfa:2:c-format \
+  --flag=g_scanner_error:2:c-format \
+  --flag=g_scanner_warn:2:c-format
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Yoyodyne, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = address@hidden
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context.  Possible values are "yes" and "no".  Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+#   --previous            to keep previous msgids of translated messages,
+#   --quiet               to reduce the verbosity.
+MSGMERGE_OPTIONS = --quiet
diff --git a/gettext-tools/examples/hello-c-gnome3/po/POTFILES.in 
b/gettext-tools/examples/hello-c-gnome3/po/POTFILES.in
new file mode 100644
index 0000000..fef36f6
--- /dev/null
+++ b/gettext-tools/examples/hello-c-gnome3/po/POTFILES.in
@@ -0,0 +1,7 @@
+# Example for use of GNU gettext.
+# This file is in the public domain.
+#
+# List of files which contain translatable strings.
+hello.c
+hello.desktop
+hello.ui
diff --git a/gettext-tools/examples/po/Makefile.am 
b/gettext-tools/examples/po/Makefile.am
index dc8c451..ac6b4c0 100644
--- a/gettext-tools/examples/po/Makefile.am
+++ b/gettext-tools/examples/po/Makefile.am
@@ -22,6 +22,10 @@ AUTOMAKE_OPTIONS = 1.5 gnits
 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.gresource.xml \
+  hello-c-gnome3/hello.ui \
   hello-c++/hello.cc \
   hello-c++-qt/hello.cc \
   hello-c++-kde/hello.cc \
@@ -61,6 +65,7 @@ POTFILES = \
 SMALLPOTS = \
   hello-c.pot \
   hello-c-gnome.pot \
+  hello-c-gnome3.pot \
   hello-c++.pot \
   hello-c++-qt.pot \
   hello-c++-kde.pot \
@@ -216,6 +221,9 @@ hello-c.pot : $(POTFILES_DEPS)
 hello-c-gnome.pot : $(POTFILES_DEPS)
        $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c-gnome
 
+hello-c-gnome3.pot : $(POTFILES_DEPS)
+       $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c-gnome3
+
 hello-c++.pot : $(POTFILES_DEPS)
        $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++
 
@@ -378,6 +386,7 @@ $(DUMMYPOFILES):
 SMALLPOFILES_FOR_lang = \
   ../hello-c/po/$$lang.po \
   ../hello-c-gnome/po/$$lang.po \
+  ../hello-c-gnome3/po/$$lang.po \
   ../hello-c++/po/$$lang.po \
   ../hello-c++-qt/po/$$lang.po \
   ../hello-c++-kde/po/$$lang.po \
@@ -412,6 +421,9 @@ SMALLPOFILES_FOR_lang = \
 ../hello-c-gnome/po/$(LL).po: hello-c-gnome.pot $(LL).po
        $(SHELL) mmsmallpo.sh hello-c-gnome $(LL)
 
+../hello-c-gnome3/po/$(LL).po: hello-c-gnome3.pot $(LL).po
+       $(SHELL) mmsmallpo.sh hello-c-gnome3 $(LL)
+
 ../hello-c++/po/$(LL).po: hello-c++.pot $(LL).po
        $(SHELL) mmsmallpo.sh hello-c++ $(LL)
 
-- 
1.9.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]