Fix translation error
This commit is contained in:
parent
6e94081db2
commit
5a77198344
4 changed files with 22 additions and 23 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue