From: Sergio Villar Senin Date: Wed, 24 Jun 2009 17:50:07 +0000 (+0200) Subject: Use setlocale() to get the current locale instead of getenv("LC_MESSAGES") X-Git-Tag: 3.0.17-rc20~12 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=33becceaa316d6e701008e34f4160a0631136583 Use setlocale() to get the current locale instead of getenv("LC_MESSAGES") --- diff --git a/src/modest-init.c b/src/modest-init.c index a4f4a89..f3f3c2c 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -602,11 +602,13 @@ init_debug_logging (void) static void init_i18n (void) { - const gchar *lc_messages = getenv ("LC_MESSAGES"); + const gchar *lc_messages = setlocale (LC_MESSAGES, NULL); if (!lc_messages) { setenv ("LANGUAGE", "en_GB", 1); setenv ("LC_MESSAGES", "en_GB", 1); + } else { + setenv ("LC_MESSAGES", lc_messages, 1); } bindtextdomain (GETTEXT_PACKAGE, MODEST_LOCALE_DIR); diff --git a/src/modest-utils.c b/src/modest-utils.c index c6e50e7..aac37ef 100644 --- a/src/modest-utils.c +++ b/src/modest-utils.c @@ -39,7 +39,7 @@ #include #include #include - +#include #include #include "modest-utils.h" #include "modest-platform.h" @@ -837,7 +837,7 @@ modest_utils_open_mcc_mapping_file (gboolean from_lc_messages, gboolean *transla gchar **parts, **node; if (from_lc_messages) { - env_list = getenv ("LC_MESSAGES"); + env_list = setlocale (LC_MESSAGES, NULL); } else { env_list = getenv ("LANG"); }