Translator
🌐 Translation plugin (multi-engine, fast, flexible) for SublimeText 3 & 4, Google translate & Bing translate, works without API keys, works in China as well
Details
Installs
- Total 16K
- Win 10K
- Mac 3K
- Linux 2K
| Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 1 | 2 | 0 | 4 | 1 | 4 | 0 | 2 | 2 | 1 | 1 | 6 | 0 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 0 | 2 | 6 | 2 | 2 | 1 | 0 | 0 | 1 | 2 | 0 | 0 | 1 | 3 | 0 | 4 | 2 | 2 | 0 | 1 | 1 | 3 | 3 | 4 | 0 | 1 |
| Mac | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 2 | 1 | 3 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
| Linux | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 1 | 7 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 6 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
Readme
- Source
- raw.githubusercontent.com
Translator Plugin (Google, Bing) for SublimeText ¾
Version: 3.6.0, [Google] & [Bing] translate, supported 194+ languages.
This plugin uses the public Google/Bing web endpoints, so no API key is needed and it works fast. These endpoints are unofficial and can break if Google/Bing change their URL schema or page markup.
This version includes Google & Bing translate, text readability analysis and statistics.
[!IMPORTANT]
An important difference was discovered in how Sublime Text 3 and 4 send requests to Google Translate. If you are using ST 4 and experiencing issues with Google translation, we likely have a solution. Please update the plugin, switch the engine tobing.[!IMPORTANT]
Please remember, both (unofficial) APIs have internal limitations, like text no longer than 1000 chars, or requests frequency. Don't overuse it, otherwise you easily get HttpError 4xx likeHTTP Error 429: Too Many Requestsor even temporary ban as they might treat you as a robot. If you get such errors take a pause, for an hour or more. See Troubleshooting.
🎯 Features:
- 194+ languages supported
- SublimeText 3 & 4 supported (4215 tested)
- Autodetect source language
- Ability to specify source & target languages in settings
- Ability to choose the target language in context menu
- Works without VPN/proxies in China (choose 'bingcn' engine)
- 3 work modes:
- replace selected text with translation,
- insert translation after it (default)
- to_buffer - translation goes to clipboard (without changing the text)
- Ability to show translation in popup without changing original text
- Ability to translate your clipboard / current word if no text selected
- In-memory translation cache, should help reduce the frequency of HTTP 429 errors
- Adjustable delay between batch API calls, should help reduce the frequency of HTTP 429 errors
- Ability to replace line breaks inside text while translating (with space, comma, etc), useful to translate .po files
- Ability to analyze text readability and statistics (including Automated Readability Index, Coleman-Liau Index) to improve your documentation or SEO texts.
🚀 How to Use
Translate
- Select some text in the editor (or place the cursor on a word).
- Run Translate selected text command:
- via
Tools ➡️ Translator ➡️ Translate selected text - via Command Palette, Ctrl+Shift+P (⌘Cmd+Shift+P in OSX) >
Translate selected text - via hotkey (disabled by default, see Key Bindings below)
- If you want translation to replace the original text, change results_mode to
replacein settings. - If you just want to see translation without changing your text, set show_popup to
truein settings. - To change the default target language, change target_language in settings.
- Additional commands:
- to translate just once into a different language (without changing your default
target_languagesetting): select text, runTranslate selected to..., then pick the language from the list - you can translate clipboard via
Tools ➡️ Translator ➡️ Translate clipboard - you can clear translation cache via
Tools ➡️ Translator ➡️ Clear translation cache - Find supported languages via
Tools ➡️ Translator ➡️ Print supported languages to console
Check readability
- Select some text in the editor.
- Run Analyze text command:
- via
Tools ➡️ Translator ➡️ Analyze text - via Command Palette, Ctrl+Shift+P (⌘Cmd+Shift+P in OSX) >
Analyze text - via hotkey (disabled by default, see Key Bindings below)
- To clear highlights, use
Tools ➡️ Translator ➡️ Clear Analysis highlights.
Key Bindings (optional)
No hotkeys are enabled by default. To enable them, go to Preferences ➡️ Package Settings ➡️ Translator ➡️ Key Bindings and remove // or add, for example:
[
{"keys": ["ctrl+alt+g"], "command": "translator"},
{"keys": ["ctrl+shift+alt+g"], "command": "translator_to"},
{"keys": ["ctrl+alt+b"], "command": "translator_from_buffer"},
{"keys": ["ctrl+alt+a"], "command": "translator_text_analysis"}
]
🛠️ Commands
- Translate selected text - translates selected text based on your settings
- Translate selected to… - you choose the target language before translation
- Translate clipboard - translates text of your clipboard based on your settings
- Translator: Print supported languages to console - to see available languages for changing translation settings
- Analyze text - to see text statistics, readability checks and highlights
- Clear Analysis highlights - to clear text analysis highlights
Installation
Via Package Control (recommended)
- If you don't have Package Control, follow this instruction
- Open the Command Palette (Tools ➡️ Command Palette… )
- Search for and choose “Package Control: Install Package” (give it a few seconds to return a list of available packages)
- Search for “Translator” and install.
🧰 Settings
via Preferences ➡️ Package settings ➡️ Translator ➡️ Settings
{
"engine": "google", // "google", "bing", 'bingcn' for cn.bing.com, 'googlehk' for google.com.hk
"source_language": "", // Leave empty for Auto detection
"target_language": "en", // ! Must be specified
"results_mode": "insert", // "insert", "replace" or "to_buffer"
"show_popup": false, // false or true
"translation_cache": true, // false or true, if not set default = true
"translation_cache_size": 200,// if not set default = 200
"translate_batch_delay": 0.5, // seconds between API calls, 0 disables
"replace_linebreaks": false, // false or true
"linebreak_replacement": " ", // could be a space, comma, semicolon, etc
"analysis_language": "en" // Text Analysis: "en", "uk" (other values fall back to "en")
}
Troubleshooting
!!Google translate error!!/!!Bing translate error!!: switchengine(google<->bing), shorten the text (limit is ~1000 chars), and check console (View ➡️ Show Console).HTTP Error 429/ temporary ban / captcha: pause for an hour or more, then retry with fewer requests. Also opening https://translate.google.com / https://www.bing.com/translator (after a pause) may help (check captcha) - to show you're not a robot. If multi-select translates hit 429, experiment with increasingtranslate_batch_delay(e.g.1.0).- Bing
Max retries exceeded/ session errors: the plugin reuses one session per engine setup (captcha refreshes it automatically); if Bing hard-blocks you, switch engine or pause before retrying. - Just installed and nothing works: restart Sublime Text so
requests/regexdependencies finish installing, then retry. - Wrong target language or empty output: confirm
target_languageis set, andsource_languageis empty for auto-detect. - Copy diagnostics to report your issue via
Tools ➡️ Translator ➡️ Copy diagnostics for issue reports.
📦️ Plugin repository at GitHub
Translation plugin (multi-engine, fast) for SublimeText 3 & 4
Feedback
- Something broken? Report it here: https://github.com/dmytrovoytko/SublimeText-Translate/issues/new?template=bug_report.md (please paste your engine, Sublime build, and console excerpt)
- Have an idea? Propose it here: https://github.com/dmytrovoytko/SublimeText-Translate/issues/new?template=feature_request.md
- Like the plugin? ⭐️Star⭐️ my repo: https://github.com/dmytrovoytko/SublimeText-Translate to help other people discover it 🙏
Made with ❤️ in Ukraine 🇺🇦 Dmytro Voytko https://github.com/dmytrovoytko/
📄 License
MIT
Credits
- Inspired by old Inline Google Translate package (by MTMGroup) stopped working as Google changed API.
- Used Bing translate API approach, 谢谢!
- Used Sentence-splitter for text analysis