Don't modify users env if the user already has LANG

SVN revision: 14192
This commit is contained in:
sebastid 2005-04-14 05:32:10 +00:00 committed by sebastid
parent 2538f96da8
commit b34711e5e3
1 changed files with 5 additions and 5 deletions

View File

@ -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) lang = "en";
if (!lang)
{
setenv("LANG", "en", 1);
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);