patches/gtkam-03-g11n-i18n.diff
author dcarbery
Fri, 24 Nov 2006 16:37:59 +0000
branch217update
changeset 19096 d542fc2c823e
parent 6467 404f78d6029b
permissions -rw-r--r--
Merged trunk changes r9797:9829 into 217update branch.

--- gtkam-0.1.13/configure.in.orig	2006-01-03 14:24:21.108558000 +0000
+++ gtkam-0.1.13/configure.in	2006-01-03 14:40:33.621499000 +0000
@@ -57,10 +60,15 @@
 dnl ---------------------------------------------------------------------------
 dnl i18n support
 dnl ---------------------------------------------------------------------------
+GETTEXT_PACKAGE=gtkam
+AC_SUBST(GETTEXT_PACKAGE)
 GP_GETTEXT_HACK([],[Lutz Müller and others],[${MAIL_GPHOTO_TRANSLATION}])
 ALL_LINGUAS="cs da de es fr hu it ja nb pl pt_BR pt_PT ru sl sv uk"
-AM_GNU_GETTEXT_VERSION([0.14.1])
-AM_GNU_GETTEXT([external])
+AM_GLIB_GNU_GETTEXT
+USE_INCLUDED_LIBINTL=no
+AC_SUBST(USE_INCLUDED_LIBINTL)
+BUILD_INCLUDED_LIBINTL=no
+AC_SUBST(BUILD_INCLUDED_LIBINTL)
 AM_PO_SUBDIRS()
 AM_ICONV()
 GP_GETTEXT_FLAGS()
diff -ur gtkam-0.1.11.after-patch-2/gexif-0.5/Makefile.am gtkam-0.1.11/gexif-0.5/Makefile.am
--- gtkam-0.1.11.after-patch-2/gexif-0.5/Makefile.am	2004-06-17 12:11:03.000000000 -0700
+++ gtkam-0.1.11/gexif-0.5/Makefile.am	2004-06-17 12:11:30.000000000 -0700
@@ -1,5 +1,10 @@
+NULL =
 SUBDIRS = intl m4  libjpeg gexif po
 
 ACLOCAL_AMFLAGS = -I m4
 
-EXTRA_DIST = config.rpath mkinstalldirs
+EXTRA_DIST = config.rpath mkinstalldirs \
+	intltool-extract.in \
+	intltool-merge.in \
+	intltool-update.in \
+	$(NULL)
diff -ur gtkam-0.1.11.after-patch-2/gexif-0.5/configure.in gtkam-0.1.11/gexif-0.5/configure.in
--- gtkam-0.1.11.after-patch-2/gexif-0.5/configure.in	2004-06-17 12:11:03.000000000 -0700
+++ gtkam-0.1.11/gexif-0.5/configure.in	2004-06-17 12:11:34.000000000 -0700
@@ -9,8 +9,15 @@
 dnl ---------------------------------------------------------------------------
 dnl i18n support
 dnl ---------------------------------------------------------------------------
+GETTEXT_PACKAGE=gexif
+AC_SUBST(GETTEXT_PACKAGE)
+AC_PROG_INTLTOOL
 ALL_LINGUAS="de es fr"
-AM_GNU_GETTEXT
+AM_GLIB_GNU_GETTEXT
+USE_INCLUDED_LIBINTL=no
+AC_SUBST(USE_INCLUDED_LIBINTL)
+BUILD_INCLUDED_LIBINTL=no
+AC_SUBST(BUILD_INCLUDED_LIBINTL)
 
 dnl ---------------------------------------------------------------------------
 dnl libexif
@@ -26,7 +33,13 @@
 AC_SUBST(GEXIF_LIBS)
 AC_SUBST(GEXIF_CFLAGS)
 
-CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
+dnl Only use -Wall if we have gcc
+if test "x$GCC" = "xyes"; then
+  if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
+    CFLAGS="$CFLAGS -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
+  fi
+fi
+
 AC_SUBST(CFLAGS)
 
 AC_OUTPUT([ intl/Makefile po/Makefile.in m4/Makefile 
diff -ur gtkam-0.1.11.after-patch-2/gexif-0.5/gexif/gexif-main.c gtkam-0.1.11/gexif-0.5/gexif/gexif-main.c
--- gtkam-0.1.11.after-patch-2/gexif-0.5/gexif/gexif-main.c	2004-06-17 12:11:03.000000000 -0700
+++ gtkam-0.1.11/gexif-0.5/gexif/gexif-main.c	2004-06-17 12:11:30.000000000 -0700
@@ -281,7 +281,7 @@
 action_about (gpointer callback_data, guint callback_action,
 	      GtkWidget *widget)
 {
-	g_warning ("Implement!");
+	g_warning (_("Implement!"));
 }
 
 static void
@@ -303,19 +303,25 @@
 
 static GtkItemFactoryEntry mi[] =
 {
-	{"/_File", NULL, 0, 0, "<Branch>"},
-	{"/File/_Open...", NULL, action_open, 0, "<StockItem>", GTK_STOCK_OPEN},
-	{"/File/_Save", NULL, action_save, 0, "<StockItem>", GTK_STOCK_SAVE},
-	{"/File/Save _As...", NULL, action_save_as, 0, "<StockItem>",
+	{N_("/_File"), NULL, 0, 0, "<Branch>"},
+	{N_("/File/_Open..."), NULL, action_open, 0, "<StockItem>", GTK_STOCK_OPEN},
+	{N_("/File/_Save"), NULL, action_save, 0, "<StockItem>", GTK_STOCK_SAVE},
+	{N_("/File/Save _As..."), NULL, action_save_as, 0, "<StockItem>",
 							GTK_STOCK_SAVE_AS},
-	{"/File/sep1", NULL, 0, 0, "<Separator>"},
-	{"/File/E_xit", NULL, action_exit, 0, "<StockItem>", GTK_STOCK_QUIT},
-	{"/_View", NULL, 0, 0, "<Branch>"},
-	{"/View/_Thumbnail", NULL, action_thumbnail, 0, NULL, NULL},
-	{"/_Help", NULL, 0, 0, "<Branch>"},
-	{"/Help/About", NULL, action_about, 0, NULL, NULL}
+	{N_("/File/sep1"), NULL, 0, 0, "<Separator>"},
+	{N_("/File/E_xit"), NULL, action_exit, 0, "<StockItem>", GTK_STOCK_QUIT},
+	{N_("/_View"), NULL, 0, 0, "<Branch>"},
+	{N_("/View/_Thumbnail"), NULL, action_thumbnail, 0, NULL, NULL},
+	{N_("/_Help"), NULL, 0, 0, "<Branch>"},
+	{N_("/Help/About"), NULL, action_about, 0, NULL, NULL}
 };
 
+static gchar *
+translate_func (const gchar *path, gpointer data)
+{
+	return g_strdup (_(path));
+}
+
 GtkWidget *
 gexif_main_new (void)
 {
@@ -337,6 +343,10 @@
 	ag = gtk_accel_group_new ();
 	gtk_window_add_accel_group (GTK_WINDOW (m), ag);
 	gif = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", ag);
+#ifdef ENABLE_NLS
+	gtk_item_factory_set_translate_func (GTK_ITEM_FACTORY (gif),
+					translate_func, NULL, NULL);
+#endif
 	g_object_set_data_full (G_OBJECT (m), "<main>", gif,
 				(GDestroyNotify) g_object_unref);
 	gtk_item_factory_create_items (gif, G_N_ELEMENTS (mi), mi, m);
diff -ur gtkam-0.1.11.after-patch-2/gexif-0.5/gexif/gexif.c gtkam-0.1.11/gexif-0.5/gexif/gexif.c
--- gtkam-0.1.11.after-patch-2/gexif-0.5/gexif/gexif.c	2004-06-17 12:11:03.000000000 -0700
+++ gtkam-0.1.11/gexif-0.5/gexif/gexif.c	2004-06-17 12:11:30.000000000 -0700
@@ -50,6 +50,7 @@
 
 	gtk_set_locale ();
 	bindtextdomain (PACKAGE, GEXIF_LOCALEDIR);
+	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
 
 	gtk_init (&argc, &argv);
diff -ur gtkam-0.1.11.after-patch-2/gexif-0.5/po/POTFILES.in gtkam-0.1.11/gexif-0.5/po/POTFILES.in
--- gtkam-0.1.11.after-patch-2/gexif-0.5/po/POTFILES.in	2004-06-17 12:11:03.000000000 -0700
+++ gtkam-0.1.11/gexif-0.5/po/POTFILES.in	2004-06-17 12:11:30.000000000 -0700
@@ -1 +1,2 @@
 gexif/gexif-main.c
+gexif/gexif-thumbnail.c
diff -ur gtkam-0.1.11.after-patch-2/po/POTFILES.in gtkam-0.1.11/po/POTFILES.in
--- gtkam-0.1.11.after-patch-2/po/POTFILES.in	2004-06-17 12:11:03.000000000 -0700
+++ gtkam-0.1.11/po/POTFILES.in	2004-06-17 12:11:18.000000000 -0700
@@ -1,3 +1,4 @@
+gtkam.desktop.in
 src/gtkam-cancel.c
 src/gtkam-chooser.c
 src/gtkam-close.c
diff -ur gtkam-0.1.11.after-patch-2/src/gtkam-tree.c gtkam-0.1.11/src/gtkam-tree.c
--- gtkam-0.1.11.after-patch-2/src/gtkam-tree.c	2004-06-17 12:11:03.000000000 -0700
+++ gtkam-0.1.11/src/gtkam-tree.c	2004-06-17 12:11:18.000000000 -0700
@@ -1143,9 +1143,10 @@
 		    strcmp (model, "Directory Browse")) {
 	                p = gp_port_info_list_lookup_path (il, port);
         	        if (p < 0) {
-                	        g_warning ("Could not find '%s' in port "
-					"info list (%s)!", port,
-					gp_result_as_string (p));
+                	        g_warning (_("Could not find '%s' in port "
+					"info list (%s)!"),
+					g_locale_to_utf8 (port, -1, NULL, NULL, NULL),
+					g_locale_to_utf8 (gp_result_as_string (p), -1, NULL, NULL, NULL));
 				gp_camera_unref (camera);
 				continue;
 			}