Auto locale
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import type {LayoutLoad} from './$types';
|
||||
import {loadTranslations} from "$lib/translations";
|
||||
import {loadTranslations} from '$lib/translations';
|
||||
import type {LayoutLoad} from "./$types";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export const load: LayoutLoad = async ({ url }) => {
|
||||
export const load: LayoutLoad = async ({ url, data }) => {
|
||||
const { pathname } = url;
|
||||
const { locale } = data.i18n
|
||||
|
||||
const initLocale = 'ru';
|
||||
await loadTranslations(locale, pathname);
|
||||
|
||||
await loadTranslations(initLocale, pathname);
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user