From 9a09b5d7448b32af7bc9f7972d1ef61c631ef436 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 20 Sep 2022 16:23:51 +0800 Subject: feat: Loading locales now work, needs a bit of a polish --- apps/kit/src/routes/+layout.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 apps/kit/src/routes/+layout.ts (limited to 'apps/kit/src/routes/+layout.ts') diff --git a/apps/kit/src/routes/+layout.ts b/apps/kit/src/routes/+layout.ts new file mode 100644 index 0000000..de8a5c0 --- /dev/null +++ b/apps/kit/src/routes/+layout.ts @@ -0,0 +1,9 @@ +import type {Locales} from "$lib/i18n/i18n-types"; +import {loadLocaleAsync} from "$lib/i18n/i18n-util.async"; +import type {LayoutLoad} from "./$types"; + +export const load: LayoutLoad<{ locale: Locales }> = async ({url, params}) => { + let lang = "en" as Locales; + await loadLocaleAsync(lang); + return {locale: lang}; +}; \ No newline at end of file -- cgit v1.3