mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: optimize resource load
This commit is contained in:
1 parent
e935558702
commit
f43c1bc8c9
11 files changed
+38
-40
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { setLocaleData } from 'vj/components/monaco/nls';
|
||||
|
||||
export default async function load() {
|
||||
let resource;
|
||||
const lang = UserContext.viewLang;
|
||||
if (lang === 'zh') {
|
||||
resource = await import('monaco-editor-nls/locale/zh-hans.json');
|
||||
} else if (lang === 'zh_TW') {
|
||||
resource = await import('monaco-editor-nls/locale/zh-hant.json');
|
||||
} else if (lang === 'ko') {
|
||||
resource = await import('monaco-editor-nls/locale/ko.json');
|
||||
}
|
||||
if (resource) setLocaleData(resource);
|
||||
}
|
||||
Reference in new issue
Block a user