diff --git a/voxygen/src/i18n.rs b/voxygen/src/i18n.rs index cd3f823f68..e054eaa023 100644 --- a/voxygen/src/i18n.rs +++ b/voxygen/src/i18n.rs @@ -230,7 +230,8 @@ pub struct LocalizationHandle { // RAII guard returned from Localization::read(), resembles AssetGuard pub struct LocalizationGuard { active: AssetGuard, - fallback: Option>, + fallback: Option>, // optional display for missing translations + reference: Option>, // to determine missing translations } // arbitrary choice to minimize changing all of veloren @@ -271,7 +272,7 @@ impl LocalizationGuard { /// Return the missing keys compared to the reference language fn list_missing_entries(&self) -> (HashSet, HashSet) { - if let Some(ref_lang) = &self.fallback { + if let Some(ref_lang) = self.fallback.as_ref().or(self.reference.as_ref()) { let reference_string_keys: HashSet<_> = ref_lang.string_map.keys().cloned().collect(); let string_keys: HashSet<_> = self.active.string_map.keys().cloned().collect(); let strings = reference_string_keys @@ -329,6 +330,11 @@ impl LocalizationHandle { } else { None }, + reference: if !self.use_english_fallback { + self.fallback.map(|f| f.read()) + } else { + None + }, } }