Debug: Add logging for missing translation keys
All checks were successful
BotServer CI / build (push) Successful in 10m8s
All checks were successful
BotServer CI / build (push) Successful in 10m8s
This commit is contained in:
parent
4b44602d39
commit
0c44f7784d
1 changed files with 6 additions and 1 deletions
|
|
@ -882,9 +882,14 @@ pub fn get_translations_json(locale: &Locale) -> serde_json::Value {
|
||||||
let mut translations = serde_json::Map::new();
|
let mut translations = serde_json::Map::new();
|
||||||
|
|
||||||
for key in TRANSLATION_KEYS {
|
for key in TRANSLATION_KEYS {
|
||||||
translations.insert((*key).to_string(), serde_json::Value::String(t(locale, key)));
|
let value = t(locale, key);
|
||||||
|
if value.contains('[') && value == format!("[{key}]") {
|
||||||
|
log::warn!("i18n: Missing translation for key: {} in locale: {:?}", key, locale);
|
||||||
|
}
|
||||||
|
translations.insert((*key).to_string(), serde_json::Value::String(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log::info!("i18n: Returning {} translations for locale: {}", translations.len(), locale);
|
||||||
serde_json::Value::Object(translations)
|
serde_json::Value::Object(translations)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue