UNPKG

@alore/auth-react-native-ui

Version:
17 lines (12 loc) 492 B
import { Locale } from '../types'; export const i18n = { defaultLocale: 'en', locales: ['en', 'pt'], } as const; export const dictionaries = { en: () => import('../dictionaries/en.json').then((module) => module.default), pt: () => import('../dictionaries/pt.json').then((module) => module.default), }; export const getDictionary = async (locale: Locale) => dictionaries[locale as keyof typeof dictionaries](); export type Dictionary = Awaited<ReturnType<typeof getDictionary>>;