GNOME Bugzilla – Bug 785165
Set translation domain for parameter_string in gtk_init_with_args
Last modified: 2017-09-03 13:47:27 UTC
Created attachment 356022 [details] [review] git am patch to set the translation domain for parameter_string The translation domain passed in gtk_init_with_args() is not set for the parameter_string argument, only for the entries argument, that's why gtk_init_with_args(&argc, &argv, _("foo"), entries, GETTEXT_PACKAGE, &error); doesn't work in terms of l10n. This has already been reported as bug 554926 and has been fixed for GTK+ 2.90.5, but it is still missing in GTK+ 2.24.
Review of attachment 356022 [details] [review]: Looks fine to me
Comment on attachment 356022 [details] [review] git am patch to set the translation domain for parameter_string >From b880e13b29859ce88f1fda5080f87f6a58072236 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Ingo=20Br=C3=BCckl?= <ib@wupperonline.de> >Date: Thu, 20 Jul 2017 11:27:29 +0200 >Subject: [PATCH] Set translation domain for parameter_string in > gtk_init_with_args > >This was requested in bug 554926. > >Backport of original commit e3bd926c1ef83027c756488ba19f4353930fc6db by >Gabor Kelemen, kelemeng at gnome dot hu, applied to GTK+ 2.90.5 on Tue, >10 Aug 2010 04:13:22 +0000 (UTC). >--- > gtk/gtkmain.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c >index 4fb791d91..8c331a79a 100644 >--- a/gtk/gtkmain.c >+++ b/gtk/gtkmain.c >@@ -876,7 +876,7 @@ gtk_get_option_group (gboolean open_default_display) > * of #GOptionEntry<!-- -->s describing the options of your program > * @translation_domain: a translation domain to use for translating > * the <option>--help</option> output for the options in @entries >- * with gettext(), or %NULL >+ * and the @parameter_string with gettext(), or %NULL > * @error: a return location for errors > * > * This function does the same work as gtk_init_check(). >@@ -915,6 +915,8 @@ gtk_init_with_args (int *argc, > context = g_option_context_new (parameter_string); > g_option_context_add_group (context, gtk_group); > >+ g_option_context_set_translation_domain (context, translation_domain); >+ > if (entries) > g_option_context_add_main_entries (context, entries, translation_domain); > retval = g_option_context_parse (context, argc, argv, error); >-- >2.13.3 >