Core: SetLanguage(const char *s)

git-svn-id: svn://ultimatepp.org/upp/trunk@7723 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-09-25 06:20:43 +00:00
parent e7a0f9298d
commit ac99fe36cf
3 changed files with 19 additions and 3 deletions

View file

@ -2128,9 +2128,12 @@ int CharsetByName(const char *name)
String nm = Filter(name, cs_filter);
if(nm == "utf8" || nm == "utf-8")
return CHARSET_UTF8;
for(int i = 1; i < CharsetCount(); i++)
if(nm == Filter(CharsetName(i), cs_filter))
return i;
for(int pass = 0; pass < 2; pass++) {
for(int i = 1; i < CharsetCount(); i++)
if(nm == Filter(CharsetName(i), cs_filter))
return i;
nm.Replace("win", "windows");
}
return 0;
}

View file

@ -154,6 +154,16 @@ void SetLanguage(int lang) {
SetCurrentLanguage(lang);
}
void SetLanguage(const char *s)
{
SetLanguage(LNGFromText(s));
}
String GetCurrentLanguageString()
{
return LNGAsText(GetCurrentLanguage());
}
String GetLangName(int language)
{
return GetLanguageInfo(language).english_name;

View file

@ -21,6 +21,9 @@ int SetLNGCharset(int lng, byte chrset);
void SetLanguage(int lang);
int GetCurrentLanguage();
void SetLanguage(const char *s);
String GetCurrentLanguageString();
int GetSystemLNG();
VectorMap<String, String> GetLanguage(int lang);//rename...