Fix #1606, bad ATIS for Japanese locale
Selecting a language for a nonexisting translation did not load the sys and atc messages. Better fall back to default (en) locale.
This commit is contained in:
parent
89a7516c62
commit
71eba5e579
1 changed files with 12 additions and 12 deletions
|
@ -171,29 +171,29 @@ FGLocale::selectLanguage(const char *language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SGPropertyNode *locale = NULL;
|
_currentLocale = NULL;
|
||||||
BOOST_FOREACH(string lang, languages) {
|
BOOST_FOREACH(string lang, languages) {
|
||||||
locale = findLocaleNode(lang);
|
SG_LOG(SG_GENERAL, SG_DEBUG, "trying to find locale for " << lang );
|
||||||
if (locale) {
|
_currentLocale = findLocaleNode(lang);
|
||||||
|
if (_currentLocale) {
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "found locale for " << lang << " at " << _currentLocale->getPath() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!locale)
|
|
||||||
{
|
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT,
|
|
||||||
"No internationalization settings specified in preferences.xml" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentLocale = locale;
|
|
||||||
|
|
||||||
// load resource for system messages (translations for fgfs internal messages)
|
// load resource for system messages (translations for fgfs internal messages)
|
||||||
loadResource("sys");
|
loadResource("sys");
|
||||||
|
|
||||||
// load resource for atc messages
|
// load resource for atc messages
|
||||||
loadResource("atc");
|
loadResource("atc");
|
||||||
|
|
||||||
|
if (!_currentLocale)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_GENERAL, SG_ALERT,
|
||||||
|
"System locale not found or no internationalization settings specified in preferences.xml. Using default (en)." );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue