feat: period subcommands

This commit is contained in:
TrèsAbhi committed 2024-03-05 10:51:14 -06:00
1 parent db7c865c76
commit 8a76558f01
10 files changed
+199 -100

No files matched your search

+11 -14
View File
@@ -9,18 +9,15 @@ export type TranslationFragmentTree = {
};
export type TranslationFragment = string | TranslationFragmentTree;
export const translations = Promise.all(
locales.map(async (locale) => ({
export const translations = locales
.map((locale) => ({
locale,
translations: await import(`../../lang/${locale}.json`),
})),
).then(
(translations) =>
translations.reduce(
(table, { locale, translations }) => ({
...table,
[locale]: translations,
}),
{},
) as Record<Locale, TranslationFragment>,
);
translations: require(`../../lang/${locale}.json`),
}))
.reduce(
(table, { locale, translations }) => ({
...table,
[locale]: translations,
}),
{},
) as Record<Locale, TranslationFragment>;