From 3ced20074aab51f5d67fac9186a864563bc4796e Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 14 Apr 2005 05:49:17 +0000 Subject: [PATCH] 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 --- src/bin/e_intl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index 74fc1be82..80bf6e41a 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -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);