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

21 lines
569 B
TypeScript
Raw Normal View History

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>;