microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.95k stars 29.53k forks source link

Missing localization for ES modules in `monaco-editor-core` #153256

Open graphemecluster opened 2 years ago

graphemecluster commented 2 years ago

Search Terms: ES modules, NPM, build, gulp tasks

There are a couple of issues opened and closed in the monaco-editor repo (#1322, #1514, #2446) but I can't find one in this repo despite that the related source code is here, so I am opening one for traceability.

Non-official solutions like blutorange/primefaces-monaco/ESM-I18N.md and repos like wang12124468/monaco-editor-nls are not ideal because these solutions are regex-based and require additional steps.

Inspecting the tasks code in the build folder, I believe that the reason behind this is that the ESM files are only built by the tsc command while the AMD files are compiled with custom code in build/lib/tsb. More importantly the AMD files pass though the build/lib/nls.ts transformer but the ESM files do not, so I guess a simple line of nls.nls() does the job. I am new to this repo and am not sure what needs to be done additionally, or else I were opening a PR implementing this.

dbaeumer commented 2 years ago

@TylerLeonhardt we worked on a story for the AMD build of the Monaco editor but for ESM no effort has been spent yet. I am actually not sure either what the effort would be to get this working.

cary-hu commented 1 year ago

Any update?