2024-03-04 10:33:02 -06:00
|
|
|
import { Locale } from 'discord.js';
|
|
|
|
|
|
2024-03-05 09:59:46 -06:00
|
|
|
export const 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-05 10:51:14 -06:00
|
|
|
export const translations = locales
|
|
|
|
|
.map((locale) => ({
|
2024-03-04 10:33:02 -06:00
|
|
|
locale,
|
2024-03-05 10:51:14 -06:00
|
|
|
translations: require(`../../lang/${locale}.json`),
|
|
|
|
|
}))
|
|
|
|
|
.reduce(
|
|
|
|
|
(table, { locale, translations }) => ({
|
|
|
|
|
...table,
|
|
|
|
|
[locale]: translations,
|
|
|
|
|
}),
|
|
|
|
|
{},
|
|
|
|
|
) as Record<Locale, TranslationFragment>;
|