From 7c65e6c06c3f2bd3623c3144705bc0693772c0aa 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] 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 221662a..aef36da 100644 --- a/src/programs/pkaction.c +++ b/src/programs/pkaction.c @@ -125,6 +125,10 @@ main (int argc, char *argv[]) /* Disable remote file access from GIO. */ setenv ("GIO_USE_VFS", "local", 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 33db128..d8ed7a5 100644 --- a/src/programs/pkcheck.c +++ b/src/programs/pkcheck.c @@ -366,6 +366,10 @@ main (int argc, char *argv[]) /* Disable remote file access from GIO. */ setenv ("GIO_USE_VFS", "local", 1); + 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 8aac7dd..d167d43 100644 --- a/src/programs/pkttyagent.c +++ b/src/programs/pkttyagent.c @@ -78,6 +78,10 @@ main (int argc, char *argv[]) /* Disable remote file access from GIO. */ setenv ("GIO_USE_VFS", "local", 1); + setlocale (LC_ALL, ""); + textdomain (GETTEXT_PACKAGE); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + g_type_init (); error = NULL; -- 2.7.5