i18n
This commit is contained in:
parent
764d0c0526
commit
ac111154fe
7 changed files with 183 additions and 0 deletions
11
src/routes/+layout.ts
Normal file
11
src/routes/+layout.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { browser } from '$app/environment';
|
||||
import '$lib/i18n'; // Import to initialize. Important :)
|
||||
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();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue