feat: rename

This commit is contained in:
TrèsAbhi committed 2024-03-07 21:38:38 -06:00
1 parent b71feca802
commit bf0246ec26
3 files changed
+17 -17

No files matched your search

+11 -13
View File
@@ -1,6 +1,6 @@
import { Locale } from 'discord.js';
export const locales: Locale[] = [Locale.EnglishUS, Locale.SpanishES];
export const SUPPORTED_LOCALES: Locale[] = [Locale.EnglishUS, Locale.SpanishES];
export type TranslationFragmentTree = {
[key: string]: TranslationFragment;
@@ -9,15 +9,13 @@ export type TranslationFragmentTree = {
};
export type TranslationFragment = string | TranslationFragmentTree;
export const translations = locales
.map((locale) => ({
locale,
translations: require(`../../lang/${locale}.json`),
}))
.reduce(
(table, { locale, translations }) => ({
...table,
[locale]: translations,
}),
{},
) as Record<Locale, TranslationFragment>;
export const translations = SUPPORTED_LOCALES.map((locale) => ({
locale,
translations: require(`../../lang/${locale}.json`),
})).reduce(
(table, { locale, translations }) => ({
...table,
[locale]: translations,
}),
{},
) as Record<Locale, TranslationFragment>;