Releases: longbridge/rust-i18n
Releases · longbridge/rust-i18n
v1.2.2
v1.2.1
v1.2.0
What's Changed
Now i18n!
method can use like:
/// Without any argument, default locale path is: "locales" in crate root.
rust_i18n::i18n!();
/// Or, special a path
rust_i18n::i18n!("/path/to/locales");
/// Or just use `fallback` option
rust_i18n::i18n!(fallback = "en")
/// Or with path and option
rust_i18n::i18n!("locales", fallback = "en")
New Contributors
Full Changelog: v1.1.4...v1.2.0
v1.1.4
v1.1.3
What's Changed
- Improve
t!
macro to support argument end with a comma,
.t!("hello", locale = "en", count = 100); // And also support t!("hello", locale = "en", count = 100,);
- Improve
t!
macro to support string var name.t!("messages.hello", name = "world"); // Support use string var name t!("messages.hello", "name" => "Jason", "count" => 3 + 2); t!("messages.hello", locale = "zh-HK", "name" => "Jason", "count" => 3 + 2);
v1.1.2
-
Improve
t!
macro to support placeholder value to support any types. @huacnleet!("messages.other", count = 100); // "You have 100 messages." t!("messages.other", count = 1.01); // "You have 1.01 messages." t!("messages.other", count = 1 + 2); // "You have 3 messages."
-
Optimize i18n-ally-custom-framework.yml. @mslxl
v1.1.1
What's Changed
Use PWD
env as workdir
for build.rs, for fix error while trying to cross compile (#18)
New Contributors
- @MJoaaquin made their first contribution in #18
Full Changelog: v1.1.0...v1.1.1
v1.1.0
v1.0.1
Break Change
- Take language code from filename instead of
.yml
files by @Pure-Peace in #10
Upgrade Guides
$ cargo install rust-i18n --force
New version of rust-i18n has not need add language code in YAML file:
Before
locales/en.yml
en:
hello: Hello world
messages:
hello: Hello, %{name}
After
locales/en.yml
hello: Hello world
messages:
hello: Hello, %{name}
You must remove change the exist locale files.
VS Code I18n Ally guide
I18n Ally is a VS Code extension for helping you translate your Rust project.
You can add i18n-ally-custom-framework.yml to your project .vscode
directory, and then use I18n Ally can parse t!
marco to show translate text in VS Code editor.
New Contributors
- @Pure-Peace made their first contribution in #10