mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
replace element plus components
This commit is contained in:
@@ -1,27 +1,3 @@
|
||||
const elementPlusStrings = {
|
||||
// Vite does not support dynamic imports to `node_modules`.
|
||||
// https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
|
||||
cs: () => import('element-plus/es/locale/lang/cs'),
|
||||
en: () => import('element-plus/es/locale/lang/en'),
|
||||
es: () => import('element-plus/es/locale/lang/es'),
|
||||
fr: () => import('element-plus/es/locale/lang/fr'),
|
||||
hu: () => import('element-plus/es/locale/lang/hu'),
|
||||
ja: () => import('element-plus/es/locale/lang/ja'),
|
||||
ko: () => import('element-plus/es/locale/lang/ko'),
|
||||
pl: () => import('element-plus/es/locale/lang/pl'),
|
||||
pt: () => import('element-plus/es/locale/lang/pt'),
|
||||
ru: () => import('element-plus/es/locale/lang/ru'),
|
||||
th: () => import('element-plus/es/locale/lang/th'),
|
||||
vi: () => import('element-plus/es/locale/lang/vi'),
|
||||
'zh-CN': () => import('element-plus/es/locale/lang/zh-cn'),
|
||||
'zh-TW': () => import('element-plus/es/locale/lang/zh-tw')
|
||||
};
|
||||
|
||||
async function getElementPlusStrings(code) {
|
||||
const loader = elementPlusStrings[code] || elementPlusStrings.en;
|
||||
return (await loader().catch(() => elementPlusStrings.en())).default;
|
||||
}
|
||||
|
||||
const localizedStringsUrls = import.meta.glob('./*.json', {
|
||||
eager: true,
|
||||
query: '?url',
|
||||
@@ -50,10 +26,7 @@ async function getLocalizedStrings(code) {
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...localizedStrings,
|
||||
elementPlus: await getElementPlusStrings(code)
|
||||
};
|
||||
return localizedStrings;
|
||||
}
|
||||
|
||||
const languageNames = import.meta.glob('./*.json', {
|
||||
|
||||
Reference in New Issue
Block a user