kelciour / google-translate

Anki add-on for Google Translate
5 stars 5 forks source link

Error when trying to translate cards #37

Closed danielswater closed 6 months ago

danielswater commented 8 months ago

When I try to translate from English to Portuguese, it gives the following error:

Error:

Traceback (most recent call last): File "anki.notes", line 154, in _field_index KeyError: 'english translation'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\danie\AppData\Roaming\Anki2\addons21\1536291224__init.py", line 412, in accept for num, chunk in enumerate(self.chunkify(), 1): File "C:\Users\danie\AppData\Roaming\Anki2\addons21\1536291224\init.py", line 316, in chunkify if self.config["Overwrite"] or note[fld] == "": File "anki.notes", line 159, in getitem__ File "anki.notes", line 156, in _field_index KeyError: 'english translation'

image image

Os campos estão corretos:

image

kelciour commented 8 months ago

I guess, you're trying to translate a few different note types at the same time and one of the note types doesn't contain the "english translation" field. I'll try to fix it some time later by skipping such notes.

In the meantime, maybe use the following search to find notes with the "english translation" field and translate only them.

"english translation:*"
danielswater commented 8 months ago

I tried to do this. No erros occurs, but nothing is translate

kelciour commented 8 months ago

Maybe try to use the add-on with a single note and double-check that the Source Field and Target Field are set correctly.

image