diff --git a/packages/fes-plugin-locale/src/runtime/core.js.tpl b/packages/fes-plugin-locale/src/runtime/core.js.tpl index abc0a820..42fd1708 100644 --- a/packages/fes-plugin-locale/src/runtime/core.js.tpl +++ b/packages/fes-plugin-locale/src/runtime/core.js.tpl @@ -57,6 +57,10 @@ const setLocale = ({ locale }) => { window.localStorage.setItem("fes_locale", locale); }; +const getLocale = () => { + return unref(i18n.global.locale) +} + const addLocale = ({ locale, messages }) => { messages[locale] = messages; if (isRef(i18n.global.messages)) { @@ -82,6 +86,7 @@ const t = (key) => { const locale = { setLocale, + getLocale, addLocale, getAllLocales, messages,