mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-02 16:22:40 -06:00
Core: SetLanguage(const char *s)
git-svn-id: svn://ultimatepp.org/upp/trunk@7723 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e7a0f9298d
commit
ac99fe36cf
3 changed files with 19 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue