Resolves a translation key with optional variable interpolation.
Translation key, optionally with namespace prefix
Optional options: string | ResolveTranslationOptions<T>Options for interpolation and fallback
Resolved translation string or array
Unique identifier for the model instance
Namespace identifier for translation key isolation
Locale descriptor configuration mapping locales to fallback chains
Default locale to use when no translation is found in fallback chain
Currently active locale for translation resolution
Optional bundleCustom bundle resolver for loading translation data
Optional context: KosContext
Translation - Individual namespace translations with automatic locale switching and interpolation.
The Translation model provides access to localized text for a specific namespace within a KOS application. It handles locale switching, fallback chains, variable interpolation, and context-aware translations for building truly international device interfaces that adapt to user language preferences automatically.
Key Features
{{variable}}) and macro (__variable__) substitutiontitle_editvstitle)Variable Interpolation Patterns
The model supports two interpolation patterns for dynamic content:
{{variable}}) - Context-based substitution passed via options__variable__) - Data-based substitution from nested objectsFallback Resolution
When translations are missing, the system follows a sophisticated fallback chain:
pt-BR)pt)es)en)Common Use Cases
Example: Basic Usage
Use Declared Type
See