fix: i18n
This commit is contained in:
parent
fe3702847a
commit
029b623f08
@ -1,8 +1,13 @@
|
|||||||
<script context="module" lang="ts">
|
<script context="module" lang="ts">
|
||||||
import type { Load } from '@sveltejs/kit';
|
import type { Load } from '@sveltejs/kit';
|
||||||
import { publicPaths } from '$lib/settings';
|
import { publicPaths } from '$lib/settings';
|
||||||
|
import { locale, loadTranslations } from '$lib/translations';
|
||||||
export const load: Load = async ({ fetch, url, session }) => {
|
export const load: Load = async ({ fetch, url, session }) => {
|
||||||
|
const { pathname } = url;
|
||||||
|
const defaultLocale = 'en';
|
||||||
|
const initLocale = locale.get() || defaultLocale;
|
||||||
|
await loadTranslations(initLocale, pathname);
|
||||||
|
|
||||||
if (!session.userId && !publicPaths.includes(url.pathname)) {
|
if (!session.userId && !publicPaths.includes(url.pathname)) {
|
||||||
return {
|
return {
|
||||||
status: 302,
|
status: 302,
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
: window.location.hostname
|
: window.location.hostname
|
||||||
: database.id
|
: database.id
|
||||||
}:${isPublic ? database.publicPort : privatePort}/${databaseDefault}`
|
}:${isPublic ? database.publicPort : privatePort}/${databaseDefault}`
|
||||||
: $t('forms.loading');
|
: $t('forms.loading'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeSettings(name) {
|
async function changeSettings(name) {
|
||||||
|
Loading…
Reference in New Issue
Block a user