Skip to content

Commit 923cb50

Browse files
committed
Load fallback locale translations before trying to display any messages
1 parent add622d commit 923cb50

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Tekst-Web/src/i18n.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const $te: typeof i18n.global.te = i18n.global.te;
4747
// @ts-expect-error typing for i18n.global.locale is wrong when not in legacy mode;
4848
// see https://vue-i18n.intlify.dev/guide/essentials/scope.html#local-scope-1
4949
i18n.global.locale.value = 'enUS';
50+
await setI18nLocale(); // load and set initial (default) locale
5051

5152
export function getLocaleProfile(localeKey: string): LocaleProfile | undefined {
5253
return localeProfiles.find((lp) => lp.key === localeKey);

Tekst-Web/src/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ router.beforeEach(async (to, _from) => {
313313
if (to.meta.restricted) {
314314
const auth = useAuthStore();
315315
const state = useStateStore();
316-
while (!state.init.authChecked) await delay(50); // wait for session check
316+
while (!state.init.authChecked) await delay(25); // wait for session check
317317
const ru = to.meta.restricted === 'user'; // route is restricted to users
318318
const rsu = to.meta.restricted === 'superuser'; // route is restricted to superusers
319319
const l = !!auth.user; // a user is logged in

0 commit comments

Comments
 (0)