1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 19:56: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
@@ -299,9 +299,12 @@ void Module::SendMessage(BotInfo *from, User *to, const char *fmt, ...)
#if GETTEXT_FOUND
if (!language.empty())
{
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");
message = dgettext(this->name.c_str(), fmt);
setlocale(LC_ALL, "");
unsetenv("LANGUAGE");
}
#endif