TranslationPlugin
Translation plugin for IntelliJ-based IDEs/Android Studio.
Install / Use
/learn @YiiGuxing/TranslationPluginREADME
[![TranslationPlugin][plugin-logo]][gh:translation-plugin] TranslationPlugin
[![Plugin Homepage][badge:plugin-homepage]][plugin-homepage] [![Build Status][badge:build]][gh:workflows-build] [![License][badge:license]][gh:license] [![GitHub releases][badge:release]][gh:releases] [![Version][badge:version]][plugin-versions] [![Downloads][badge:downloads]][plugin-homepage] [![Financial Contributors on Open Collective][badge:open-collective]][open-collective]
<p align="center"><b>Translation plugin for IntelliJ based IDEs/Android Studio.</b></p> <p align="center"><img src="https://yiiguxing.github.io/TranslationPlugin/img/ext/screenshots.gif" alt="screenshots"></p><br/><br/><br/>
[![Getting Started][badge:get-started-en]][get-started-en] [![开始使用][badge:get-started-zh]][get-started-zh] [![はじめに][badge:get-started-jp]][get-started-ja] [![시작하기][badge:get-started-ko]][get-started-ko]
![Microsoft Translator][logo:microsoft-translator] <span> </span> ![Google Translate][logo:google-translate] <span> </span> ![OpenAI Translator][logo:openai] <span> </span> ![DeepL Translator][logo:deepl-translator] <span> </span> ![Youdao Translate][logo:youdao-translate] <span> </span> ![Baidu Translate][logo:baidu-translate] <span> </span> ![Alibaba Translate][logo:ali-translate]
Features
- Multiple Translation Engines
- Microsoft Translator
- Google Translate
- DeepL Translator
- OpenAI Translator
- Youdao Translate
- Baidu Translate
- Alibaba Translate
- Multiple languages inter-translation
- Text-to-speech
- Microsoft Edge TTS
- Google TTS
- OpenAI TTS
- Document translation
- Automatic word selection
- Automatic word breaks
- Word Book
Compatibility
- Android Studio
- Aqua
- AppCode
- CLion
- DataGrip
- DataSpell
- GoLand
- HUAWEI DevEco Studio
- IntelliJ IDEA Community
- IntelliJ IDEA Ultimate
- MPS
- PhpStorm
- PyCharm Community
- PyCharm Professional
- Rider
- RubyMine
- RustRover
- WebStorm
Installation
<a href="https://plugins.jetbrains.com/plugin/8579-translation" target="_blank"> <img src="https://yiiguxing.github.io/TranslationPlugin/img/ext/installation_button.svg" height="52" alt="Get from Marketplace" title="Get from Marketplace"> </a>-
Installing from the plugin repository within the IDE:
- <kbd>Preferences(Settings)</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search and find <b>"Translation"</b></kbd> > <kbd>Install Plugin</kbd>.
-
Installing manually:
- Download the plugin package on [GitHub Releases][gh:releases] or in the [JetBrains Plugin Repository][plugin-versions].
- <kbd>Preferences(Settings)</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd> > Select the plugin package and install (no need to unzip)
Restart the IDE after installation.
Using The Plugin
-
Sign up for a translation service (optional)
Most translation services require user registration to access their services (such as OpenAI, DeepL, Youdao Translate, etc.). Therefore, you may need to create an account, obtain an Authentication Key, and then bind the Authentication Key within the plugin:<kbd>Preferences(Settings)</kbd> > <kbd> Tools</kbd> > <kbd> Translation</kbd> > <kbd>General</kbd> > <kbd>Translation Engine</kbd> > <kbd>Configure...</kbd>
-
Begin translating
<kbd>Select a text or hover the mouse over the text</kbd> > <kbd>Right-click</kbd> > <kbd>Translate</kbd>
Or use shortcuts for translation, as detailed in Actions.
-
Replace with Translation
Translate the target text and replace it. If the target language is English, the output has several formats: in camel case, with a word separator (when the output contains multiple words, the separator can be configured in the plugin configuration page: <kbd>Translation Settings</kbd> > <kbd>Replace with Translation</kbd> > <kbd>Separator</kbd>) and in the original format.
Instructions: <kbd>Select a text or hover the mouse over the text</kbd> > <kbd>Right-click</kbd> > <kbd>Replace with Translation</kbd> (Or use shortcuts for translation, as detailed in Actions).
-
Translate Documentation
Quick Documentation and Inline Documentation can be translated via the context menu or shortcuts (detailed in Actions).
<kbd>Translation Settings</kbd> > <kbd>Other</kbd> > <kbd>Automatically translate documentation</kbd>: When you check this option, the Quick Documentation will be automatically translated when you view it.
-
Switch engines
Click the engine widget in the status bar or use the shortcut <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>S</kbd> (macOS: <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd>Y</kbd>) to switch between the translation engine and the TTS engine quickly.
Actions
-
Show Translation Dialog...
Open the translation dialog, which appears by default on the toolbar. Default shortcut:
- Windows - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd>
- macOS - <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd>I</kbd>
-
Translate
Extract words and translate them. If you have already selected a text, extract the words from the portion of the text you'd like to translate. Otherwise, words are extracted automatically from the maximum range (this extraction can be configured in Settings). This action is displayed by default in the editor's right-click context menu. Default shortcut:
- Windows - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Y</kbd>
- macOS - <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd>U</kbd>
-
Translate(Inclusive)
Extract words and translate them. Automatically extract and translate all words from a specific range, ignoring manually selected text. Default shortcut: (None)
-
Translate(Exclusive)
Extract words and translate them. Automatically extract the nearest single word, ignoring manually selected text. Default shortcut: (None)
-
Replace with Translation
Replace the text with translation. The word extraction method works the same as when translating. Default shortcut:
- Windows - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>X</kbd>
- macOS - <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd>O</kbd>
-
Translate Quick Documentation
Quickly display and translate the documentation of the symbol at the caret. When used in the Quick Documentation popup, you can toggle between the translated text and the original. Default shortcut:
- Windows - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Q</kbd>
- macOS - <kbd>Control</kbd> + <kbd>Q</kbd>
-
Translate Inline Documentation
Translate the contents of the editor's inline documentation rendered view. Displayed by default in the context menu of the inline documentation view and available within the inline documentation view. Default shortcut: (None)
-
Batch Translate Inline Documentation
Batch translate all inline documentation in the editor. Displayed by default on the editor inspections widget toolbar and available in Reader mode. Default shortcut: (None)
-
Translate Text Component
Translate selected text in some text components (e.g. Quick Docs, popup hints, input boxes...). This does not support automatic word extraction. Default shortcut (same as translation shortcut):
- Windows - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Y</kbd>
- macOS - <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd>U</kbd>
-
Switch Engine
Quickly switch between translation engine and TTS engine. Default shortcut:
- Windows - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>S</kbd>
- macOS - <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd>Y</kbd>
-
Word of the Day
Display the 'Word of the Day' dialog box. Default shortcut: (None)
-
Other
-
Translation dialog shortcuts:
- Display the list of source languages - <kbd>Alt</kbd> + <kbd>S</kbd>
- Display the list of target languages - <kbd>Alt</kbd> + <kbd>T</kbd>
- Switch between languages - <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>S</kbd>
- Pin/unpin a window - <kbd>Alt</kbd> + <kbd>P</kbd>
- Play TTS - <kbd>Alt/Meta/Shift</kbd> + <kbd>Enter</kbd>
- Save to Word Book - <kbd>Ctrl/Meta</kbd> + <kbd>F</kbd>
- Show history - <kbd>Ctrl/Meta</kbd> + <kbd>H</kbd>
- Copy translation - <kbd>Ctrl/Meta</kbd> + <kbd>Shift</kbd> + <kbd>C</kbd>
- Clear input - <kbd>Ctrl/Meta</kbd> + <kbd>Shift</kbd> + <kbd>BackSpace/Delete</kbd>
- Expand more translations - <kbd>Ctrl/Meta</kbd> + <kbd>Down</kbd>
- Hide more translations - <kbd>Ctrl/Meta</kbd> + <kbd>UP</kbd>
-
Translation balloon shortcuts:
- Open dialog - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Y</kbd> / <kbd>Control</kbd> + <kbd>Meta</kbd> + <kbd> U</kbd>
-
Quick Documentation window shortcuts:
- Enable/disable automatic translation - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Y</kbd> / <kbd>Control</kbd>
- <kbd>Meta</kbd> + <kbd>U</kbd>
- Enable/disable automatic translation - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Y</kbd> / <kbd>Control</kbd>
-
FAQ
If you have any questions, please ask [here][gh:discussions-q-a].
-
What should I do if there is a network error or the network connection times out?
A:
- Check th
