windingwind / zotero-pdf-translate

Translate PDF, EPub, webpage, metadata, annotations, notes to the target language. Support 20+ translate services.
GNU Affero General Public License v3.0
7.67k stars 359 forks source link

[Bug] 百度翻译不出 #916

Closed yichenjiong closed 3 months ago

yichenjiong commented 3 months ago

Is there an existing issue for this?

Have you checked the FAQ (https://github.com/windingwind/zotero-pdf-translate/issues/6)?

Are you using the latest Zotero and the latest plugin?

Environment

Describe the bug

百度通用翻译api 用着用着不能用了 设置如下 image 报错如下 image

Debug Output

1723800264715 addons.xpi WARN Checking /opt/zotero/Zotero_linux-x86_64/distribution/extensions for addons

1723800265856 addons.xpi WARN Addon with ID undefined already installed, older version will be disabled

[JavaScript Error: "Error: Addon must include an id, version, and type" {file: "resource://gre/modules/addons/XPIProvider.jsm" line: 1723}]

[JavaScript Error: "Error: Addon must include an id, version, and type" {file: "resource://gre/modules/addons/XPIProvider.jsm" line: 1723}]

[JavaScript Error: "original is undefined" {file: "jar:file:///home/cw/.zotero/zotero/syqwnerf.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/zoteropdftranslate.js" line: 5219}]

[JavaScript Error: "original is undefined" {file: "jar:file:///home/cw/.zotero/zotero/syqwnerf.default/extensions/zoteropdftranslate@euclpts.com.xpi!/chrome/content/scripts/zoteropdftranslate.js" line: 5219}]

appName => Zotero, version => 7.0.1 (x64), os => Linux 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024, locale => zh-CN, extensions => Translate for Zotero (2.0.0, extension)

(3)(+0004783): [Translate for Zotero] runTranslationTask {}

(3)(+0000002): [Translate for Zotero] try itemLanguage

(3)(+0000002): [Translate for Zotero] try inferredLanguage et

(3)(+0000000): [Translate for Zotero] use autoDetect et

(3)(+0000004): [Translate for Zotero] try auto detect language

(3)(+0000000): [Translate for Zotero] try itemLanguage

(3)(+0000001): [Translate for Zotero] try inferredLanguage et

(3)(+0000000): [Translate for Zotero] use autoDetect et

(3)(+0000001): [Translate for Zotero] {"id":"i22OUZIY-1723800469008","type":"text","raw":"The transmitter accepts packet-oriented data, packages the data in accordance with the IEEE 802.3 Specification,","result":"","audio":[],"service":"baidu","candidateServices":[],"itemId":1,"status":"processing","extraTasks":[],"langfrom":"et","langto":"zh","callerID":"zoteropdftranslate@euclpts.com","secret":"20240815002124399#aU8lqDr1ukqrJWAOwzuP"}

(3)(+0000000): HTTP GET http://api.fanyi.baidu.com/api/trans/vip/translate?q=The%20transmitter%20accepts%20packet-oriented%20data%2C%20packages%20the%20data%20in%20accordance%20with%20the%20IEEE%20802.3%20Specification%2C&appid=20240815002124399&from=et&to=zh&salt=1723800469022&sign=c3c8fd39087f26c97db4c66523df9c12&action=0

(3)(+0000471): HTTP GET http://api.fanyi.baidu.com/api/trans/vip/translate?q=The%20transmitter%20accepts%20packet-oriented%20data%2C%20packages%20the%20data%20in%20accordance%20with%20the%20IEEE%20802.3%20Specification%2C&appid=20240815002124399&from=et&to=zh&salt=1723800469022&sign=c3c8fd39087f26c97db4c66523df9c12&action=0 succeeded with 200

(3)(+0000015): [Translate for Zotero] try itemLanguage

(3)(+0000003): [Translate for Zotero] try inferredLanguage et

(3)(+0000000): [Translate for Zotero] use autoDetect et

(3)(+0002027): Writing reader state to /home/cw/Zotero/storage/CP3ITF6N/.zotero-reader-state

Anything else?

No response

windingwind commented 3 months ago

https://fanyi-api.baidu.com/product/113

58001 | 译文语言方向不支持 | 检查译文语言是否在语言列表里

yichenjiong commented 3 months ago

好像是langfrom 那边不在表里,纯英文的pdf就是en 另一个pdf就会报这个错,langfrom是ay...

windingwind commented 3 months ago

需正确设置条目language属性,若空则默认从标题/摘要推断。自动推断有误判可能性