Skip to main content

Module language

Module language 

Source
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§

LanguageDescriptor
Part of the LanguageManifest, describes a single language.
LanguageEngine
Language engine that loads the translation files for fluent for multiple languages and provides them as an API.
LanguageManifest
Description of available languages for a LanguageEngine.
TextFunction
Tera template function that can localize a message. It contains an Arc shared reference of fluent bundle.
TextFunctionContext
Localization context
TextFunctionError
Error that is returned when retrieving a translated text fails
UnicodeLanguageIdentifier
A wrapper for [unic_langid::LanguageIdentifier] that als implements serde traits.

Enums§

LanguageEngineLoaderError
Error that is returned when loading language information from the template directory fails.

Type Aliases§

Bundle
Specifies a FluentBundle with concurrency features enabled.
TextFunctionContextGetter
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 the safe_suffix feature. This function may use the template context or a global context (make sure your invariants hold in that case!).