Front-end localization Vue adapter

Version 3.1 by Manuel Leduc on 2026/08/26 11:43

Content

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

Get Connected