mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: period subcommands
This commit is contained in:
1 parent
db7c865c76
commit
8a76558f01
10 files changed
+199
-100
No files matched your search
@@ -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>;
|
||||
Reference in new issue
Block a user