[glib/glib-2-44] gapplication: Make sure --help output is translated
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-44] gapplication: Make sure --help output is translated
- Date: Tue, 9 Jun 2015 11:50:03 +0000 (UTC)
commit 6ea16c1cddbedc59982bf7ab00ba93677805e5f1
Author: Christophe Fergeau <cfergeau redhat com>
Date: Wed Jun 3 11:30:43 2015 +0200
gapplication: Make sure --help output is translated
Currently, applications using g_application_add_main_option_entries()
won't get translated entries in --help output. We need to call
g_option_group_set_translation_domain() with a NULL domain to ensure that the
default application gettext domain (ie the one passed to the
textdomain() call) will be used for the main entries passed by the
application.
If we want to allow more flexibility on which gettext domain should be
used for these entries, new API will be needed.
https://bugzilla.gnome.org/show_bug.cgi?id=750322
gio/gapplication.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gapplication.c b/gio/gapplication.c
index c72ff53..be7127a 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -670,7 +670,10 @@ g_application_add_main_option_entries (GApplication *application,
g_return_if_fail (entries != NULL);
if (!application->priv->main_options)
- application->priv->main_options = g_option_group_new (NULL, NULL, NULL, NULL, NULL);
+ {
+ application->priv->main_options = g_option_group_new (NULL, NULL, NULL, NULL, NULL);
+ g_option_group_set_translation_domain (application->priv->main_options, NULL);
+ }
for (i = 0; entries[i].long_name; i++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]