New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

monaco-editor-nls

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monaco-editor-nls

Localization for monaco editor

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

monaco-editor-nls

You can find how to use it in monaco-editor-esm-webpack-plugin.
It dependency on vscode-loc to get the locales.

Provider the file of nls.js to replace the original nls.js file of monaco editor. And also Provider the locales of monaco editor

Intalling

npm install monaco-editor-nls

Using

  • The first, you should cofigure monaco-editor-esm-webpack-plugin

  • Then, you can set the locale data in your code.

    // index.js
    import { setLocaleData } from 'monaco-editor-nls';
    import zh_CN from 'monaco-editor-nls/locale/zh-hans';
    
    setLocaleData(zh_CN);
    
    // You must import/require after `setLocaleData`
    const monaco = require('monaco-editor/esm/vs/editor/editor.api');
    
    monaco.editor.create(document.getElementById('container'), { language: 'javascript' });
    

Using custom locale

For example to use vscode-loc

  • First, install.

npm install git+ssh://git@github.com:microsoft/vscode-loc.git

  • Then, set the locale data.

    // index.js
    import { setLocaleData } from 'monaco-editor-nls';
    import zh_CN from 'vscode-loc/i18n/vscode-language-pack-zh-hans/translations/main.i18n.json';
    
    // Note: there should set the `contents`.
    setLocaleData(zh_CN.contents);
    
    // You must import/require after `setLocaleData`
    const monaco = require('monaco-editor/esm/vs/editor/editor.api');
    
    monaco.editor.create(document.getElementById('container'), { language: 'javascript' });
    

Notice

Current monaco-editor version: 0.32.x

Keywords

FAQs

Package last updated on 05 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc