ILocaleInstance
interface
Internationalisation
Runtime locale adapter contract — provides reactive locale state, a translate function (t), a number formatter (n) and a scoped child adapter factory.
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.
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.
- namerequisstring
- Identifier of the adapter implementation, e.g. "vue-i18n" or "default".
- messagesrequisComputedRef<ILocaleMessages>
- Reactive computed ref of the full message map for the current locale.
- currentrequisRef<string>
- Reactive ref of the active locale code, e.g. "en" or "fr".
- fallbackrequisRef<string>
- Reactive ref of the fallback locale code used when a key is missing.
- trequis(key: string, ...params: unknown[]) => string
- Translates a message key with optional interpolation parameters.
- nrequis(value: number) => string
- Formats a number according to the active locale conventions.
- providerequis(props: ILocaleProps) => ILocaleInstance
- Creates a scoped child locale instance for sub-tree overrides.
Écosystème
Utilisé par
Composants et composables qui étendent ou consomment cette interface.
Usage
Exemples
Extraits de code prêts à coller utilisant cette interface.
Accessing the locale instance from a component