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
Definition
The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.
API
Properties
Every property declared by this interface, with its type, optionality and default.
- namerequiredstring
- Identifier of the adapter implementation, e.g. "vue-i18n" or "default".
- messagesrequiredComputedRef<ILocaleMessages>
- Reactive computed ref of the full message map for the current locale.
- currentrequiredRef<string>
- Reactive ref of the active locale code, e.g. "en" or "fr".
- fallbackrequiredRef<string>
- Reactive ref of the fallback locale code used when a key is missing.
- trequired(key: string, ...params: unknown[]) => string
- Translates a message key with optional interpolation parameters.
- nrequired(value: number) => string
- Formats a number according to the active locale conventions.
- providerequired(props: ILocaleProps) => ILocaleInstance
- Creates a scoped child locale instance for sub-tree overrides.
Ecosystem
Used by
Components and composables that extend or consume this interface.
Usage
Examples
Ready-to-paste code snippets using this interface.
Accessing the locale instance from a component