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
6.06k stars 301 forks source link

正则表达,避免人名及年份翻译 #764

Closed Sinoftj closed 5 days ago

Sinoftj commented 1 month ago

Is there an existing issue for this?

Environment

Describe the feature request

Is your feature request related to a problem? Please describe. 在进行翻译的时候,虽然可以设置不翻译中文,但是这可能不够,因为它还是会翻译作者和年份。就像截图中展示的一样。

Why do you need this feature? 我想这可能会带来2个问题,一是让注释看起来很混乱,二是翻译成中文,反而可能不知道作者是谁了。

截屏2024-03-27 10 01 57

Describe the solution you'd like

The solution you'd like 例如,可以增加正则表达:(([^)]+?,\s?\d{4}(;\s?[^)]+?,\s?\d{4})*)) 匹配和保留括号内的作者和年份,同时允许翻译文本中的其他部分

Anything else?

No response

windingwind commented 5 days ago

谢谢建议,但无法实现。翻译服务依赖上下文