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
This commit is contained in:
Tom Hacohen 2011-08-21 08:29:04 +00:00
parent d9a3685ddc
commit 98d28ca983
1 changed files with 4 additions and 8 deletions

View File

@ -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;