--help i18n patch for gnome-libs



Recently, translators trying to translate Nautilus noticed some
non-translated strings in the command-line help. Here are the sources of
some of the strings. Note that the solution for translating "%s options" is
not good enough. For GNOME 2.0 we probably want to change the
gnome_init_with_popt_table API (add a new call with another parameter,
perhaps) so it can be translated properly.

This patch is for the stable branch, but we could fix this just on HEAD, or
in both places. Please advise what you'd like me to do. I'd be happy to
commit the fix if given the OK.

My apologies if my mailer has munged the patch slightly, but I think you get
the idea.

Index: libgnomeui/gnome-init.c
===================================================================
RCS file: /cvs/gnome/gnome-libs/libgnomeui/gnome-init.c,v
retrieving revision 1.100.4.6
diff -p -u -r1.100.4.6 gnome-init.c
--- libgnomeui/gnome-init.c    2000/09/21 11:45:38    1.100.4.6
+++ libgnomeui/gnome-init.c    2001/01/09 16:33:37
@@ -294,9 +294,8 @@ static const struct poptOption gnome_opt
 static void
 gnome_register_options(void)
 {
-    gnomelib_register_popt_table(gtk_options, "GTK options");
-
-    gnomelib_register_popt_table(gnome_options, "GNOME GUI options");
+    gnomelib_register_popt_table(gtk_options, _("GTK options"));
+    gnomelib_register_popt_table(gnome_options, _("GNOME GUI options"));
 }
 
 /* #define ALLOC_DEBUGGING_HOOKS */
@@ -450,9 +449,9 @@ gnome_init_with_popt_table(const char *a
     gnome_client_init();
     
     if(options) {
-        appdesc = alloca(sizeof(" options") + strlen(app_id));
-        strcpy(appdesc, app_id); strcat(appdesc, " options");
+        appdesc = g_strdup_printf(_("%s options"), app_id);
         gnomelib_register_popt_table(options, appdesc);
+        g_free(appdesc);
     }
     
     ctx = gnomelib_parse_args(argc, argv, flags);
Index: libgnorba/goad.c
===================================================================
RCS file: /cvs/gnome/gnome-libs/libgnorba/Attic/goad.c,v
retrieving revision 1.85.4.4
diff -p -u -r1.85.4.4 goad.c
--- libgnorba/goad.c    2000/04/08 23:00:22    1.85.4.4
+++ libgnorba/goad.c    2001/01/09 16:33:40
@@ -1364,5 +1364,5 @@ goad_register_arguments(void)
         {NULL, '\0', 0, NULL, 0}
     };
     
-    gnomelib_register_popt_table(options, "Gnome Object Activation
Directory");
+    gnomelib_register_popt_table(options, _("Gnome Object Activation
Directory"));
 }
===================================================================

    -- Darin





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