ILocaleProps

interface
Locale & i18n

Per-instance locale override — messages, active locale, fallback locale and an optional adapter instance. Components consuming this interface honour a sub-tree locale without requiring a global store mutation.

TypeScript

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

messages
ILocaleMessages
Flat or nested message map to merge with the global locale messages for this component sub-tree.
locale
string
BCP-47 language tag that overrides the active global locale for this component (e.g. "fr", "en-US").
fallback
string
BCP-47 language tag used when a translation key is not found in the active locale.
adapter
ILocaleInstance
Custom locale adapter instance. When provided, it replaces the global adapter for this component and all its descendants.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Overriding locale on a specific component

typescript