ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Translator

by Dmytro Voytko ST3

🌐 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

Support Ukraine Downloads Maintenance

Translator Plugin (Google, Bing) for SublimeText ¾

Stand With Ukraine

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 to google, and check the result; then let me know how it went by leaving a comment in the relevant GitHub issue (https://github.com/dmytrovoytko/SublimeText-Translate/issues/). If the issue persists, switch back to bing.

[!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 like HTTP Error 429: Too Many Requests or 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

  1. Select some text in the editor (or place the cursor on a word).
  2. Run Translate selected text command:
  3. via Tools ➡️ Translator ➡️ Translate selected text
  4. via Command Palette, Ctrl+Shift+P (⌘Cmd+Shift+P in OSX) > Translate selected text
  5. via hotkey (disabled by default, see Key Bindings below)
  6. If you want translation to replace the original text, change results_mode to replace in settings.
  7. If you just want to see translation without changing your text, set show_popup to true in settings.
  8. To change the default target language, change target_language in settings.
  9. Additional commands:
  10. to translate just once into a different language (without changing your default target_language setting): select text, run Translate selected to..., then pick the language from the list
  11. you can translate clipboard via Tools ➡️ Translator ➡️ Translate clipboard
  12. you can clear translation cache via Tools ➡️ Translator ➡️ Clear translation cache
  13. Find supported languages via Tools ➡️ Translator ➡️ Print supported languages to console

Check readability

  1. Select some text in the editor.
  2. Run Analyze text command:
  3. via Tools ➡️ Translator ➡️ Analyze text
  4. via Command Palette, Ctrl+Shift+P (⌘Cmd+Shift+P in OSX) > Analyze text
  5. via hotkey (disabled by default, see Key Bindings below)
  6. 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!!: switch engine (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 increasing translate_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 / regex dependencies finish installing, then retry.
  • Wrong target language or empty output: confirm target_language is set, and source_language is 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

Made with ❤️ in Ukraine 🇺🇦 Dmytro Voytko https://github.com/dmytrovoytko/

📄 License

MIT

Credits