Releases: longbridge/rust-i18n
Releases · longbridge/rust-i18n
v3.1.3
v3.1.2
What's Changed
- Reduce unnecessary memory copying by @yk0n9 in #89
- Fix lazy init always "en" by @yk0n9, @KKRainbow in #88
New Contributors
- @yk0n9, @KKRainbow made their first contribution in #88
Full Changelog: v3.1.1...v3.1.2
v3.1.1
What's Changed
- Introduced the
minify_key
feature fori18n!
and added support for format specifiers int!
by @varphone in #73 - Update example for share I18n in entire workspace by @huacnlee in #80
- Update doc for locale file version. by @huacnlee in #82
- Update to use serde_yml (#86)
Full Changelog: v3.0.1...v3.1.1
v3.0.1
v3.0.0
What's Changed
- Add more than one fallback with priority support, eg:
i18n!("locales", fallback = ["en", "es]);
by @varphone #69- Remove
RwLock
fromlocale()
andset_locale()
. - String patterns replacement, time reduce 10% ~ 80%.
- Reduce memory copy on
t!()
.
- Remove
Performance improved
- t time: [100.91 ns 101.06 ns 101.24 ns]
- t_with_args time: [495.56 ns 497.88 ns 500.64 ns]
+ t time: [58.274 ns 60.222 ns 62.390 ns]
+ t_with_args time: [167.46 ns 170.94 ns 175.64 ns]
Breaking Changes
rust_i18n::locale() -> String
=>rust_i18n::locale() -> Arc<String>
.t!() -> String
=>t!() -> Cow<str>
.
v2.3.1
v2.3.0
v2.2.1
v2.2.0
What's Changed
- Add to support translated text with multiple locales in one file. by @huacnlee in #50
- Add
_version
for locale file for special the file format._version: 1
- Split each language into difference files (default)._version: 2
- All language in same file.
- Update
cargo i18n
command for output_version: 2
format.
Example
Write a app.yml
_version: 2
hello:
en: "Hello"
zh-CN: "你好"
world:
en: "Hello World"
zh-CN: "你好世界"
welcome.message:
en: "Welcome"
zh-CN: "欢迎"
Screenshot
Other Changes
- Do not use
.
in macro output if locale string is empty. by @ajantti in #51 - Some more fixes and improvements. by @ajantti in #53
- Add a test for checking if tests are run single-threadedly. by @ajantti in #54
- Improve generator output to remove leading
---
in YAML file.
New Contributors
Full Changelog: v2.1.0...v2.2.0
v2.1.0
What's Changed
- Bump
syn
from1.0.82
to2.0.18
by @sunli829 in #42 - Rewrite SimpleBackend translations struct to avoid memory allocation of the key string. by @huacnlee in #41
- Update
toml
in the main rust-i18n crate to match that of the rust-i18n-support crate by @urkle in #43 - Improve current_locale get performance by use RwLock.
New Contributors
Full Changelog: v2.0.0...v2.1.0