From 900bb5e845c3ad44defbd427cae3d44a4a43321f Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sat, 25 Feb 2023 13:15:44 +0100 Subject: feat: Initial commit --- code/app/src/routes/(main)/+layout.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 code/app/src/routes/(main)/+layout.ts (limited to 'code/app/src/routes/(main)/+layout.ts') diff --git a/code/app/src/routes/(main)/+layout.ts b/code/app/src/routes/(main)/+layout.ts new file mode 100644 index 0000000..3893260 --- /dev/null +++ b/code/app/src/routes/(main)/+layout.ts @@ -0,0 +1,10 @@ +import type { LayoutLoad } from "./$types"; +import type { Locales } from "$i18n/i18n-types"; +import { loadLocaleAsync } from "$i18n/i18n-util.async"; +import { setLocale } from "$i18n/i18n-svelte"; + +export const load: LayoutLoad<{ locale: Locales }> = async ({ data: { locale } }) => { + await loadLocaleAsync(locale); + setLocale(locale); + return { locale }; +}; \ No newline at end of file -- cgit v1.3