mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
17 lines
484 B
TypeScript
17 lines
484 B
TypeScript
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>>;
|