mirror of
https://github.com/ershisan99/www.git
synced 2026-01-25 05:12:09 +00:00
wip
This commit is contained in:
13
src/i18n/request.ts
Normal file
13
src/i18n/request.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { getRequestConfig } from 'next-intl/server'
|
||||
import { headers } from 'next/headers'
|
||||
|
||||
export default getRequestConfig(async () => {
|
||||
// Provide a static locale, fetch a user setting,
|
||||
// read from `cookies()`, `headers()`, etc.
|
||||
const locale = (await headers()).get('accept-language')?.split(',')[0] ?? 'en'
|
||||
|
||||
return {
|
||||
locale,
|
||||
messages: (await import('../../messages/en.json')).default,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user