Re: [gtk-vnc-devel] PATCH: Fix gtk-vnc --help is not localized



Forget add po/POTFILES.in in last patch, please check the new one.

-Halton
On Thu, 2008-12-11 at 11:48 +0800, Halton Huo wrote:
> Hi,
> 
> This patch is from Takao, I remake it based on trunk. Please refer to
> bug
> https://sourceforge.net/tracker/index.php?func=detail&aid=2354859&group_id=190580&atid=933930
>  for more detail.
> 
> Thanks,
> Halton.
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Gtk-vnc-devel mailing list
> Gtk-vnc-devel lists sourceforge net
> https://lists.sourceforge.net/lists/listinfo/gtk-vnc-devel
diff -r d68935d582f0 autogen.sh
--- a/autogen.sh	Sun Dec 07 19:56:56 2008 +0000
+++ b/autogen.sh	Thu Dec 11 11:53:17 2008 +0800
@@ -45,6 +45,7 @@
 fi
 
 libtoolize --copy --force
+intltoolize --automake -c -f
 aclocal -I gnulib/m4
 autoheader
 automake --add-missing --copy
diff -r d68935d582f0 configure.ac
--- a/configure.ac	Sun Dec 07 19:56:56 2008 +0000
+++ b/configure.ac	Thu Dec 11 11:53:17 2008 +0800
@@ -42,6 +42,13 @@
 AC_PROG_LIBTOOL
 
 AC_CHECK_HEADERS([pwd.h winsock2.h])
+
+GETTEXT_PACKAGE=gtk-vnc
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
+
+IT_PROG_INTLTOOL([0.35.0])
+AM_GLIB_GNU_GETTEXT
 
 AC_ARG_WITH(python,
 [  --with-python           build python bindings],
@@ -240,6 +247,7 @@
   src/Makefile
   examples/Makefile
   plugin/Makefile
+  po/Makefile.in
   gtk-vnc-1.0.pc
   gtk-vnc.spec
   mingw32-gtk-vnc.spec
diff -r d68935d582f0 po/POTFILES.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/po/POTFILES.in	Thu Dec 11 11:53:17 2008 +0800
@@ -0,0 +1,3 @@
+# List of source files containing translatable strings.
+# Please keep this file sorted alphabetically.
+src/vncdisplay.c
diff -r d68935d582f0 src/vncdisplay.c
--- a/src/vncdisplay.c	Sun Dec 07 19:56:56 2008 +0000
+++ b/src/vncdisplay.c	Thu Dec 11 11:53:17 2008 +0800
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <gdk/gdkkeysyms.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib/gi18n-lib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -164,7 +165,7 @@
 
 static const GOptionEntry gtk_vnc_args[] =
 {
-  { "gtk-vnc-debug", 0, 0, G_OPTION_ARG_NONE, &debug_enabled, "Enables debug output", 0 },
+  { "gtk-vnc-debug", 0, 0, G_OPTION_ARG_NONE, &debug_enabled, N_("Enables debug output"), 0 },
   { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, 0 }
 };
 
@@ -2173,14 +2174,28 @@
 	return obj->priv->absolute;
 }
 
+static int translation_init ()
+{
+	static int initialized = 0;
+	if (initialized == 1)
+		return 0;
+
+	bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale");
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
+	return 0;
+}
+
 GOptionGroup *
 vnc_display_get_option_group (void)
 {
   GOptionGroup *group;
 
-  group = g_option_group_new ("gtk-vnc", "GTK-VNC Options", "Show GTK-VNC Options", NULL, NULL);
+  translation_init ();
+  group = g_option_group_new ("gtk-vnc", N_("GTK-VNC Options"), N_("Show GTK-VNC Options"), NULL, NULL);
 
   g_option_group_add_entries (group, gtk_vnc_args);
+  g_option_group_set_translation_domain (group, GETTEXT_PACKAGE);
   
   return group;
 }


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