Skip to content

hzm0321/monaco-editor-chinese-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

monaco-editor-chinese-plugin

npm install --save-dev monaco-editor-chinese-plugin

Usage

webpack config

const MonacoChinesePlugin = require('monaco-editor-chinese-plugin');

module.exports = {
    ...
    plugins: [
        new MonacoChinesePlugin({
            //defaultLanguage: "getLanguageSetting()",
            /**
             * log on console if unmatched
             */
            logUnmatched: false,
            /**
             * self languages map, .eg {"zh-cn": {"Find": "查找", "Search": "搜索"}, "de":{}, ... }
             */
            mapLanguages: {},
        })
    ]
}

HzeroJs Usage

webpack config

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const MonacoChinesePlugin = require('monaco-editor-chinese-plugin');

const config: IConfig = {
  chainWebpack: (c) => {
    c.plugin('monaco-editor-webpack-plugin').use(new MonacoWebpackPlugin({
      languages: ['javascript', 'typescript', 'sql', 'json'],
    }));
    c.plugin('monaco-editor-chinese-plugin').use(new MonacoChinesePlugin({
      logUnmatched: true,
    }));
    // ......
  },
  // 其余配置 ......
};
export default config;

About

A webpack plugin for monaco-editor locales setting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%