-
Notifications
You must be signed in to change notification settings - Fork 30k
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
nls support for package.json and common-js #3156
Comments
More detailed testing steps would be appreciated. Also, I have no idea how to setup and test a Portuguese translation... |
@joaomoreno we do not have any translations other than the pseudo translation. If we had, you could test Portuguese by launching code with "--locale=pt_PT" or "--locale=pt_BR". |
Isn't each extension supposed to ship its own translations files? If so, how can I set up a Portuguese file? |
@joaomoreno the process (i.e. tools) that produces these files is not yet ready (https://github.com/Microsoft/vscode-nls-dev). The default package.nls.json I've created manually. I assume that you can make a Portuguese clone of it but we would have to reverse engineer the name of that file from the source in vscode-nls-dev. |
Got it |
See microsoft/vscode#3156 for how to do this.
See microsoft/vscode#3156 for how to do this.
Assignments
Details
We now have nls support for package.json and common-js. To test do the following:
Package.json for Extensions
package.json
, replace strings that should be localized with a key surrounded by %%. For exampleEnsure that when you start the extension the correct string is presented in the user interface. Also ensure that pseudo translation works. To do so start vscode with --locale=pseudo. The strings from the package.nls.json should be enclosed in [] and vowels should be doubled.
CommonJS Extensions
Install
vscode-nls
as a dependency of your extension. In the extension main add the following code:And in the activate function add
This should show the following in the console:
In other files in the extension you don't need to configure the nls module again. You can simple do:
If you want to leave the code in since you tested it with your extension code then simply remove the locale property and initialize as follows:
The text was updated successfully, but these errors were encountered: