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.15k stars 304 forks source link

[Feature] A PDF Translation Annotation Button on popmenu or translate pane #69

Closed zyx335588 closed 2 years ago

zyx335588 commented 2 years ago

When I opened a PDF with highlights, all highlights were translated and stored with the highlights if the Translation Annotation was checked in Preferences. However, most of them were not needed to be translated or stored. I would like only to store several of the translations for future reference. It may be a solution that a button on the popmenu or translate pane was added to allow users to make choices.

Another suggestion:

Whether a Copy Both beside Copy Raw and Copy Result buttons could be considered to make users copy both raw and result separated by a line break. It would be more convenient to copy them to other editors to build a corpus.

Or, more directly, adding a button to store all the needed text and translation in an item child note with a special title or tag (such as Golden Sentence like a bioinformatic program TBtools developed by @CJ-Chen). The function of Golden Words, Golden Sentences in TBtools (link1, link2) should be easily implemented with your plugin, zotero's note editor (support some HTML tags) and note export function.

windingwind commented 2 years ago

Adding a Copy Both button is easy. Will update in the next release.

I'm not clear about your point: do you mean merging ALL annotations of a document to a new note(with translation)?

windingwind commented 2 years ago

try v0.3.20 please

zyx335588 commented 2 years ago

Thank you for the update.

NOT all the annotations, but those I choose. This is why I think a button is more suitable than an automatic method. In most cases, I use this plugin only to get the approximate meaning of a sentence. However, in some cases, I want to store them. For example, I could store some sentence patterns, some good sentences used to describe a phenomenon... I can copy both of the raw text and the translation to another editor to achieve it. Since Zotero has a build-in note editor, I think besides manual copy, these texts can be directly stored to the Zotero note with a specific title or tag. Of course, it is better if the key words can be highlighted at the same time. And then, after some time, I can export these notes in different items to an HTML file or a file in other formats by filtering the note title or note tag.

I don't know whether I express it clearly or not. The following webpages described a similar function in TBtool can be referred to. https://www.jianshu.com/p/7f5586b7a43f https://www.jianshu.com/p/0e8ccc382edf

windingwind commented 2 years ago

3 solutions:

  1. Add a translate annotation checkbox/switch in the popup & sidebar. You can manually enable/disable translation for every annotation.
  2. Add translate annotation to the right-click menu of annotations.
  3. Automatically translate Add to Note text, just like the automatic annotation translation function. image

Which one do you prefer?

Xuyihaoby commented 2 years ago

Well, if I understand properly, the above question can be solved by edit-preference-PDF translate-function-uncheck the fourth box

windingwind commented 2 years ago

@Xuyihaoby Yes, you can disable annotation translation. I guess what @zyx335588 want is to manually translate annotations/notes?

zyx335588 commented 2 years ago

3 solutions:

  1. Add a translate annotation checkbox/switch in the popup & sidebar. You can manually enable/disable translation for every annotation.

  2. Add translate annotation to the right-click menu of annotations.

  3. Automatically translate Add to Note text, just like the automatic annotation translation function.

image

Which one do you prefer?

@windingwind I prefer the third.

zyx335588 commented 2 years ago

@Xuyihaoby Yes, for the problem:

When I opened a PDF with highlights, all highlights were translated and stored with the highlights if the Translation Annotation was checked in Preferences. It can be solved by unchecking the fourth box.

Now, in fact, we discuss another issue while it was put in this issue together with the above question. As @windingwind said, I want a more convenient way to collect useful information from PDF document and store them in a note, and if possible, to export them.

windingwind commented 2 years ago

@zyx335588 try v0.3.22

cjlCMU commented 2 years ago

@zyx335588 try v0.3.22 image image I tried your new version on win11 laptop, but I failed to see the "add to note" button. I am looking forward you to fixing this bug.

windingwind commented 2 years ago

@cjlCMU Open a note editor and it will show up. If no active note editor is selected, I don't know where to insert the text.

BTW, the button label is too long right now. Any suggestions?

image

cjlCMU commented 2 years ago

Thanks, these functions are awesome! "Add text" and "Add translated text" may be shorter.

chunyanghu commented 2 years ago

some annotation can be translated automatically, but some annotations can't be translated. I don't why? 屏幕截图 2022-04-08 101930 屏幕截图 2022-04-08 101950

windingwind commented 2 years ago

v0.4.0 release fixed some bugs with this new feature.

zyx335588 commented 2 years ago

@cjlCMU Open a note editor and it will show up. If no active note editor is selected, I don't know where to insert the text.

That's great! I think if the note editor is not activated, we can try to create a new note with a special title or tag by coding for the first time. In the latter, append translations to the note with this title or tag.

windingwind commented 2 years ago

@cjlCMU Open a note editor and it will show up. If no active note editor is selected, I don't know where to insert the text.

That's great! I think if the note editor is not activated, we can try to create a new note with a special title or tag by coding for the first time. In the latter, append translations to the note with this title or tag.

Nice suggestion. Adding the selected text with citation info to note directly is a little bit challenging, though.

windingwind commented 2 years ago

Now it looks like this:

image

windingwind commented 2 years ago

I'll close this issue. Feel free to open it again.