[Feature Request] Add 'Sentence Translation' field
Summary
it would be nice to have a new field "Sentence Translation" which would host the whole sentence translation, in addition to the target word translation already provided.
Upon initial card creation, a google translation api will be made for the whole sentence and the output will be captured in the new Sentence Translation field. This field should be made editable so the user can override the machine translation either manually or by copying English subtitles.
Overall this project looks really good, thanks for making it! I think this new feature will be useful in situations where the sentence structure is not obvious and will be useful for https://github.com/FreeLanguageTools/vocabsieve/issues/21. Often there are English subtitles available for a show or English translation for a given text, so it would be good to capture that somewhere if required by user
Implementation notes
I think all the backbone for this should already be there, it's literally about adding a new field and utilising the google translate api. Things I can think of:
- Add new editable input on the main window. Call GTranslate api with the whole sentence as soon as Sentence field is populated
- Add new ST field on Anki template
- Add a new mapping in Settings > Anki > Field name for "Sentence Translation"
I considered doing this, though I'm not that sure how useful this would be, and there are a few issues with it.
- If this is needed for the sentence on the card to be understood even with the definition, you should probably not be using the sentence in the first place (too hard)
- If it is not needed, then it just adds to the stuff you have to read on the card, slowing down reviews
- Google translation accuracy is not always that good
- It will clutter up the interface a bit more
- Making even more API calls will slow the workflow down until I garner up the effort to make async stuff work
I might still add a way of viewing the sentence translation though -- maybe as a view only field (not exported to Anki, but you can copy the text to definition if need be)
I personally would find such feature useful, here's a few thoughts why:
- I've noticed that you treat the words as IDs (meaning it's not possible to create 2 cards with the same word) but I've found it useful to translate sentences as well. Sometimes I'd know all the words but wouldn't be able to translate the sentence as a whole, so a sentence translation comes in useful here
- I guess this applies more when starting out but when I'm still not very confident with the language, sentence translations allow me to verify that I understood all the words correctly / my assumptions are valid (I find that I forget basic words months after learning them)
- I've already been doing this by including the subtitles together with the image but a more official approach would still be welcome (eg if subtitles are not available)
A couple of other considerations re: implementation:
- You can use deepl instead of google translate which will provide higher quality translations
If you want this feature request to be minimally intrusive, I can think of:
- Having an
enable automatic sentence translationtoggle in the options which will:- Add a new editable input on the main window as mentioned in the original post
- This will be saved to a separate field in the Anki template, and you can hide the field in the template if its value is blank:
{{#SentenceTranlation}}
{{SentenceTranlation}}
{{/SentenceTranlation}}
So you can still have only 1 template and the user won't be bothered by the new field if they haven't checked the option above
Closing this as mpvacious provides this functionality so it's not worth the dev effort