Skip to content

Releases: longbridge/rust-i18n

v1.2.2

12 Jun 09:13
Compare
Choose a tag to compare

What's Changed

  • Export once_cell in internal for use, now we don't need to add once_cell to Cargo.toml. 9c076fc by @sunli829

v1.2.1

17 May 08:08
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.2.0...v1.2.1

v1.2.0

10 May 07:56
Compare
Choose a tag to compare

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

09 Mar 08:56
Compare
Choose a tag to compare

What's Changed

  • Fix for avoid raise error when build.rs not get path correct. by @huacnlee in #27
  • Fix String in macro to use full package name to avoid conflict.

Full Changelog: v1.1.3...v1.1.4

v1.1.3

07 Mar 08:59
Compare
Choose a tag to compare

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

06 Mar 08:50
Compare
Choose a tag to compare
  • Improve t! macro to support placeholder value to support any types. @huacnlee

    t!("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

13 Jan 13:46
Compare
Choose a tag to compare

What's Changed

Use PWD env as workdir for build.rs, for fix error while trying to cross compile (#18)

New Contributors

Full Changelog: v1.1.0...v1.1.1

v1.1.0

04 Jan 04:10
9d4f3e6
Compare
Choose a tag to compare

What's Changed

  • Add more examples. by @huacnlee in #15
  • Try fix #17, when workdir can't get from OUT_DIR, fallback to CARGO_MANIFEST_DIR env. by @huacnlee in #19
  • Add available_locales method to get all available locales by @huacnlee in #20

Full Changelog: v1.0.1...v1.1.0

v1.0.1

18 Nov 06:30
Compare
Choose a tag to compare

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.

SCR-20221118-lzz

New Contributors

v0.6.0

18 Nov 06:25
Compare
Choose a tag to compare

What's Changed

  • feat: use once_cell instead of lazy_static.