mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 12:12:25 +01:00
-updated so all languages can take default values from the default language
This commit is contained in:
parent
7b8c8195b0
commit
46d68b8d50
@ -262,9 +262,17 @@ bool Lang::isLanguageLocal(string compareLanguage) const {
|
||||
return (compareLanguage == language);
|
||||
}
|
||||
|
||||
string Lang::parseResult(const string &key, const string &value) {
|
||||
if(value != "$USE_DEFAULT_LANGUAGE_VALUE") {
|
||||
return value;
|
||||
}
|
||||
string result = Lang::get(key, DEFAULT_LANGUAGE);
|
||||
return result;
|
||||
}
|
||||
string Lang::get(const string &s, string uselanguage, bool fallbackToDefault) {
|
||||
try {
|
||||
string result = "";
|
||||
|
||||
if(uselanguage != "") {
|
||||
if(otherLanguageStrings.find(uselanguage) == otherLanguageStrings.end()) {
|
||||
loadStrings(uselanguage, otherLanguageStrings[uselanguage], false);
|
||||
@ -276,7 +284,8 @@ string Lang::get(const string &s, string uselanguage, bool fallbackToDefault) {
|
||||
result = strings.getString(s);
|
||||
replaceAll(result, "\\n", "\n");
|
||||
}
|
||||
return result;
|
||||
|
||||
return parseResult(s, result);;
|
||||
}
|
||||
catch(exception &ex) {
|
||||
if(strings.getpath() != "") {
|
||||
|
@ -42,6 +42,8 @@ private:
|
||||
bool fileMatchesISO630Code(string uselanguage, string testLanguageFile);
|
||||
string getNativeLanguageName(string uselanguage, string testLanguageFile);
|
||||
|
||||
string parseResult(const string &key, const string &value);
|
||||
|
||||
public:
|
||||
static Lang &getInstance();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user