Skip to content

v3.0.0

Compare
Choose a tag to compare
@huacnlee huacnlee released this 19 Jan 07:45
· 63 commits to main since this release

What's Changed

  • Add more than one fallback with priority support, eg: i18n!("locales", fallback = ["en", "es]); by @varphone #69
    • Remove RwLock from locale() and set_locale().
    • String patterns replacement, time reduce 10% ~ 80%.
    • Reduce memory copy on t!().

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>.