Expand description
Internationalization runtime for Teksilo.
Implements §12 of docs/architecture.md. This crate is the
runtime half of the i18n stack: LocalizedString, I18nConfig,
I18nManager, locale resolution, and the thread-local that bridges
macro-expanded code into the active translation bundles.
The compile-time tr! / tr_widget! proc macros live in the sister
teksilo-i18n-macros crate (Phase C) and are re-exported here as part of
teksilo-i18n’s public surface.
Re-exports§
pub use config::I18nConfig;pub use direction::rtl_from_locale;pub use display_names::language_endonym;pub use file_watcher::FtlFileWatcher;pub use file_watcher::ReloadSink;pub use format::CalendarSystem;pub use format::DateFields;pub use format::DateStyle;pub use format::NumberFormatter;pub use format::NumberStyle;pub use format::NumberSymbols;pub use format::TeksiloDateTime;pub use format::TeksiloDateTimeFormatter;pub use format::TimeStyle;pub use format::delocalize_number;pub use localized_string::LocalizedString;pub use localized_string::localized;pub use manager::I18nManager;pub use manager::LocaleSwitchOutcome;pub use manager::ReloadError;pub use resolve::resolve_message;pub use resolve::resolve_message_widget;
Modules§
- config
I18nConfig— application-facing builder for the i18n runtime.- direction
- Layout direction derivation from a
LanguageIdentifier. - display_
names - Locale display names — language endonyms.
- file_
watcher notify-based hot-reload watcher forruntime_override.ftlfiles.- format
- Locale-aware number and date/time formatting.
- localized_
string LocalizedString— the developer-facing handle thetr!macro produces.- manager
I18nManager— owns Fluent bundles and the active-locale signals.- resolve
- Free functions the
tr!/tr_widget!macros expand into.
Macros§
- compile_
in_ locales - Declarative sugar for populating
I18nConfig::compile_inwhen an application ships many locales × many.ftlfiles per locale. - lit
- Wrap an intentionally untranslated string as a
LocalizedString. - tr
- Compile-time-validating translation macro for application strings.
- tr_
signal - Reactive variant of
tr!for theSignal<T>-inside-translated-sentence case. Every named argument expression must evaluate to aSignal<T>whereT: Clone + 'static + Into<FluentValue<'static>>. Returns aSignal<String>that re-renders on (any arg change ∪ locale change ∪.ftlhot reload). - tr_
signal_ widget - Reactive variant of
tr_widget!. Same arg shape astr_signal!. - tr_
widget - Compile-time-validating translation macro for framework-internal
strings. Same surface as
tr!, but routes to the framework bundle at runtime. Only used insideteksilo-widgets.
Structs§
- Language
Identifier LanguageIdentifieris a core struct representing a Unicode Language Identifier.- Signal
- A reactive value. Created via
Signal::new(value)for mutable signals orsignal.map(f)for derived (read-only) signals. - Weak
Signal - Weak reference to a mutable signal. Produced by
Signal::downgrade.
Enums§
- Fluent
Value - The
FluentValueenum represents values which can be formatted to a String. - Layout
Direction - Layout direction for RTL/LTR support.
Functions§
- current_
direction - Clone of the active manager’s layout direction signal, or
Noneif no manager is installed. - current_
locale - Clone of the active manager’s locale signal, or
Noneif no manager is installed. - current_
supported_ locales - Snapshot the supported-locales list from the active manager.
Returns
Noneif no manager is installed. - current_
version_ signal - Clone of the active manager’s version signal, or
Noneif no manager is installed.