v6ok / Ebook-Translator-Calibre-Plugin

A Calibre plugin to translate ebook into a specified language.

Home Page:https://bookfere.com/post/1057.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ebook Translator (A Calibre plugin)

A Calibre plugin to translate ebook into a specified language (optionally keeping the original content).


Features

  • Support languages supported by the selected translation engine (e.g. Google Translate supports 134 languages)
  • Support multiple translation engines, including Google Translate, ChatGPT, and DeepL
  • Support all ebook formats supported by Calibre (48 input formats, 20 output formats)
  • Support to translate more than one ebooks. The translation process of each book is carried out simultaneously without affecting one another
  • Support caching translated content, with no need to re-translate after request failure or network interruption
  • Provide a large number of customization settings, such as saving translated ebooks to Calibre library or designated location

Installation

Please make sure Calibre is installed on your OS, and follow steps below:

  1. Download the plugin zip file from releases page.
  2. Click Calibre Menu [Preference... → Plug-ins → Load plug-in from file], and choose the zip file you got.
  3. Reboot Calibre (if the "Translate Book" plugin is not showing up on Calibre menu, you need to add it from [Preference... → Toolbars & menus], choose [The main toolbar], find the plugin and click [>], and [Apply]).

Usage

  1. Select the ebook(s), and click the plugin icon "Translate Book".
  2. Select the Target Language (and Output Format if needed).
  3. Click [TRANSLATE] button.

After that, you can check the translation process by clicking "Jobs" at the bottom right. Double clicking the job item, you can check the real-time translation log from the window it prompts.


Settings

You can customize the plugin through "Content" and "Setting" panels.

Content

[ Translation Position ]

  • Add after original [default]: Add the translation text after original text
  • Add before original: Add the translation text before original text
  • Add without original: Add the translation text and delete original text

[ Translation Color ]

  • Color Value: CSS color value, e.g., #666666, grey, rgb(80, 80, 80)

You can click the [Select] button to select a color from color palette, or enter the color value manually. Please refer to "color value" on MDN documentation for details. If left blank no customized color will be used.

[ Do not Translate ]

  • Normal [default]: Exclude content by keyword (one keyword per line)
  • Normal(case-sensitive): Exclude content by case-sensitive keyword (one keyword per line)
  • Regular Expression: Exclude content by Regular Expression rule (one rule per line)

For regular expression syntax, please refer to "Regular Expression Syntax" on Python documentation.

Setting

[ Output Path ]

  • Library [default]: After the ebook is translated, it will be placed in Calibre library
  • Path: After the ebook is translated, it will be stored in specified directory

[ Translation Engine ]

  • Google [default]: Free translation engine
  • ChatGPT: API key required
  • DeepL: API key required
  • DeepL(Pro): API key required
  • Youdao: APP key and secret required
  • Baidu: APP id and key required

Except for Google, who does not require an API key, other translation engines require you to register a corresponding account and pay to obtain an API key.

According to the response information sample provided by DeepL official website, the program can run properly, but due to the lack of DeepL's API key, the actual operation status is unknown.

If you opt for a paid translation engine, we recommend you to refer to its official documentation for pricing rules. For example, ChatGPT uses its official tool, Tokenizer, to estimate the number of tokens required to translate a given amount of text in order to provide a cost estimate.

[ ChatGPT Prompt ]

  • For auto detecting source language: Customize ChatGPT prompt to translate from 'Auto detect' source language
  • For specifying source language: Customize ChatGPT prompt to translate from specified source language

[ Network Proxy ]

  • Enable [default unchecked]: Enable network proxy
  • Host: Support IP and domain name
  • Port: Range 0-65536
  • Test: Test the connectivity of proxy

[ Cache ]

  • Enable [default checked]: Enable to cache translated content
  • Clear: Delete all caches

Enabling the caching function can avoid re-translation of translated content after request failure or network interruption. You can also check the amount of disk space occupied by the cache here, and click [Clear] button to delete all caches. Note that if a translation job is currently in progress, the [Clear] button will be disabled to use.

[ Request ]

  • Attempt Times [default 3]: The number of times to attempt if failed to request translation engine
  • Maximum Interval [default 5 seconds]: The maximum time interval to request translation engine

A single request to translation engine can last up to 300 seconds. After the timeout, it will retry according to the specified attempt times, and the waiting time for each retry will be gradually increased. The request interval will be a random number between 1 and the specified maximum interval.

When using Google Translate API, which is currently available for free, we recommend you to increase the "Maximum Interval" to an appropriate value (more than 5 seconds is recommended) to prevent it from being flagged as abusive behavior, which could lead to translation interruptions or denial of service. For paid translation engines, the "Maximum Interval" can be set to 1.

[ Log ]

  • Display translation [Default checked]: The translation content will be displayed in real time from the respective log window of the translation job

License

GNU General Public License v3.0


About

A Calibre plugin to translate ebook into a specified language.

https://bookfere.com/post/1057.html


Languages

Language:Python 100.0%