Skip to content
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

请问怎样设置能够对没有语言设置的PDF文件禁用自动翻译功能 #1060

Open
1 task done
pisceswb opened this issue Jan 18, 2025 · 3 comments
Open
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@pisceswb
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Environment

1

Describe the feature request

从知网直接下载的PDF文件,没有父条目,直接打开,由于没有(不能)设置“语言”选项的原因,高亮后会自动翻译内容。请问,能否增加设置,不对“语言”选项为空的PDF文档,启用自动翻译功能。
经过测试,有父目录的PDF文件,如果语言设置为空,会启用自动翻译功能。
谢谢!

Describe the solution you'd like

1

Anything else?

No response

@pisceswb pisceswb added the enhancement New feature or request label Jan 18, 2025
@clarin-ebtio800090
Copy link

Hello, we tried to solve the issue.

This is what we did:

Modified the runTranslationTask function to check if the language field is empty before proceeding with the translation. This addresses the issue of automatically translating PDFs without a parent item or language set.

You can review changes in this commit: clarin-ebtio800090@2d8aaf8.

Caution

Disclaimer: The concept of solution was created by AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.


Latta AI seeks to solve problems in open source projects as part of its mission to support developers around the world. Learn more about our mission at https://latta.ai/ourmission . If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.

@pisceswb
Copy link
Author

pisceswb commented Jan 18, 2025

👍👍👍感谢您迅速且专业的回复和修改! @clarin-ebtio800090

@pisceswb
Copy link
Author

在v2.1.2版本中仍然不行

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

No branches or pull requests

3 participants