Skip to content

Commit 44410c6

Browse files
committed
fix: tr! macro to handle arguments
1 parent ba34417 commit 44410c6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/i18n.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ macro_rules! tr {
4848
$crate::i18n::LOADER.get($id)
4949
}};
5050

51-
// i hope this will work right. this is AI slop too(( and i didn't check yet
52-
($id:expr, $($args:expr),*) => {{
51+
($id:expr, $($key:expr => $value:expr),*) => {{
5352
let mut args = std::collections::HashMap::new();
5453
$(
55-
args.insert(stringify!($args).trim_matches('"'), $args);
54+
args.insert(stringify!($key), $value.to_string());
5655
)*
5756
$crate::i18n::LOADER.get_args($id, args)
5857
}};

0 commit comments

Comments
 (0)