Skip to content

Latest commit

 

History

History
117 lines (75 loc) · 3.89 KB

CHANGELOG.md

File metadata and controls

117 lines (75 loc) · 3.89 KB

Changelog

[0.4.3]

  • Issue #19 Enable use of "message-id.attribute-id" syntax in the t!, te!, tid! macros in order to extract attribute definition, e.g. t!("mycomponent.placeholder") in:

    mycomponent = Component Name
       .placeholder = Some placeholder
       .aria-text = Some aria text
    
  • Added examples for all fluent grammar constructs and configuration variants.

[0.4.2] 2025-02-08

Fixed

  • Issue #15 Recent change to t! macro unnecessarily breaks v0.3 code.

Amended

  • t! macro amended to use unwrap_or_else rather than panic!.

  • Error messages made consistant across all macros.

[0.4.1] 2025-02-02

Added

  • New methods (I18nConfig::with_auto_locales) to determine supported locales from deep search for translation files.

  • New methods returning Result<_, Error> rather than panic!, such that:

    panic! version Result<_, Error> vesion
    LocaleResource::to_resource_string LocaleResource::try_to_resource_string
    I18n::translate I18n::try_translate
    I18n::translate_with_args I18n::try_translate_with_args
    I18n::set_fallback_language I18n::try_set_fallback_language
    I18n::set_language I18n::try_set_language
    use_init_i18n try_use_init_i18n
    I18nConfig::with_auto_locales I18nConfig::try_with_auto_locales
  • New te! macro which acts like t! but returns Error.

  • New tid! macro which acts like t! but returns the message-id.

Change

  • t! macro amended to use try_translate and try_translate_with_args, but will perform .expect("..") and therefore panic! on error. This retains backwards compatibility for this macro.

  • Use of set_fallback_language / try_set_fallback_language without a corresponding locale translation is treated as an error.

[0.4.0] 2025-01-25

Added

  • Code:

    • Doc comments
    • Module tests for cargo test
  • Amended I18nConfig::with_locale so that the Locale dynamic or static constructors no longer have to be explicitly given. They can be determined implicitly from (LanguageIdentifier, &str) or (LanguageIdentifer, PathBuf).

  • Enabled shared 'LocaleResource's, where two dialect can use the same translation file. For example ["en", "en-GB"] share "en-GB.ftl".

Changed

  • The translations used are determined when I18n::set_language or I18n::set_fallback_language is called, and not each time a message is translated.

  • Fallback handling has changed. It no longer just uses fallback_language when the message id is missing from the current locale. It performs a graceful fallback from - to before using the actual fallback (in fact it falls back along the --- hiearchy).

    Note: this is a breaking change which may impact the selected translation.

  • LocaleResource::to_string renamed to LocaleResource::to_resource_string

[0.3.0] 2024-12-10

[0.2.4] 2024-09-11

  • Hide new_dynamic in WASM
  • New t!() macro

[0.2.3] 2024-09-04

  • Support dynamic loading of locales

[0.2.2] 2024-09-02

  • Enable macros instead of serde in unic-langid

[0.2.1] 2024-09-02

  • Export unic_langid and fluent
  • Use absolute path to import fluent in the translate macro
  • Updated freya example

[0.2.0] 2024-09-01

[0.1.0] 2024-08-31

  • Initial release