forked from enlightenment/enlightenment
no - u NEED to set the LNAG for gettext to use that lang - if u dont e can't
change its lang runtime. :) the problem is it gets inherited by child processes... thus make it use the result of getenv to init... (a NULL retunr will mean e tries to use en anyway) SVN revision: 14193
This commit is contained in:
parent
b34711e5e3
commit
3ced20074a
|
@ -44,7 +44,7 @@ e_intl_init(void)
|
||||||
ADD_LANG("fr");
|
ADD_LANG("fr");
|
||||||
|
|
||||||
/* FIXME: NULL == use LANG. make this read a config value if it exists */
|
/* FIXME: NULL == use LANG. make this read a config value if it exists */
|
||||||
e_intl_language_set(NULL);
|
e_intl_language_set(getenv("LANG"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,14 +60,14 @@ e_intl_shutdown(void)
|
||||||
void
|
void
|
||||||
e_intl_language_set(const char *lang)
|
e_intl_language_set(const char *lang)
|
||||||
{
|
{
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
if (_e_intl_language) free(_e_intl_language);
|
if (_e_intl_language) free(_e_intl_language);
|
||||||
if (!lang) lang = getenv("LANG");
|
if (!lang) lang = getenv("LANG");
|
||||||
if (!lang)
|
if (!lang) lang = "en";
|
||||||
{
|
|
||||||
setenv("LANG", "en", 1);
|
|
||||||
lang = "en";
|
|
||||||
}
|
|
||||||
_e_intl_language = strdup(lang);
|
_e_intl_language = strdup(lang);
|
||||||
|
snprintf(buf, sizeof(buf), "LANG=%s", _e_intl_language);
|
||||||
|
putenv(buf);
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALE_DIR);
|
bindtextdomain(PACKAGE, LOCALE_DIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
|
Loading…
Reference in New Issue