@alore/auth-react-native-ui
Version:
React Native UI for Alore Auth
17 lines (12 loc) • 492 B
text/typescript
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>>;