1 import type { LocaleData } from 'ttag';
3 import type { TtagLocaleMap } from '../interfaces/Locale';
5 export let locales: TtagLocaleMap = {};
7 type LocaleRequireContext = { keys: () => string[]; (id: string): Promise<LocaleData> };
9 export const getLocalesFromRequireContext = (locales: LocaleRequireContext) => {
10 return locales.keys().reduce<TtagLocaleMap>((acc, key) => {
11 acc[key.slice(2, key.length - 5)] = () => locales(key);
16 export const setTtagLocales = (newLocales: TtagLocaleMap) => {