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

Feature ideas: add translated selections to anki/add word context #39

Open
anaxonda opened this issue Nov 24, 2024 · 8 comments
Open

Feature ideas: add translated selections to anki/add word context #39

anaxonda opened this issue Nov 24, 2024 · 8 comments

Comments

@anaxonda
Copy link

  1. It would be useful to have selections that have been translated also added to anki, with the text selection and the resulting translation.

However, I'm not sure if these are stored somewhere already.

  1. Add the context of the word lookup to the anki card (the sentence that contains the looked-up word).
@anaxonda
Copy link
Author

Oops, my fault for not reading well, I see #2 is already an option.

@nairyosangha
Copy link
Member

Not sure I understand what you're envisioning for your first suggestion. You want the sentence you looked up to be translated on the fly and inserted on the note as well? KOreader doesn't provide anything like that, you'd need to query some third party service.

@anaxonda
Copy link
Author

anaxonda commented Nov 25, 2024

Yeah, I'm referring to the built in translation service, its one of the selection options.
translation option
translation

@nairyosangha
Copy link
Member

Neat, I admit I did not check at all whether KOreader supported that already, this was pretty straightforward: cf58b42

Could you give it a try and see if anything is missing? It inherits language settings from the settings you define in KOReader itself so it should be pretty simple.
One thing to keep in mind is that this will make syncing your notes even slower because it has to do an extra call for each note now, it's already pretty slow as is, but not much I can do about that.

@anaxonda
Copy link
Author

I will try to test, but having problems getting it working now, see #40

@anaxonda
Copy link
Author

Should I expect to see an add to anki button when I view a translation? Right now there is none.

@nairyosangha
Copy link
Member

Should I expect to see an add to anki button when I view a translation? Right now there is none.

No, what I did is update the normal flow, if you look up a word in a dictionary and choose to add it, it will also add a translation of the current sentence, provided you filled in a value for the accompanying translated_context_field. You don't get to pick a translation yourself. It'll use the target lang you specify in KOreader's translation settings

@nairyosangha
Copy link
Member

I took a quick look and adding the 'add to anki' button on the translation window wouldn't work without modifying the KOreader code base itself so I'd rather not try to get that to work

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

No branches or pull requests

2 participants