dash-frontend: tab titles, home screen username

This commit is contained in:
Aleksander
2025-09-20 16:54:16 +02:00
parent 1358af75e3
commit 4f71dc6097
22 changed files with 181 additions and 45 deletions

View File

@@ -77,10 +77,7 @@ impl I18n {
match lang.as_str() {
"en" | "pl" | "it" | "ja" | "es" => {}
_ => {
log::warn!(
"Unsupported language \"{}\", defaulting to \"en\".",
lang.as_str()
);
log::warn!("Unsupported language \"{}\", defaulting to \"en\".", lang.as_str());
lang = String::from("en");
}
@@ -111,4 +108,9 @@ impl I18n {
log::error!("missing translation for key \"{translation_key}\"");
Rc::from(translation_key) // show translation key as a fallback
}
pub fn translate_and_replace(&mut self, translation_key: &str, to_replace: (&str, &str)) -> String {
let translated = self.translate(translation_key);
translated.replace(to_replace.0, to_replace.1)
}
}