From 98d28ca983ca26f015d88516e18fa4550b84887c Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 21 Aug 2011 08:29:04 +0000 Subject: [PATCH] E intl: Set LANG instead of LC_ALL when setting language. Also, don't force all the locale sections to be the same, let the user override LC_* however he likes. SVN revision: 62649 --- src/bin/e_intl.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index 88646c79c..8e87c207d 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -3,7 +3,6 @@ static Ecore_Exe *_e_intl_input_method_exec = NULL; static Ecore_Event_Handler *_e_intl_exit_handler = NULL; -static char *_e_intl_orig_lc_all = NULL; static char *_e_intl_orig_lang = NULL; static char *_e_intl_orig_language = NULL; static char *_e_intl_language = NULL; @@ -57,7 +56,6 @@ e_intl_init(void) e_intl_data_init(); - if ((s = getenv("LC_ALL"))) _e_intl_orig_lc_all = strdup(s); if ((s = getenv("LANG"))) _e_intl_orig_lang = strdup(s); if ((s = getenv("LANGUAGE"))) _e_intl_orig_language = strdup(s); @@ -73,7 +71,6 @@ EINTERN int e_intl_shutdown(void) { E_FREE(_e_intl_language); - E_FREE(_e_intl_orig_lc_all); E_FREE(_e_intl_orig_lang); E_FREE(_e_intl_orig_language); @@ -148,11 +145,10 @@ e_intl_language_set(const char *lang) */ if (!lang) { - e_util_env_set("LC_ALL", _e_intl_orig_lc_all); + e_util_env_set("LANG", _e_intl_orig_lang); if (!lang) lang = getenv("LC_ALL"); if (!lang) lang = getenv("LANG"); - if (!lang) lang = getenv("LANGUAGE"); set_envars = 0; } @@ -193,12 +189,12 @@ e_intl_language_set(const char *lang) /* Only set env vars is a non NULL locale was passed */ if (set_envars) { - e_util_env_set("LC_ALL", _e_intl_language); - e_util_env_set("LANG", NULL); + e_util_env_set("LANG", lang); + /* Unset LANGUAGE, apparently causes issues if set */ e_util_env_set("LANGUAGE", NULL); } - setlocale(LC_ALL, _e_intl_language); + setlocale(LC_ALL, ""); if (_e_intl_language) { char *locale_path;