UNPKG

vueless

Version:

Vue Styleless UI Component Library, powered by Tailwind CSS.

15 lines (13 loc) 450 B
import type { I18n } from "virtual:vueless/vue-i18n"; import type { LocaleInstance } from "../types"; export function createVueI18nAdapter(i18n: I18n): LocaleInstance { return { name: "vue-i18n", locale: i18n.global.locale, fallback: i18n.global.fallbackLocale as string, messages: i18n.global.messages, t: (key: string, ...params: unknown[]) => i18n.global.t(key, params), tm: i18n.global.tm, n: i18n.global.n, }; }