Use setlocale() to get the current locale instead of getenv("LC_MESSAGES")
authorSergio Villar Senin <svillar@igalia.com>
Wed, 24 Jun 2009 17:50:07 +0000 (19:50 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 24 Jun 2009 17:50:07 +0000 (19:50 +0200)
src/modest-init.c
src/modest-utils.c

index a4f4a89..f3f3c2c 100644 (file)
@@ -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);
index c6e50e7..aac37ef 100644 (file)
@@ -39,7 +39,7 @@
 #include <tny-camel-transport-account.h>
 #include <tny-camel-imap-store-account.h>
 #include <tny-camel-pop-store-account.h>
-
+#include <locale.h>
 #include <modest-defs.h>
 #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");
        }