3.9 KiB
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 thanpanic!, such that:panic!versionResult<_, Error>vesionLocaleResource::to_resource_stringLocaleResource::try_to_resource_stringI18n::translateI18n::try_translateI18n::translate_with_argsI18n::try_translate_with_argsI18n::set_fallback_languageI18n::try_set_fallback_languageI18n::set_languageI18n::try_set_languageuse_init_i18ntry_use_init_i18nI18nConfig::with_auto_localesI18nConfig::try_with_auto_locales -
New
te!macro which acts liket!but returnsError. -
New
tid!macro which acts liket!but returns the message-id.
Change
-
t! macro amended to use
try_translateandtry_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_languagewithout 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_localeso that theLocaledynamic 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_languageorI18n::set_fallback_languageis 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_stringrenamed toLocaleResource::to_resource_string
[0.3.0] 2024-12-10
- Dioxus 0.6 support
[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
- Now based in the Fluent Project
[0.1.0] 2024-08-31
- Initial release