Skip to content

Fix deepl translate problem #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Anemone95
Copy link

Fix the issue described in #1194

@windingwind
Copy link
Owner

请确认是不是你选择了无效的源语言。未见官方文档中去除了source_lang。
https://developers.deepl.com/docs/api-reference/translate

@Anemone95
Copy link
Author

Anemone95 commented Jun 3, 2025

还真是,但为什么在我issue里,插件说语言是GL?你能告诉我这个生成GL是哪的代码吗?我可以调试看下

@windingwind
Copy link
Owner

如果language字段为空,默认从标题/摘要推断。推断的不一定准确

@windingwind
Copy link
Owner

@Anemone95
Copy link
Author

如果language字段为空,默认从标题/摘要推断。推断的不一定准确

为何不从需要翻译的text推断?

@windingwind
Copy link
Owner

一篇文章的语言是前后一致的,可以推断一次即缓存;
从内容推断更容易出问题,例如一些中文外文混杂的内容。

总的来说,是语言推断的库稳定性不足。可以考虑搜索一下是否有更可靠的库,或允许用户预设一些可用语言,排除可用语言之外的推断结果,避免因为一些专业词汇导致被推断成小语种

@Anemone95
Copy link
Author

不是的,当文件类型是attachment时,拿到推断的文本是文件名,这样再可靠的库也没机会推断出来的。
所以除非有办法可以直接获取文章的标题,否则建议在这种情况下从内容推断,即我的commit?

@windingwind
Copy link
Owner

一般不考虑无上级条目的纯附件条目,这不是推荐的zotero使用方法。若topItem不为regular item,也许直接停止推断语言较合适。

@Anemone95
Copy link
Author

如果不打算支持,停止推测并给用户提示不支持,或者使用一个默认语言比较好?

@windingwind
Copy link
Owner

使用默认语言即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants