Files
blitzkit/src/core/localization/strings.ts
T

23 lines
573 B
TypeScript
Raw Normal View History

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) => ({
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>;