make sure English takes priority if it's listed first

This commit is contained in:
Damien Elmes 2020-02-21 22:01:35 +10:00
parent e31d576740
commit f8c4fb5e29

View File

@ -125,9 +125,17 @@ impl I18n {
for code in locale_codes {
if let Ok(lang) = code.as_ref().parse::<LanguageIdentifier>() {
langs.push(lang.clone());
if let Some(path) = lang_folder(lang, &ftl_folder) {
if let Some(path) = lang_folder(lang.clone(), &ftl_folder) {
supported.push(path);
}
// if English was listed, any further preferences are skipped,
// as the fallback has 100% coverage, and we need to ensure
// it is tried prior to any other langs. But we do keep a file
// if one was returned, to allow locale English variants to take
// priority over the fallback.
if lang.language() == "en" {
break;
}
}
}
// add fallback date/time