longbridgeapp / rust-i18n

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

Add to support translated text with multiple locales in one file. #50

Closed huacnlee closed 1 year ago

huacnlee commented 1 year ago

Fix #49

Example

# app.yml
_version: 2
hello:
  en: "Hello"
  zh-CN: "你好"
  world:
    en: "Hello World"
    zh-CN: "你好世界"
welcome.message:
  en: "Welcome"
  zh-CN: "欢迎"

Or old version:

# app.en.yml
_version: 1
hello: "Hello"
hello.world: "Hello World"
welcome.message: "Welcome"
# app.zh-CN.yml
_version: 1
hello: "你好"
hello.world: "你好世界"
welcome.message: "欢迎"

Screenshot

rust-i18n-example