From d61b81502a61d18e6fee5c74ed286e484a3587f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Sat, 20 Apr 2013 00:51:32 +0200 Subject: [PATCH 2/6] Set locale before processing command-line options The option description system supports translations, this makes them possible. It's by far not a full internationalization of the source base. https://bugs.freedesktop.org/show_bug.cgi?id=29936 --- src/programs/pkaction.c | 4 ++++ src/programs/pkcheck.c | 4 ++++ src/programs/pkttyagent.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/programs/pkaction.c b/src/programs/pkaction.c index 33b1759..4efc8b5 100644 --- a/src/programs/pkaction.c +++ b/src/programs/pkaction.c @@ -122,6 +122,10 @@ main (int argc, char *argv[]) description = NULL; ret = 1; + setlocale (LC_ALL, ""); + textdomain (GETTEXT_PACKAGE); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + g_type_init (); opt_show_version = FALSE; diff --git a/src/programs/pkcheck.c b/src/programs/pkcheck.c index 20713cc..6c9fba2 100644 --- a/src/programs/pkcheck.c +++ b/src/programs/pkcheck.c @@ -359,6 +359,10 @@ main (int argc, char *argv[]) local_agent_handle = NULL; ret = 126; + setlocale (LC_ALL, ""); + textdomain (GETTEXT_PACKAGE); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + g_type_init (); details = polkit_details_new (); diff --git a/src/programs/pkttyagent.c b/src/programs/pkttyagent.c index 7e18c30..fb4b592 100644 --- a/src/programs/pkttyagent.c +++ b/src/programs/pkttyagent.c @@ -73,6 +73,10 @@ main (int argc, char *argv[]) guint ret = 126; GVariantBuilder builder; + setlocale (LC_ALL, ""); + textdomain (GETTEXT_PACKAGE); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + g_type_init (); error = NULL; -- 1.8.1.4