Anvil/src/routes/+layout.ts
André Jaenisch 62aba86d5d
feat: set up internationalisation
This allows for translating the interface using Weblate at
translate.codeberg.org!

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-02-14 12:11:03 +01:00

12 lines
309 B
TypeScript

import { browser } from '$app/environment';
import '$lib/i18n'; // Initialize i18n
import { locale, waitLocale } from 'svelte-i18n';
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = async () => {
if (browser) {
locale.set(window.navigator.language);
}
await waitLocale();
};