Quantcast
Channel: Rust gettext_ng did not work with variables. How to make it work? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Rust gettext_ng did not work with variables. How to make it work?

$
0
0

I try to translate a litte Rust code at runtime. But I get a compile error:

println!("{}", catalog.gettext("\nThe weather in {}", city));34  |     println!("{}", catalog.gettext("\nThe weather in {}", city));     |                            ^^^^^^^                      ------    |                                                         | |    |                                                         | unexpected argument of type `std::string::String`    |                                                         help: remove the extra argument    |

How to make that it works?

If I do it without variables then it works:

println!("{}", catalog.gettext("\nThe weather in"));

When run with German environment (export LANG=de_DE.UTF-8), the output is: Das Wetter in

I would like to get the Output: Das Wetter in Koeln


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images