0👍
安装monaco-editor-locales-plugin
npm instal -D monaco-editor-locales-plugin
weback配置
//引入插件
const MonacoLocalesPlugin = require('monaco-editor-locales-plugin');
new MonacoLocalesPlugin({
//设置支持的语言
languages: ["es","zh-cn"],
//默认语言
defaultLanguage: "zh-cn",
//打印不匹配的文本
logUnmatched: false,
//自定义文本翻译
mapLanguages: {"zh-cn": {"Peek References": "查找引用", "Go to Symbol...": "跳到变量位置", "Command Palette": "命令面板"}}
})
Source:stackexchange.com