longbridgeapp / rust-i18n

A better and simply I18n crate for Rust.
MIT License
321 stars 32 forks source link

Please document app.yml / app.yaml _version: 2 to work / find keys properly #81

Closed tgrushka closed 5 months ago

tgrushka commented 5 months ago

After frustration, I found closed issue #60 to solve my problem.

If _version: 1 in app.yml / app.yaml, the locale parameter of t!("key", locale = "en") is prepended, resulting in an invalid key like: en.key. Thus, the resolution fails.

I found I must set _version: 2 in the file per issue #60.

And here I thought that _version was to specify my "version" of the translations, but it is in fact the rust-i18n API version.

Can you please add this to the README right in the app.yml section so that in the future, people know they must use _version: 2 to get this format to work?

Thank you.

huacnlee commented 5 months ago

Here is the doc describe it

https://github.com/longbridgeapp/rust-i18n?tab=readme-ov-file#all-localized-texts-in-one-file