mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
15 lines
489 B
TypeScript
15 lines
489 B
TypeScript
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);
|
|
}
|