npm install
node prepare.js
node build.js
npx serve -l tcp://127.0.0.1:3000
open http://127.0.0.1:3000/dist/
- This repository is based on the esbuild sample, but the
prepare.jsscript should work for any other bundler. - The solution consists of scanning the
/amd/distribution of the monaco editor and creating a mapping from all English strings to translated strings. - Then, the
monaco-editor/esm/vs/nls.jsfile is patched to contain all of these strings. - As a consumer of the editor, you need to define
self.MONACO_LANGUAGEbefore loading the source code for the editor- Supported values:
"de", "en", "es", "fr", "it", "ja", "ko", "ru", "zh-cn", "zh-tw"
- Supported values:
- The catch is that this solution will bundle all languages used in the editor, so that is why this isn't the official solution. You can take inspiration from this sample and write your own
nls.jsscript which matches the logic you have for localizing other parts of your code. Good luck!