2024-03-04 10:33:02 -06:00
|
|
|
import { Locale } from 'discord.js';
|
|
|
|
|
|
2024-03-07 21:38:38 -06:00
|
|
|
export const SUPPORTED_LOCALES: Locale[] = [Locale.EnglishUS, Locale.SpanishES];
|
2024-03-03 22:13:22 -06:00
|
|
|
|
|
|
|
|
export type TranslationFragmentTree = {
|
|
|
|
|
[key: string]: TranslationFragment;
|
|
|
|
|
} & {
|
|
|
|
|
$?: string;
|
|
|
|
|
};
|
|
|
|
|
export type TranslationFragment = string | TranslationFragmentTree;
|
|
|
|
|
|
2024-03-07 21:38:38 -06:00
|
|
|
export const translations = SUPPORTED_LOCALES.map((locale) => ({
|
|
|
|
|
locale,
|
|
|
|
|
translations: require(`../../lang/${locale}.json`),
|
|
|
|
|
})).reduce(
|
|
|
|
|
(table, { locale, translations }) => ({
|
|
|
|
|
...table,
|
|
|
|
|
[locale]: translations,
|
|
|
|
|
}),
|
|
|
|
|
{},
|
|
|
|
|
) as Record<Locale, TranslationFragment>;
|