Front-end localization Vue adapter
Last modified by superadmin on 2026/11/25 21:38
The useI18nAdapter composer, which turns a resolver and a query into a vue-i18n translation function.
Reference
useI18nAdapter
Vue composer that takes a resolver and a query and returns an object with two keys:
- isLoading: a reactive value that becomes false once the requested translations are done
- t: a vue-i18n locale translation function
export function useI18nAdapter(resolver: Resolver, query: Query): {
t: Composer["t"];
isLoading: Ref<boolean>;
};Parameters
- resolver: the resolver to use to load the translations. In an XWiki page, this is the resolver exported by the localization WebJar.
- query: the query to execute