Put locale labels outside of translations

This commit is contained in:
Sebastien Castiel
2024-12-07 11:37:39 -05:00
parent 5374d9e9c7
commit 2c973f976f
14 changed files with 29 additions and 190 deletions

View File

@@ -1,20 +1,25 @@
import { getRequestConfig } from 'next-intl/server'
import { getUserLocale } from './lib/locale'
export const locales = [
'en-US',
'fi',
'fr-FR',
'es',
'de-DE',
'zh-CN',
'zh-TW',
'ru-RU',
'it-IT',
'ua-UA',
'ro',
] as const
export type Locale = (typeof locales)[number]
export const localeLabels = {
'en-US': 'English',
fi: 'Suomi',
'fr-FR': 'Français',
es: 'Español',
'de-DE': 'Deutsch',
'zh-CN': '简体中文',
'zh-TW': '正體中文',
'pl-PL': 'Polski',
'ru-RU': 'Русский',
'it-IT': 'Italiano',
'ua-UA': 'Українська',
ro: 'Română',
} as const
export const locales: (keyof typeof localeLabels)[] = Object.keys(
localeLabels,
) as any
export type Locale = keyof typeof localeLabels
export type Locales = ReadonlyArray<Locale>
export const defaultLocale: Locale = 'en-US'