diff --git a/src/client/init.ts b/src/client/init.ts index 4083fe501a..1a1ffb36f4 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -158,8 +158,8 @@ app.component('fa', FontAwesomeIcon); //#region Init i18n const locale = await count(clientDb.i18n).then(async n => { - if (n === 0) return await setI18nContexts(lang, version, i18n); - if ((await get('_version_', clientDb.i18n) !== version)) return await setI18nContexts(lang, version, i18n, true); + if (n === 0) return await setI18nContexts(lang, version); + if ((await get('_version_', clientDb.i18n) !== version)) return await setI18nContexts(lang, version, true); return await getLocale(); }); diff --git a/src/client/scripts/set-i18n-contexts.ts b/src/client/scripts/set-i18n-contexts.ts index de3d3de1bf..6014957361 100644 --- a/src/client/scripts/set-i18n-contexts.ts +++ b/src/client/scripts/set-i18n-contexts.ts @@ -1,8 +1,7 @@ -import { I18n } from 'vue-i18n'; import { clientDb, clear, bulkSet } from '../db'; import { deepEntries, delimitEntry } from 'deep-entries'; -export function setI18nContexts(lang: string, version: string, i18n: I18n, cleardb = false) { +export function setI18nContexts(lang: string, version: string, cleardb = false) { return Promise.all([ cleardb ? clear(clientDb.i18n) : Promise.resolve(), fetch(`/assets/locales/${lang}.${version}.json`)