After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785165 - Set translation domain for parameter_string in gtk_init_with_args
Set translation domain for parameter_string in gtk_init_with_args
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.24.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-07-20 09:41 UTC by ibcoverity
Modified: 2017-09-03 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
git am patch to set the translation domain for parameter_string (1.52 KB, patch)
2017-07-20 09:41 UTC, ibcoverity
committed Details | Review

Description ibcoverity 2017-07-20 09:41:54 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.
Comment 1 Matthias Clasen 2017-09-03 13:41:32 UTC
Review of attachment 356022 [details] [review]:

Looks fine to me
Comment 2 Daniel Boles 2017-09-03 13:47:27 UTC
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
>