18 lines
472 B
TypeScript
18 lines
472 B
TypeScript
import type { NuxtI18nOptions } from '@nuxtjs/i18n';
|
|
import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from '../app/constants';
|
|
|
|
export const i18nConfig: NuxtI18nOptions = {
|
|
defaultLocale: DEFAULT_LOCALE,
|
|
locales: SUPPORTED_LOCALES.map((locale) => ({
|
|
code: locale.code,
|
|
file: locale.file,
|
|
})),
|
|
lazy: true,
|
|
strategy: 'prefix',
|
|
detectBrowserLanguage: {
|
|
alwaysRedirect: true,
|
|
redirectOn: 'root',
|
|
fallbackLocale: DEFAULT_LOCALE,
|
|
cookieKey: 'schon-locale',
|
|
},
|
|
};
|