feat: add i18n checker (ui) (#17283)

This commit is contained in:
Kindy Lin
2025-04-02 13:58:31 +08:00
committed by GitHub
parent 8c77f2dc03
commit 95c6bd1c8a
4 changed files with 224 additions and 1 deletions

View File

@@ -47,8 +47,9 @@ const loadLangResources = (lang: string) => ({
},
})
type Resource = Record<string, ReturnType<typeof loadLangResources>>
// Automatically generate the resources object
const resources = LanguagesSupported.reduce((acc: any, lang: string) => {
export const resources = LanguagesSupported.reduce<Resource>((acc, lang) => {
acc[lang] = loadLangResources(lang)
return acc
}, {})