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:
Carsten Haitzler 2005-04-14 05:49:17 +00:00
parent b34711e5e3
commit 3ced20074a
1 changed files with 6 additions and 6 deletions

View File

@ -44,7 +44,7 @@ e_intl_init(void)
ADD_LANG("fr");
/* 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;
}
@ -60,14 +60,14 @@ e_intl_shutdown(void)
void
e_intl_language_set(const char *lang)
{
char buf[4096];
if (_e_intl_language) free(_e_intl_language);
if (!lang) lang = getenv("LANG");
if (!lang)
{
setenv("LANG", "en", 1);
lang = "en";
}
if (!lang) lang = "en";
_e_intl_language = strdup(lang);
snprintf(buf, sizeof(buf), "LANG=%s", _e_intl_language);
putenv(buf);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALE_DIR);
textdomain(PACKAGE);