Skip to content

DTStack/dt-monaco-editor-nls-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dt-monaco-editor-nls-webpack-plugin

NPM Status

nls: National Language Support

This package is designed for utilizing zh-CN in monaco-editor@0.30.1 or monaco-editor@0.31.1.

The Chinese localization JSON file /i18n/dt-zh-hans.json is a simplified version of vscode-loc and This is only relevant to DTStack and it supply the nls.js to replace the monaco-editor/esm/vs/nls.js.

Install

npm install dt-monaco-editor-nls-webpack-plugin -D

Using

const plugin = [
    ...,
    {
        key: 'WebpackPlugin',
        action: 'add',
        opts: {
            name: 'DTMonacoEditorNlsWebpackPlugin',
            fn: () => {
                return new DTMonacoEditorNlsWebpackPlugin();
            },
        },
    }
]
  • webpack.config.js
const DTMonacoEditorNlsWebpackPlugin = require("dt-monaco-editor-nls-webpack-plugin");

module.exports = {
    ...,
    plugins: [new DTMonacoEditorNlsWebpackPlugin()],
    ...,
};

Notice

Our monaco-editor version: 0.30.1 or 0.31.1.

If you need the support zh-CN or other languages, you can fork this repository, locate your json file in vscode-loc and move it to /i18n/***.json. Additionally, you will need to modify the code with the json file path in nls.js.

About

Simplified Chinese Support For Monaco Editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published