createProvideFunction
Commons
stable
Returns a factory function that bootstraps a scoped locale instance for a component sub-tree using vue-i18n. Each call creates an isolated locale with overridable current locale, fallback, and messages props.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- datarequired{ current: Ref<string> fallback: Ref<string> messages: ComputedRef<ILocaleMessages> useI18n: TUseI18nLike }
- Root locale state (current locale ref, fallback ref, messages computed) and the vue-i18n useI18n composable.
API
Return value
The value returned by this util.
- A factory that, given component locale props, returns an ILocaleInstance for that component sub-tree.
Usage
Examples
Ready-to-paste usage snippets.
Used internally by createVueI18nAdapter