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

17 lines
484 B
TypeScript
Raw Normal View History

2024-03-03 22:13:22 -06:00
const LANGUAGES = ['en-US', 'es-ES', 'ja-JP'] as const;
export type Language = (typeof LANGUAGES)[number];
export type TranslationFragmentTree = {
[key: string]: TranslationFragment;
} & {
$?: string;
};
export type TranslationFragment = string | TranslationFragmentTree;
export const translations = LANGUAGES.reduce(
(table, language) => ({
...table,
[language]: import(`../../lang/${language}.json`),
}),
{},
) as Record<Language, Promise<TranslationFragment>>;