Files
vscode-extension-samples/i18n-sample/README.md
Nick Chen 737d2db5b4 Initial version of i18n-sample
To keep things simple, this doesn't use the nls-dev package. I think this demystifies a lot of things when you see what is actually going on behind the scenes.
2017-07-08 14:59:34 -07:00

1.3 KiB

README

This is the README for the "i18n-sample"


This folder contains a sample VS code extension that shows how to use the package.nls.json and vscode-nls library for localization. For this sample, it shows two commands: Hello and Bye.

The text for the commands are defined in the top-level package.nls.json (for English) and package.nls.ja.json (for Japanese). This is how you would localize your text in the package.json file.

The actual text that is shown by the invocation of the commands are in src/extension.ts and src/command/sayBye.ts. It shows how to use nls.config and nls.loadMessageBundle.

How to run locally

Localization values are only applied in the VSIX package.

  1. Run npm install to bring in the dependencies.
  2. Follow the steps at https://code.visualstudio.com/docs/extensions/publish-extension to ensure that you have installed vsce and have a publisher account.
  3. Run vsce package to produce a .vsix file.
  4. Install the .vsix file following the instructions at https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix
  5. Change your locale to Japanese by invoking "Configure Language" from the Command Palette.

History

0.0.1:

Manually transform the calls to localize to illustrate explicitly what is going on.