microsoft / microsoft/monaco-editor
Cannot change locale in monaco-typescript
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
monaco-editor version: 0.23.0
Browser: Microsoft Edge 89.0.774.45
OS: Windows 10 (20H2)
Playground code that reproduces the issue:
I want to set the locale of monaco typescript to zh-cn.
However, using the code as follow, I can only see the editor showing in Chinese. The diagnostic messages of typescript are still English.
require.config({
'vs/nls': {
availableLanguages: {
'*': 'zh-cn'
}
}
});
The value of 'monaco.languages.typescript.compileroptions.locale' in Console is 'zh-cn'.
I tried to put the folder zh-cn with the file diagnositcMessages.generated.json under the path 'vs/language/typescript', but it doesn't work as well.
Does it mean I did the wrong steps or this function is not available for monaco editor now.
Thanks a lot for developing this project!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the require.config localization settings and monaco.languages.typescript.compilerOptions.locale described in the report, then inspect the referenced vs/language/typescript/diagnosticMessages.generated.json path. Reproduce the issue in the Monaco Editor playground or a self-contained page and verify whether TypeScript diagnostic messages appear in zh-cn.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, localization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100