fixed LANG for windows
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6258 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+16
-11
@@ -5,25 +5,30 @@
|
||||
|
||||
i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(domain), basepath(basepath)
|
||||
{
|
||||
locale = setlocale(LC_ALL, ""); // use current default locale
|
||||
bindtextdomain(domain, basepath); // set base path
|
||||
textdomain(domain);
|
||||
bind_textdomain_codeset(domain, "UTF-8"); // we use the utf-8 charset only
|
||||
locale = setlocale(LC_ALL, ""); // use current default locale
|
||||
bindtextdomain(domain, basepath); // set base path
|
||||
textdomain(domain);
|
||||
bind_textdomain_codeset(domain, "UTF-8"); // we use the utf-8 charset only
|
||||
|
||||
char lang[3];
|
||||
copystring(lang, locale, 3);
|
||||
filterlang(lang, lang);
|
||||
alias("LANG", lang);
|
||||
char lang[3];
|
||||
#ifdef WIN32
|
||||
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, lang, 3);
|
||||
#else
|
||||
copystring(lang, locale, 3);
|
||||
#endif
|
||||
|
||||
printf("current locale: %s (%s)\n", locale, lang);
|
||||
filterlang(lang, lang);
|
||||
alias("LANG", lang);
|
||||
|
||||
printf("current locale: %s (%s)\n", locale, lang);
|
||||
}
|
||||
|
||||
// export gettext to cubescript
|
||||
// this way we can provide localization of strings within cubescript
|
||||
void script_gettext(char *msgid)
|
||||
{
|
||||
const char *translated = _gettext(msgid);
|
||||
result(translated);
|
||||
const char *translated = _gettext(msgid);
|
||||
result(translated);
|
||||
}
|
||||
|
||||
COMMANDN(gettext, script_gettext, ARG_1STR);
|
||||
|
||||
Reference in New Issue
Block a user