e4488a900b
* feat: add user locale preference to user_preferences table
- Introduced a new column 'locale' in the user_preferences table to store per-user UI language preferences.
- Added a CHECK constraint to ensure only supported locales ('sv', 'en') are allowed.
- Triggered a schema reload notification for the changes.
chore: declare CSS module support in TypeScript
- Added a declaration for CSS modules in globals.d.ts to enable TypeScript support for importing CSS files.
* feat: add Swish as an invoice payment method in company settings
14 lines
498 B
TypeScript
14 lines
498 B
TypeScript
import { cookies } from 'next/headers'
|
|
import { getRequestConfig } from 'next-intl/server'
|
|
import { DEFAULT_LOCALE, LOCALE_COOKIE, isLocale, type Locale } from './config'
|
|
|
|
export default getRequestConfig(async () => {
|
|
const cookieStore = await cookies()
|
|
const fromCookie = cookieStore.get(LOCALE_COOKIE)?.value
|
|
const locale: Locale = isLocale(fromCookie) ? fromCookie : DEFAULT_LOCALE
|
|
|
|
const messages = (await import(`../messages/${locale}.json`)).default
|
|
|
|
return { locale, messages }
|
|
})
|