[apps] Simplify locale lookup by code

This commit is contained in:
Romain Goyet
2020-08-28 19:38:04 -04:00
committed by Léa Saviot
parent 4f2ea99c85
commit fd0284756f
10 changed files with 8 additions and 23 deletions

View File

@@ -36,7 +36,7 @@ void ion_main(int argc, const char * const argv[]) {
continue;
}
for (int j = 0; j < I18n::NumberOfLanguages; j++) {
if (strcmp(requestedLanguageId, I18n::translate(I18n::LanguageISO6391Names[j])) == 0) {
if (strcmp(requestedLanguageId, I18n::LanguageISO6391Codes[j]) == 0) {
GlobalPreferences::sharedGlobalPreferences()->setLanguage((I18n::Language)j);
GlobalPreferences::sharedGlobalPreferences()->setCountry(I18n::DefaultCountryForLanguage[j]);
break;