{"id":13468320,"url":"https://github.com/windingwind/zotero-pdf-translate","last_synced_at":"2025-05-12T13:23:41.631Z","repository":{"id":37299007,"uuid":"467844167","full_name":"windingwind/zotero-pdf-translate","owner":"windingwind","description":"Translate PDF, EPub, webpage, metadata, annotations, notes to the target language. Support 20+ translate services.","archived":false,"fork":false,"pushed_at":"2025-05-10T12:38:59.000Z","size":5853,"stargazers_count":8723,"open_issues_count":13,"forks_count":400,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-05-10T13:27:32.454Z","etag":null,"topics":["pdf","plugin","translate","translation","zotero","zotero-plugin","zotero7"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windingwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["windingwind"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://paypal.me/windingwind"]}},"created_at":"2022-03-09T08:42:33.000Z","updated_at":"2025-05-10T13:13:35.000Z","dependencies_parsed_at":"2022-07-14T09:22:33.555Z","dependency_job_id":"aebe6fcd-ff15-4794-b869-c48f5f568e15","html_url":"https://github.com/windingwind/zotero-pdf-translate","commit_stats":null,"previous_names":[],"tags_count":260,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windingwind%2Fzotero-pdf-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windingwind%2Fzotero-pdf-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windingwind%2Fzotero-pdf-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windingwind%2Fzotero-pdf-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windingwind","download_url":"https://codeload.github.com/windingwind/zotero-pdf-translate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745522,"owners_count":21957389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pdf","plugin","translate","translation","zotero","zotero-plugin","zotero7"],"created_at":"2024-07-31T15:01:08.718Z","updated_at":"2025-05-12T13:23:41.605Z","avatar_url":"https://github.com/windingwind.png","language":"TypeScript","funding_links":["https://github.com/sponsors/windingwind","https://paypal.me/windingwind"],"categories":["TypeScript","Extensions","⚙️ 科研工具","🛠️ 一、工具类项目"],"sub_categories":["Translations","Skill","📄 1.2 PDF 处理工具"],"readme":"# ![Translate for Zotero](addon/chrome/content/icons/favicon.png)Translate for Zotero\n\n[![zotero target version](https://img.shields.io/badge/Zotero-7-green?style=flat-square\u0026logo=zotero\u0026logoColor=CC2936)](https://www.zotero.org)\n[![Using Zotero Plugin Template](https://img.shields.io/badge/Using-Zotero%20Plugin%20Template-blue?style=flat-square\u0026logo=github)](https://github.com/windingwind/zotero-plugin-template)\n\n_Translate for Zotero_, a.k.a. _Zotero PDF Translate_, is a [Zotero](https://www.zotero.org/) plugin.  \nTranslate PDF, EPub, webpage, metadata, annotations, notes to the target language. Support 20+ translate services.\n\n[中文文档](https://zotero.yuque.com/books/share/4443494c-c698-4e08-9d1e-ed253390346d)\n\n![](docs/res/translate.gif)\n\n# Quick Start Guide\n\n## Install\n\n- Download the plugin (.xpi file) from below.\n\n  - [Latest Stable](https://github.com/windingwind/zotero-pdf-translate/releases/latest)\n  - [All Releases](https://github.com/windingwind/zotero-pdf-translate/releases)\n\n  _Note_ If you're using Firefox as your browser, right-click the `.xpi` and select \"Save As..\"\n\n- In Zotero click `Tools` in the top menu bar and then click `Plugins`\n- Go to the Extensions page and then click the gear icon in the top right.\n- Select `Install Plugin from file`.\n- Browse to where you downloaded the `.xpi` file and select it.\n- Finish!\n\n## Usage\n\nOpen any PDF/EPub/webpage in the Zotero reader.\n\n- Select text, the translations are shown on the pop-up and the item pane(v0.2.0).\n  ![](docs/res/en2zh.jpg)\n\n- Highlight/Underline some text, the translations are added to the annotation comment(v0.3.0); Modify \u0026 retranslate the annotation text in the item pane and click the `Update Annotation` to modify the annotation text and translation(v0.6.6);\n- Add selected text along with translation to note(v0.4.0); _Only works when a note editor is active._\n  ![](docs/res/addtonote.jpg)\n\n- Translate item titles with right-click menu or shortcut `Ctrl+T`(v0.6.0).\n- Translate item abstract with right-click menu(v0.8.0). Thanks @iShareStuff\n- Standalone translation window available(v0.7.0). View \u0026 compare translations from multiply services in one window!\n  ![](docs/res/standalone.jpg)\n\n- Dictionary for single word translation(v0.7.1).\n- SentenceBySentence Translation(v1.1.0). After a translation, press `shift`+`P` and select `Translate Sentences`. _Only for en2zh and en2en now_. Thanks @MuiseDestiny\n- Since v2.2.0, the concat mode shortcut is ctrl (on Windows/Linux) or ⌘ (on macOS).\n\n### Q\u0026A\n\n**Q** I want to translate manually.  \n**A** Go to `Edit-\u003eSettings-\u003eTranslate-\u003eGeneral`, uncheck the `Automatically Translate Selection`. Click the `Translate` button on the pop-up or item pane to translate.\n\n**Q** I want a translate shortcut.  \n**A**\nPress shortcut `Ctrl+T` after you selected some text. If you are in the collection view, the titles' translation will show/hide.\n\n**Q** I want to concat different selections and translate them together.  \n**A** Press `Ctrl/⌘` or select the `Concat Mode` check box on item pane when selecting text in PDF/EPub/webpage.\n\n**Q** Not the language I want.  \n**A** The default target language is the same as your Zotero language. Go to `Edit-\u003eSettings-\u003eTranslate-\u003eService` and change the language settings.\n\n**Q** Translation not correct or report an error.  \n**A** See _Language Settings_ above and FAQ([#6](https://github.com/windingwind/zotero-pdf-translate/issues/6)). Make sure you use the right secret.\n\n**Q** I want to change the font size.  \n**A** Go to `Edit-\u003eSettings-\u003eTranslate-\u003eUser Interface` and set the font size.\n\n## Settings\n\n### General\n\n\u003c!-- - Enable Translation, default `true` --\u003e\n\n- Automatically Translate Selection, default `true`\n- Automatically Translate Annotation: Save annotation's translation to annotation comment or annotation body, default `false`\n- Enable Reader Selection Pop-up: Show results in the pop-up panel or only in the item pane, default `true`\n- Show \"Add Translation to Note\" in Pop-up: default `true`\n  \u003e Invisible if no active note editor opened.\n  - Replace Raw: Use translation to replace the raw text when adding to note, default `false`\n- Enable Dictionary: Single word will be translated using dictionary service instead of translate service, default `true`\n  - Show Play Buttons: Show the word pronunciation play buttons if available, default `true`\n  - Auto-play Pronunciation, default `false`\n\n### Service\n\nThe default service is Google Translate. Currently, we support:\n\n| Translate Service            | Require Secret         | Supported Languages                                                                                                                                                                                                                                                |\n| ---------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| Google Translate             | No                     | [100+](https://translate.google.com/about/languages/)                                                                                                                                                                                                              |\n| Google Translate(API)        | No                     | Use `translate.googleapis.com`                                                                                                                                                                                                                                     |\n| CNKI                         | No                     | \u003chttps://dict.cnki.net\u003e                                                                                                                                                                                                                                            |\n| Haici Translate              | No                     | \u003chttps://fanyi.dict.cn\u003e                                                                                                                                                                                                                                            |\n| Youdao Translate             | No                     | [100+?](https://ai.youdao.com/DOCSIRMA/html/%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E7%BF%BB%E8%AF%91/API%E6%96%87%E6%A1%A3/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1-API%E6%96%87%E6%A1%A3.html) |\n| Bing                         | No                     | en-zh                                                                                                                                                                                                                                                              |\n| Huoshan                      | Yes                    | [50+](https://www.volcengine.com/docs/4640/127681)                                                                                                                                                                                                                 |\n| Youdao Zhiyun                | Yes                    | [100+](https://ai.youdao.com/DOCSIRMA/html/%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E7%BF%BB%E8%AF%91/API%E6%96%87%E6%A1%A3/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1-API%E6%96%87%E6%A1%A3.html)  |\n| Niu Trans                    | Yes                    | [400+](https://niutrans.com/documents/contents/trans_text#accessMode)                                                                                                                                                                                              |\n| Microsoft Translate          | Yes(free 2M)           | [200+](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/language-support)                                                                                                                                                                      |\n| LingoCloud(Caiyun) Translate | Yes                    | [zh, en, ja, es, fr, ru](https://open.caiyunapp.com/LingoCloud_API_in_5_minutes)                                                                                                                                                                                   |\n| DeepL Translate              | Yes(free 500k)         | [100+](https://www.deepl.com/pro?cta=header-prices/#developer)                                                                                                                                                                                                     |\n| Aliyun Translate             | Yes(free-1M)           | [200+](https://help.aliyun.com/document_detail/158269.html)                                                                                                                                                                                                        |\n| Baidu Translate              | Yes(free-QPS1/free-2M) | [200+](https://fanyi-api.baidu.com/product/11)                                                                                                                                                                                                                     |\n| Baidu Field                  | Yes(free-QPS1/free-2M) | [en-zh](https://fanyi-api.baidu.com/product/12)                                                                                                                                                                                                                    |\n| OpenL                        | Yes                    | [11](https://docs.openl.club/#/API/format)                                                                                                                                                                                                                         |\n| Tencent Translate            | Yes(QPS5, free-5M)     | [15](https://cloud.tencent.com/document/product/551/7372)                                                                                                                                                                                                          |\n| Xftrans                      | Yes                    | [70+](https://www.xfyun.cn/doc/nlp/xftrans/API.html)                                                                                                                                                                                                               |\n| GPT(OpenAI)                  | Yes(free-$18)          | [LLM-based](https://openai.com/pricing#chat)                                                                                                                                                                                                                       |\n| Gemini                       | Yes(free-)             | [LLM-based](https://ai.google.dev/available_regions#available_languages)                                                                                                                                                                                           |\n| Qwen-MT                      | Yes(free-)             | [LLM-based](https://help.aliyun.com/zh/model-studio/user-guide/machine-translation)                                                                                                                                                                                |\n| Claude                       | Yes                    | [LLM-based](https://docs.anthropic.com/claude/docs/getting-started-with-the-claude-api)                                                                                                                                                                            |\n\n\u003e If the service you want is not yet supported, please post an issue.\n\n**Google**  \nGoogle does not require a secret, but you can put your own API URL in the secret to replace the default URL (translate.google.com/translate.googleapi.com).\n\n**Huoshan**  \nApply [here](https://www.volcengine.com/docs/4640/65067).  \nThe secret format is `accessKeyId#accessKeySecret`\n\n**Youdao Zhiyun Translate 有道智云**  \nApply [here](https://ai.youdao.com/login.s).  \nThe secret format is `MY_APPID#MY_SECRET#MY_VOCABID(optional)`.\n\n\u003e About `VOCABID`  \n\u003e 登录控制台，选择文本翻译服务，点击右侧的术语表，选择新建，填写表名称和语言方向，添加需要的术语表，然后获取对应词表 id 即可。\n\u003e\n\u003e [Official Document](https://ai.youdao.com/DOCSIRMA/html/%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E7%BF%BB%E8%AF%91/API%E6%96%87%E6%A1%A3/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1-API%E6%96%87%E6%A1%A3.html)\n\n**NiuTrans**  \nApply [here](https://niutrans.com/NiuTransAuthCenter/login).  \nThe secret format is `MY_APIKEY#dictNo(optional)#memoryNo(optional)`.\n\n\u003e [Chinese Document](https://doc.tern.1c7.me/zh/folder/setting/#%E5%B0%8F%E7%89%9B)\n\n**Microsoft Translate**  \nApply [here](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/quickstart-translator?tabs=csharp). Copy your secret and paste it into the settings.  \nThe secret format is `MY_SECRET`.\n\n\u003e See [this issue](https://github.com/windingwind/zotero-pdf-translate/issues/3#issuecomment-1064688597) for detailed steps to set up the Microsoft Translate.\n\n**LingoCloud(Caiyun) Translate**  \nApply [here](https://open.caiyunapp.com/%E4%BA%94%E5%88%86%E9%92%9F%E5%AD%A6%E4%BC%9A%E5%BD%A9%E4%BA%91%E5%B0%8F%E8%AF%91_API).\n\n**DeepL Translate**  \nApply [here](https://www.deepl.com/pro?cta=header-prices/#developer).  \nThe secret format is `secretToken` or `secretToken#glossaryId` (if you want to specify some translate glossary).\n\n**Aliyun Translate**  \nApply [here](https://www.aliyun.com/product/ai/base_alimt).  \nThe secret format is `accessKeyId#accessKeySecret#endpoint(optional)`.\n\n\u003e The endpoint is the region of the service, default `https://mt.aliyuncs.com`. For `cn-hangzhou`, the endpoint is `mt.cn-hangzhou.aliyuncs.com`. See also [here](https://help.aliyun.com/zh/machine-translation/developer-reference/api-alimt-2018-10-12-endpoint?spm=a2c4g.11186623.help-menu-30396.d_4_1_0.6c702fa7WlNkX1).\n\n\u003e [Chinese Document](https://help.aliyun.com/document_detail/158269.html)\n\n**Baidu Translate**  \nApply [here](https://fanyi-api.baidu.com/product/11).  \nThe secret format is `MY_APPID#MY_KEY#ACTION(optional, see https://api.fanyi.baidu.com/doc/21, default 0)`(split with '#').\n\n**Baidu Field Translate 百度垂直领域翻译**  \nApply [here](https://fanyi-api.baidu.com/product/12).  \nThe secret format is `MY_APPID#MY_KEY#DOMAIN_CODE`(split with '#').\n\n| Domain Code | 领域         | 支持语言方向                          |\n| ----------- | ------------ | ------------------------------------- |\n| it          | 信息技术领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| finance     | 金融财经领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| machinery   | 机械制造领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| senimed     | 生物医药领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| novel       | 网络文学领域 | 中文（简）-\u003e 英语                     |\n| academic    | 学术论文领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| aerospace   | 航空航天领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| wiki        | 人文社科领域 | 中文（简）-\u003e 英语                     |\n| news        | 新闻资讯领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| law         | 法律法规领域 | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n| contract    | 合同领域     | 中文（简）-\u003e 英语、英语 -\u003e 中文（简） |\n\n\u003e [Chinese Document](https://doc.tern.1c7.me/zh/folder/setting/#%E8%85%BE%E8%AE%AF%E4%BA%91)\n\n**OpenL Translate**  \nApply [here](https://my.openl.club/).  \nThe secret format is `service1,service2,...#apikey`(split with '#'; split service codes with ',').\n\nSupported service codes are: `deepl,youdao,tencent,aliyun,baidu,caiyun,wechat,sogou,azure,ibm,aws,google`, See [Service Code](https://docs.openl.club/#/API/format?id=%e7%bf%bb%e8%af%91%e6%9c%8d%e5%8a%a1%e4%bb%a3%e7%a0%81%e5%90%8d)\n\n\u003e [Chinese Document](https://docs.openl.club/#/)\n\n**Tencent Translate**  \nApply [here](https://cloud.tencent.com/product/tmt).  \nThe secret format is `secretId#SecretKey#Region(optional, default ap-shanghai)#ProjectId(optional, default 0)`(split with '#').\n\n\u003e [Chinese Document](https://doc.tern.1c7.me/zh/folder/setting/#%E8%85%BE%E8%AE%AF%E4%BA%91)\n\n**Xftrans**  \nApply [here](https://www.xfyun.cn/doc/authentication/personal.html#%E6%93%8D%E4%BD%9C%E6%AD%A5%E9%AA%A4).\n\n**GPT**  \nApply [here](https://platform.openai.com/signup).  \nThe secret format is `sk-#SecretKey`(split with '#').\n\nSupport third-party compatible APIs.\n\n\u003e [Chinese Document](https://gist.github.com/GrayXu/f1b72353b4b0493d51d47f0f7498b67b)\n\n**Gemini**  \nApply [here](https://ai.google.dev/gemini-api/docs).  \nThe secret format is `MY_APIKEY`.\n\n**Qwen-MT**  \nApply [here](https://help.aliyun.com/zh/model-studio/user-guide/machine-translation).  \nThe secret format is `MY_APIKEY`.\n\n**Claude**  \nApply [here](https://docs.anthropic.com/claude/docs/getting-started-with-the-claude-api).\n\n### User Interface\n\n- `Font Size`: The font size of result text, default `12`\n- `Line Height`: The line height of result text, default `1.5`\n- `Item Context Menu: Show xxx`: Show or hide Title/Abstract tanslation, default `true`\n- `Item Context Menu: Show xxx`: Show or hide Title/Abstract tanslation, default `true`\n- `Item Pane Section: Hold down Ctrl/⌘`: Press key to enable concat mode when selecting text in PDF/EPub/webpage if `true`, default `true`\n- `Item Pane Section: Reverse Raw/Result`: Reverse the order of Raw/Result in the item pane if `true`, default `false`\n- `Item Pane Info: Show xxx`: Show or hide Title/Abstract tanslation in the item info rows\n- `Standalone: Keep Windows on Top`: Top the standalone translate panel if `true`, default `false`\n- `Pop-up: Remember Size`: Remember size of pop-up if `true`, else automatically adjust the size, default `false`\n\n### Advanced\n\n- Automatically Detect Item Language\n  - Disable Automatic Translation when File Language is(comma-separated): If you want to disable automatic translation in `zh` and `ja` files, set `zh,ja`.\n- Delimiter (between text and translation): When translating annotations, the result will be wrapped inside this character to allow safe re-translate. If set to empty, re-translating annotations will replace the annotation comment with the new translate result.\n\n## Development \u0026 Contributing\n\nThis plugin is built based on the [Zotero Plugin Template](https://github.com/windingwind/zotero-plugin-template). See the setup and debug details there.\n\nTo startup, run\n\n```bash\ngit clone https://github.com/windingwind/zotero-pdf-translate.git\ncd zotero-pdf-translate\nnpm install\nnpm run build\n```\n\nThe plugin is built to `./build/*.xpi`.\n\n### Contributing\n\n**Add new translate service**\n\n1. Add service config to `src/utils/config.ts` \u003e `SERVICES`;\n2. Add translation task processor under `src/modules/services/${serviceId}.ts` with the same format with other services. The export function set the translation result to `data.result` if runs successfully and throw an error if fails;\n3. Import the task processor function in `src/modules/services/index.ts`.\n4. Add locale string `service.${serviceId}` in `addon/chrome/locale/${lang}/addon.properties`.\n5. Build and test.\n\n**Extra options for translate service**\n\nIf the service requires extra options, the minimal implement would be putting them in the `secret` input in the prefs window, like the existing services does.\n\nIf there are complex options, please bind a callback in `src/modules/settings/index.ts \u003e secretStatusButtonData` which create a highly customizable dialog window with `ztoolkit.Dialog`. See the example of NiuTrans login here: \u003chttps://github.com/windingwind/zotero-pdf-translate/blob/main/src/modules/settings/niutrans.ts\u003e\n\n## Disclaimer\n\nUse this code under AGPL. No warranties are provided. Keep the laws of your locality in mind!\n\n## My Other Zotero Addons\n\n- [Better Notes](https://github.com/windingwind/zotero-better-notes): Everything about note management. All in Zotero.\n- [Actions \u0026 Tags](https://github.com/windingwind/zotero-tag): Automatically tag items/Batch tagging\n\n## Sponsors\n\nThanks\n[peachgirl100](https://github.com/peachgirl100)\nand other anonymous sponsors!\n\nIf you want to leave your name here, please email me or leave a message with the donation.\n\n## Contributors\n\n\u003ca href=\"https://github.com/windingwind/zotero-pdf-translate/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=windingwind/zotero-pdf-translate\" /\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindingwind%2Fzotero-pdf-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindingwind%2Fzotero-pdf-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindingwind%2Fzotero-pdf-translate/lists"}