-
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.
- Issue #15 Recent change to t! macro unnecessarily breaks v0.3 code.
-
t! macro amended to use unwrap_or_else rather than panic!.
-
Error messages made consistant across all macros.
-
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_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 liket!
but returnsError
. -
New
tid!
macro which acts liket!
but returns the message-id.
-
t! macro amended to use
try_translate
andtry_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.
-
Code:
- Doc comments
- Module tests for
cargo test
-
Amended
I18nConfig::with_locale
so that theLocale
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".
-
The translations used are determined when
I18n::set_language
orI18n::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 toLocaleResource::to_resource_string
- Dioxus 0.6 support
- Hide new_dynamic in WASM
- New t!() macro
- Support dynamic loading of locales
- Enable macros instead of serde in unic-langid
- Export unic_langid and fluent
- Use absolute path to import fluent in the translate macro
- Updated freya example
- Now based in the Fluent Project
- Initial release