Initial commit
This commit is contained in:
commit
96d609a89e
34 changed files with 4978 additions and 0 deletions
10
src/hooks.server.ts
Normal file
10
src/hooks.server.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import type { Handle } from '@sveltejs/kit'
|
||||
import { locale } from 'svelte-i18n'
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
const lang = event.request.headers.get('accept-language')?.split(',')[0]
|
||||
if (lang) {
|
||||
locale.set(lang)
|
||||
}
|
||||
return resolve(event)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue