[Frugalware-git] fwife: asklang: fix i18n

Elentir elentir at frugalware.org
Sat Jul 17 15:42:34 CEST 2010


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fwife.git;a=commitdiff;h=d19e724d9918abc2b3f313a56baa78ed11baf3bb

commit d19e724d9918abc2b3f313a56baa78ed11baf3bb
Author: Elentir <elentir at frugalware.org>
Date:   Sat Jul 17 15:39:23 2010 +0200

asklang: fix i18n

* export LANGUAGE environment variable to fix gettext
* workaround to fix a weird bug between setlocale() and turkish lang

diff --git a/src/plugins/asklang.c b/src/plugins/asklang.c
index 1448c80..009275a 100644
--- a/src/plugins/asklang.c
+++ b/src/plugins/asklang.c
@@ -187,8 +187,11 @@ int run(GList **config)
selected = "en_US";

setenv("LC_ALL", selected, 1);
-	setenv("LANG",   selected, 1);
-	setlocale(LC_ALL, selected);
+	setenv("LANG", selected, 1);
+	setenv("LANGUAGE", selected, 1);
+	/* setlocale with tr_TR create some weird errors */
+	if(strcmp("tr_TR", selected))
+		setlocale(LC_ALL, selected);
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);


More information about the Frugalware-git mailing list