yo-next-auth/config/locales.ts

42 lines
855 B
TypeScript

// @https://www.localeplanet.com/icu/index.html
type loc = ('uk' | 'en')
type Locale = {
id: string,
java: string,
iso: string,
code: loc,
name: string,
originalName: string,
}
const defaultLocale: loc = 'uk'
const fallbackLocale: loc = 'en'
const importLocales = {
uk: () => import('@/locales/uk'), en: () => import('@/locales/en'),
} as const
const LC: Locale[] = [
{
id: 'uk_UA',
java: 'uk-UA',
iso: 'ukr',
code: 'uk',
name: 'Ukrainian',
originalName: 'Українська',
},
{
id: 'en_US',
java: 'en-US',
iso: 'eng',
code: 'en',
name: 'English',
originalName: 'English',
}] as const
const locales: loc[] = LC.map((locale: Locale) => locale.code)
const SKIP_I18N_URLS = '/api/'
export { locales, defaultLocale, fallbackLocale, LC, importLocales, type loc, SKIP_I18N_URLS }