translator-helper is a VS Code Extension to simplify the translation of documents, especially for the localization of Docs.
Google translate API supported. For Chinese users, you can update the settings to use GoogleCN service.
- Translate and Insert. Alt+T. It is very useful when you localize the docs. Click any position in the paragraph, then press Alt+T. The whole paragraph will be translated then inserted after the original text.
-
Reverse Translate and Insert: Shift+Alt+T. Translate the text from the target language to the source language.
-
Select and Hover Translate. You can select a word or a sentence, hover the mouse over the text, then the text will be translated in a popup. You can click Copy to copy the translated text.
- Translate: Ctrl+T. Select a word or a sentence, then press Ctrl+T. The translated text will be shown on the status bar. The text will be automatically copied to the clipboard.
You can change the User Settings to specify the API and the languages you need to translate.
This extension contributes the following settings:
translatorHelper.api
: Specify the translate API. Options:google
,google-cn
.translatorHelper.sourceLanguage
: The source language code. The default value isen
.translatorHelper.targetLanguage
: The target language code. The default value iszh-CN
.translatorHelper.enableSelectionHoverTranslation
: Whether to enable selection and hover translation. The default value istrue
.
The source and target languages are identified using the iso-639-1 codes. For example, the source language is English (en) and the target language is Chinese-Simplified (zh-CN). You can find all the supported languages here: Language support
The keybinding might not work properly on some linux machines. Please open issues to describe your environment. Thanks.
Please see Changelog
Enjoy!