dt-monaco-editor-nls
nls: National Language Support
This package is a webpack plugin for using zh-CN in monaco-editor@0.30.1
.
The /i18n/dt-zh-hans.json
is condensed from vscode-loc and it only applicable to DTStack. Provider the nls.js
to replace the monaco-editor/esm/vs/nls.js
.
Install
npm install dt-monaco-editor-nls
Using
const plugin = [
...,
{
key: 'WebpackPlugin',
action: 'add',
opts: {
name: 'DTMonacoEditorNlsPlugin',
fn: () => {
return new DTMonacoEditorNlsPlugin();
},
},
}
]
const DTMonacoEditorNlsPlugin = require("dt-monaco-editor-nls");
module.exports = {
...,
plugins: [new DTMonacoEditorNlsPlugin()],
...,
};
Notice
Our monaco-editor version: 0.30.1
and we will use 0.31.1
in the feature.
If you need complete zh-CN or other languages, you can fork this repository, find your json file in vscode-loc and move to /i18n/***.json
, and you need to modify the code with json file path in nls.js
.