diff --git a/packages/fes-plugin-locale/src/runtime/core.js.tpl b/packages/fes-plugin-locale/src/runtime/core.js.tpl index 42fd1708..5e662d9d 100644 --- a/packages/fes-plugin-locale/src/runtime/core.js.tpl +++ b/packages/fes-plugin-locale/src/runtime/core.js.tpl @@ -80,9 +80,7 @@ const install = (app) => { app.use(i18n); }; -const t = (key) => { - return i18n.global.t(key) -} +const t = i18n.global.t; const locale = { setLocale, diff --git a/packages/fes-plugin-locale/types.d.ts b/packages/fes-plugin-locale/types.d.ts index b72dc316..62b4917c 100644 --- a/packages/fes-plugin-locale/types.d.ts +++ b/packages/fes-plugin-locale/types.d.ts @@ -1,3 +1,5 @@ +import type { VueI18n } from 'vue-i18n'; + export { useI18n } from 'vue-i18n'; export const locale: { @@ -5,6 +7,7 @@ export const locale: { addLocale: ({ locale, messages }: { locale: string; messages: object }) => void; getAllLocales: () => string[]; messages: Record; + t: VueI18n['t']; }; declare module '@fesjs/fes' {