1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 07:36:39 +02:00

Made the language system still work even if the locales are not installed on the system

This commit is contained in:
Adam
2010-10-23 16:12:15 -04:00
parent 7e47b97740
commit ec5fa9e63e
2 changed files with 10 additions and 4 deletions
+5 -2
View File
@@ -54,9 +54,12 @@ const Anope::string GetString(Anope::string language, LanguageString string)
return language_strings[string];
#if GETTEXT_FOUND
setlocale(LC_ALL, language.c_str());
extern int _nl_msg_cat_cntr;
++_nl_msg_cat_cntr;
setenv("LANGUAGE", language.c_str(), 1);
setlocale(LC_ALL, "en_US");
const char *ret = dgettext("anope", language_strings[string].c_str());
setlocale(LC_ALL, "");
unsetenv("LANGUAGE");
return ret ? ret : "";
#endif