-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localize plugins using language packs #10087
Conversation
7a5071c
to
da48301
Compare
@msujew one of the problems I see is that we're assuming that plugins are deployed at the back end, not the plugin host. I think this prevents us from doing stuff like remote workspaces, as VS Code does. I think just using the |
Also: could you open an epic with problems you know that need solving with NLS? Would be good to be able to track the state of the implementation. |
Sure, done #10188
I'm not sure I can follow. Can the plugin host be deployed to other resources (which do not have access to the file system of the backend) using remote workspaces? The issue is that the extensions/plugins internally try (using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as described! Great work!
da48301
to
4ad6514
Compare
4ad6514
to
4dda178
Compare
@tsmaeder FYI, I will come back to the remote plugin host issue later, in another PR. I'll merge this for now. |
What it does
Addresses one of the open issues of #9538: Enables Theia to localize vscode extensions/plugins using language packs.
Basically addresses two problems regarding vscode extensions:
First off, it changes how the plugin package is read. Placeholders are now replaced when the frontend loads and not when the plugin is deployed.
Secondly, through reverse engineering of the
vscode-nls
module, we are able to createtranslationConfig
files that point to the correct localization file for each vscode extension. These files are cached in thelocalization-cache
folder in the Theia home directory.How to test
vscode.npm
builtin extension and a language pack of your liking.npm Scripts
view is visible and in english.package.json
file that contains ascripts
section. Hover over one of the scripts and observe theRun Script
popup:Configure Display Language
command to change to a different language.npm Scripts
view should now have a different name. (Tests that thepackage.json
is still correctly translated)package.json
file and observe a changed popup. (Tests that the plugin host runtime is using the correct localization)Review checklist
Reminder for reviewers