Ebook Translator:用 Calibre 翻译多格式双语对照电子书

延伸阅读

给这篇文章写一条留言

提示:带 * 标记的是必填项。您填写的邮箱地址将会被保密。首次留言将会在通过人工审核后显示。如果是提出问题,请务必提供尽可能多信息,这有助于他人更好地理解你所提出的问题。

小伙伴们写下了 299 条留言

  1. chatgpt api 测试的时候 无法解析返回的响应。原始数据: 这问题该怎么解决?

    • 存在同样的问题:无法解析返回的响应。原始数据:HTTP Error 403: Forbidden

  2. 碰到了bad escape的问题:
    [自动探测 > Chinese (Simplified)] 翻译 “Capital Wars: The Rise of Global Liquidity”
    InputFormatPlugin: EPUB Input running
    on D:\BOOK\Michael J. Howell\Capital Wars_ The Rise of Global Liq (2)\Capital Wars_ The Rise of Globa – Michael J. Howell.epub
    Found HTML cover OEBPS/html/Cover.xhtml
    Parsing all content…
    Merging user specified metadata…
    Detecting structure…
    Flattening CSS and remapping font sizes…
    Source base font size is 12.00000pt
    Removing fake margins…
    Cleaning up manifest…
    Trimming unused files from manifest…
    Trimming ‘OEBPS/navigation.xhtml’ from manifest
    Trimming ‘OEBPS/toc.ncx’ from manifest
    Trimming ‘OEBPS/css/sidebar.gif’ from manifest
    Creating EPUB Output…
    Translating ebook content … (this will take a while)

    | Input Path: D:\BOOK\Michael J. Howell\Capital Wars_ The Rise of Global Liq (2)\Capital Wars_ The Rise of Globa – Michael J. Howell.epub
    | Output Path: C:\Users\zghsy\AppData\Local\Temp\calibre_8iaonvc5\y5ch9bin.epub

    翻译已完成。
    Traceback (most recent call last):
    File “sre_parse.py”, line 1039, in parse_template
    KeyError: ‘\\D’

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “runpy.py”, line 196, in _run_module_as_main
    File “runpy.py”, line 86, in _run_code
    File “site.py”, line 83, in
    File “site.py”, line 78, in main
    File “site.py”, line 50, in run_entry_point
    File “calibre\utils\ipc\worker.py”, line 215, in main
    File “calibre\utils\ipc\worker.py”, line 150, in arbitrary_n
    File “calibre_plugins.ebook_translator.convertion”, line 94, in convert_book
    File “calibre\ebooks\conversion\plumber.py”, line 1281, in run
    File “calibre_plugins.ebook_translator.convertion”, line 88, in convert
    File “calibre_plugins.ebook_translator.element”, line 328, in add_translations
    File “calibre_plugins.ebook_translator.element”, line 118, in add_translation
    File “re.py”, line 209, in sub
    File “re.py”, line 326, in _subx
    File “re.py”, line 317, in _compile_repl
    File “sre_parse.py”, line 1042, in parse_template
    re.error: bad escape \D at position 119

  3. v2.0.1
    不理解,为什么它只是解释内容而不是翻译内容,我用的是默认的prompt

    原文:Head position
    译文:The position of the head refers to the orientation of the head in space relative to the rest of the body. The head can be in various positions depending on what the individual is doing or what their body needs. Common head positions include upright, tilted, rotated, flexed (chin towards chest), extended (chin lifted up), and turned (looking over the shoulder). Correct head posture is important for maintaining spinal alignment and reducing strain on the neck and back. A neutral head position is typically recommended, with the ears aligned over the shoulders and the chin level with the ground.

    • 这个问题类似 Issue #20,你可以尝试在设置中修改 ChatGPT 的提示词来调整 ChatGPT 的回复,比如:Translate the content only; do not provide explanations for terms or answer questions.(只翻译内容,不要解释名词或回答问题)

  4. 完成翻译导出文件时报错:

    calibre, version 6.20.0
    错误: 未处理的异常: KeyError:<calibre.utils.ipc.job.ParallelJob object at 0x000002AFA9A1A980>

    calibre 6.20 embedded-python: True
    Windows-10-10.0.19041-SP0 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.10.1
    Windows: (’10’, ‘10.0.19041’, ‘SP0’, ‘Multiprocessor Free’)
    Interface language: zh_CN
    Successfully initialized third party plugins: Ebook Translator (2, 0, 1) && Mass Search-Replace (1, 7, 3)
    Traceback (most recent call last):
    File “calibre\gui2\__init__.py”, line 721, in dispatch
    File “calibre_plugins.ebook_translator.components.worker”, line 55, in translate_done
    KeyError:

      • 我是批量翻译的,如果不报错,那就会正常保存到书库内,但是只要有http429,就会每个文件都翻译完毕保存后报错.还好有缓存

    • 我也遇到了完成翻译导出文件时报错的问题,使用的是2.02版本的插件:
      ==============================
      翻译已完成。
      Traceback (most recent call last):
      File “sre_parse.py”, line 1039, in parse_template
      KeyError: ‘\\m’

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
      File “runpy.py”, line 196, in _run_module_as_main
      File “runpy.py”, line 86, in _run_code
      File “site.py”, line 83, in
      File “site.py”, line 78, in main
      File “site.py”, line 50, in run_entry_point
      File “calibre\utils\ipc\worker.py”, line 215, in main
      File “calibre\utils\ipc\worker.py”, line 150, in arbitrary_n
      File “calibre_plugins.ebook_translator.convertion”, line 94, in convert_book
      File “calibre\ebooks\conversion\plumber.py”, line 1281, in run
      File “calibre_plugins.ebook_translator.convertion”, line 88, in convert
      File “calibre_plugins.ebook_translator.element”, line 328, in add_translations
      File “calibre_plugins.ebook_translator.element”, line 118, in add_translation
      File “re.py”, line 209, in sub
      File “re.py”, line 326, in _subx
      File “re.py”, line 317, in _compile_repl
      File “sre_parse.py”, line 1042, in parse_template
      re.error: bad escape \m at position 63

  5. 自定义翻译引擎能不能支持将多段原文作为一个数组请求,而返回的译文也是一个数组这种情况呢?火山翻译的API就是这样。或者为合并翻译功能添加一个子选项,如果API原生就支持一次翻译多段文字,就按这种方式构造请求?

  6. 在使用高级模式时,我有一个很有意思的想法:
    选择合并需要的段落来进行合并翻译,这样得到的翻译质量会更高.特别是DeepL,但是却不知道能不能保证格式段落和图片位置的正确.

  7. 嗨您好,我点击translate然后显示翻译失败,原因是fail to retrieve data from translate engine API, 请问这个该怎么办呢?

      • 是这个莫?

        calibre, version 5.44.0 (darwin, embedded-python: True)
        Translation Failed: 失敗: Failed to retreive data from translate engine API. Can not parse returned response. Raw data:

        Traceback (most recent call last):
        File “mechanize/_urllib2_fork.py”, line 1236, in do_open
        File “http/client.py”, line 1255, in request
        File “http/client.py”, line 1301, in _send_request
        File “http/client.py”, line 1250, in endheaders
        File “http/client.py”, line 1010, in _send_output
        File “http/client.py”, line 950, in send
        File “http/client.py”, line 1417, in connect
        File “http/client.py”, line 921, in connect
        File “socket.py”, line 808, in create_connection
        File “socket.py”, line 796, in create_connection
        socket.timeout: timed out

        During handling of the above exception, another exception occurred:

        Traceback (most recent call last):
        File “calibre_plugins.ebook_translator.engines.base”, line 143, in get_result
        self.br.open(request)
        File “mechanize/_mechanize.py”, line 257, in open
        File “mechanize/_mechanize.py”, line 287, in _mech_open
        File “mechanize/_opener.py”, line 193, in open
        File “mechanize/_urllib2_fork.py”, line 425, in _open
        File “mechanize/_urllib2_fork.py”, line 414, in _call_chain
        File “mechanize/_urllib2_fork.py”, line 1283, in https_open
        File “mechanize/_urllib2_fork.py”, line 1240, in do_open
        urllib.error.URLError:

        During handling of the above exception, another exception occurred:

        Traceback (most recent call last):
        File “calibre_plugins.ebook_translator.translation”, line 73, in _translate_text
        return self.translator.translate(text)
        File “calibre_plugins.ebook_translator.engines.google”, line 45, in translate
        return self.get_result(self.endpoint, data, headers)
        File “calibre_plugins.ebook_translator.engines.base”, line 155, in get_result
        raise Exception(
        Exception: Can not parse returned response. Raw data:

        • 从错误信息看是你的网络无法正常访问翻译引擎,可能需要在设置中填写并开启网络代理?

  8. 请问在使用chatgpt翻译的时候,经常翻译几段就弹出来“没有可用的api秘钥”,如何解决?

  9. 更新完之后,速度慢了,比1.3.8慢三倍.经过测试,三千个段落的书籍,原来一小时就可以完成,现在要三小时往上.
    还是回滚老版本了

    • 这是因为在之前的版本中,设置中的请求间隔没对 ChatGPT 生效。想要和之前的一样,可以前往插件的【设置 → 通用 → HTTP 请求】设置项,把“最大间隔”设为 0。

  10. v2.0.0 版本的chatgpt翻译不好用,翻译完一句话后总是会带上(Translated from {slang} to {tlang})

  11. 请问,如果用chatGPT合并翻译之前,先在提示词里告诉它不要吞掉分隔符({{id_11}}这类符号),它是否就能完美排版了呢?您能教我“ 不能删掉分隔符”具体要怎么表达才能让ChatGPT听懂?

    • 有一点奇怪的是,我用ChatGPT中译日时,合并翻译设定500字、来源语言自动检测、输出语言日语,翻译完的排班完全不会出错(我让它翻译了五百多条了,排版没乱)。而一旦来源语言设置简体中文,排版就会成为一坨一坨的。同样,以此类推,我发现只要来源或输出语言选择了简体中文或英语,排版都会乱(我只会中英日三门语言,所以只试了三种)。由此可见,排版和提示词不无关系吧。

      • 插件的 v2.0.0 版本优化了 ChatGPT 的提示词,请下载试用。

        另外,新版本插件还新增 ChatGPT 的 temperature 设置,OpenAI 默认是 1,你可以尝试调低这个数值以防止它吃掉 ID,我测试的时候发现改成 0.5 效果不错。

          • 新版本发布后通常留一天的时间让用户测试,没有严重问题才会添加 Calibre 插件列表中,因此之前你没能通过 Calibre 的插件管理功能升级。刚刚插件已经上传到了 Calibre 的插件列表中,等一个小时左右应该就可以升级到最新版本了。

      • 开了代理,还是不行。之前我用DeepL(Free)翻译的字符并不多,只英译中了一篇短篇小说,这也会被限制吗?

        • 我倒是可以,已经翻了接近两百本书了,虽然经常会断,换个节点又能继续用了

          • 破案了,只要把目标语言设置成英语(英式)或英语(美式)就不行。如果要翻译成英语的话,目标语言直接选英语就可以了