Страница:
How to create language pack extension
5
How to create language pack extension
Daniel Ye редактировал(а) эту страницу 2021-10-04 18:35:51 -07:00
Содержание
- One time local environment setup.
- 1. Clone vscode repository
- 2. Follow VS Code how to contribute instruction to prepare machine.
- 3. Clone vscode-loc repository
- Prepare language pack extension and package.json file.
- 1. If your language is not available, make a copy of one existing language, for example vscode-language-pack-de in local clone.
- 2. Modify package.json and readme.md of your language
- Prepare source .xlf for translation process
- Localize .xlf for your project
- Folder structure reference
- Import translation to language pack
- Build and test language pack extension vsix
- 1. Build vsix
- 2. Test vsix
- 3. Fix issues and repeat above steps if necessary.
- 4. Commit and push changes to repository
- Need help
- Next Step
One time local environment setup.
1. Clone vscode repository
2. Follow VS Code how to contribute instruction to prepare machine.
Please complete all steps in Prerequisites section. Actions include but not limited to below.
- Clone vscode repository.
- Install Git.
- Install Node.JS.
- Install Yarn.
- Install Python.
- Install C/C++ compiler tool chain.
3. Clone vscode-loc repository
Prepare language pack extension and package.json file.
1. If your language is not available, make a copy of one existing language, for example vscode-language-pack-de in local clone.
- Name the folder as vscode-language-pack-[languageID]. See existing languages for reference.
2. Modify package.json and readme.md of your language
- Reference existing languages for example.
- Use VS Code to edit package.json in your language pack folder.
Prepare source .xlf for translation process
- run 'gulp vscode-translations-export' to export strings from VSCode source code to .xlf.
- Source .xlf can be found under 'vscode-translations-export' in same level with your vscode local clone.
Localize .xlf for your project
- Get .xlf localized in the process and tool you choose.
- After loc complete, organize files under 'vscode-translations-import/[languageID]'
Folder structure reference
Import translation to language pack
1. Update local language pack folder (in vscode-loc) with latest translation (from vscode-translations-import)
- Change directory to local vscode repository
git checkout master
git pull
npm run update-localization-extension {path_to_lang_pack_ext}
- For example:
npm run update-localization-extension -- --location ../vscodeloc/localization de
Build and test language pack extension vsix
1. Build vsix
- Change directory to local vscode-loc repository
npm install -g vsce
- Change directory to vscode-language-pack[languageID]
vsce package
this will produce vsix package in vscode-language-pack[languageID] folder
2. Test vsix
- Install VS Code Insiders
- Load vsix to test
code --install-extension [name of your extension.vsix]
code --locale [the new locale id, e.g. tr]
3. Fix issues and repeat above steps if necessary.
4. Commit and push changes to repository
git add i18/vscode-language-pack[languageID]/*
git commit -m "message/description"
git push -u origin yourbranchname -vv
- Visit vscode-loc and create pull request against master branch.
Need help
- Please create a new GitHub issue