Fix translation error

This commit is contained in:
Marco De Araujo 2026-01-03 08:45:13 -04:00
parent 6e94081db2
commit 5a77198344
4 changed files with 22 additions and 23 deletions

View file

@ -48,12 +48,8 @@ pub fn t(key: &str) -> String {
pub fn t_with_args(key: &str, args: &HashMap<&'static str, String>) -> String {
let mut map = HashMap::new();
let args_map: &HashMap<Cow<'static, _>, FluentValue<'_>>;
args_map = {
for (key, value) in args {
map.insert(Cow::Borrowed(*key), FluentValue::from(value.clone()));
}
&map
};
LOCALES.lookup_with_args(&get_system_locale(), key, args_map)
for (key, value) in args {
map.insert(Cow::Borrowed(*key), FluentValue::from(value));
}
LOCALES.lookup_with_args(&get_system_locale(), key, &map)
}