Expand description
This module houses everything relating to localization and translation built into lib-humus.
Localization in lib-humus is mostly done by the fluent crate. Fluent is documented over at projectfluent.org.
The central element here is the LanguageEngine which readslocalization information from the filesystem and provides it as an high-level API.
Structs§
- Language
Descriptor - Part of the LanguageManifest, describes a single language.
- Language
Engine - Language engine that loads the translation files for fluent for multiple languages and provides them as an API.
- Language
Manifest - Description of available languages for a LanguageEngine.
- Text
Function - Tera template function that can localize a message.
It contains an
Arcshared reference of fluent bundle. - Text
Function Context - Localization context
- Text
Function Error - Error that is returned when retrieving a translated text fails
- Unicode
Language Identifier - A wrapper for [unic_langid::LanguageIdentifier] that als implements serde traits.
Enums§
- Language
Engine Loader Error - Error that is returned when loading language information from the template directory fails.
Type Aliases§
- Bundle
- Specifies a FluentBundle with concurrency features enabled.
- Text
Function Context Getter - Callback type that returns the TextFunctionContext to use for the
text()template function. This is intended to provide an implicit default language and settings for thesafe_suffixfeature. This function may use the template context or a global context (make sure your invariants hold in that case!).