wip
This commit is contained in:
parent
d3135ed9d3
commit
b3b7be2949
|
@ -81,10 +81,6 @@ const html = document.documentElement;
|
||||||
html.setAttribute('lang', lang);
|
html.setAttribute('lang', lang);
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
const i18n = createI18n({
|
|
||||||
legacy: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
//#region Fetch user
|
//#region Fetch user
|
||||||
const signout = () => {
|
const signout = () => {
|
||||||
store.dispatch('logout');
|
store.dispatch('logout');
|
||||||
|
@ -158,17 +154,24 @@ app.use(store);
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.use(VueHotkey);
|
app.use(VueHotkey);
|
||||||
app.use(VAnimateCss);
|
app.use(VAnimateCss);
|
||||||
app.use(i18n);
|
|
||||||
app.component('fa', FontAwesomeIcon);
|
app.component('fa', FontAwesomeIcon);
|
||||||
|
|
||||||
//#region Fetch locale data
|
//#region Init i18n
|
||||||
/*await count(clientDb.i18n).then(async n => {
|
const locale = await count(clientDb.i18n).then(async n => {
|
||||||
if (n === 0) return setI18nContexts(lang, version, i18n);
|
if (n === 0) return await setI18nContexts(lang, version, i18n);
|
||||||
if ((await get('_version_', clientDb.i18n) !== version)) return setI18nContexts(lang, version, i18n, true);
|
if ((await get('_version_', clientDb.i18n) !== version)) return await setI18nContexts(lang, version, i18n, true);
|
||||||
|
|
||||||
i18n.locale = lang;
|
return await getLocale();
|
||||||
i18n.setLocaleMessage(lang, await getLocale());
|
});
|
||||||
});*/
|
|
||||||
|
const i18n = createI18n({
|
||||||
|
legacy: true,
|
||||||
|
sync: false,
|
||||||
|
locale: lang,
|
||||||
|
messages: { [lang]: locale }
|
||||||
|
});
|
||||||
|
|
||||||
|
app.use(i18n);
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
widgets(app);
|
widgets(app);
|
||||||
|
|
|
@ -11,7 +11,6 @@ export function setI18nContexts(lang: string, version: string, i18n: I18n, clear
|
||||||
.then(locale => {
|
.then(locale => {
|
||||||
const flatLocaleEntries = deepEntries(locale, delimitEntry) as [string, string][];
|
const flatLocaleEntries = deepEntries(locale, delimitEntry) as [string, string][];
|
||||||
bulkSet(flatLocaleEntries, clientDb.i18n);
|
bulkSet(flatLocaleEntries, clientDb.i18n);
|
||||||
i18n.locale = lang;
|
return Object.fromEntries(flatLocaleEntries);
|
||||||
i18n.setLocaleMessage(lang, Object.fromEntries(flatLocaleEntries));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue