diff --git a/src/composables/useI18nLight.ts b/src/composables/useI18nLight.ts index c2f0b40..70067e7 100644 --- a/src/composables/useI18nLight.ts +++ b/src/composables/useI18nLight.ts @@ -20,7 +20,7 @@ const locales: Locale[] = [ ]; const locale: Ref = ref(); -const messages = { +const messages: Record = { en: enLocale, es: esLocale, }; @@ -38,14 +38,14 @@ export function useI18n() { } // It can load locales from remote server - async function setLocale(code) { - if (locale.value !== code) { + async function setLocale(code: string) { + if (locale.value.code !== code) { locale.value = locales.find(l => l.code === code); localStorage.setItem("vue-webapp_lang", locale.value.code); } } - function t(msg, params = null) { + function t(msg: string, params: Record = null) { if (!msg || !locale.value) { return ""; }