shigeyukey / my_addons

3 stars 0 forks source link

🌍️Anki Translator: verbs error #72

Open shigeyukey opened 2 weeks ago

shigeyukey commented 2 weeks ago

https://ankiweb.net/shared/info/1552714896

https://forums.ankiweb.net/t/addon-for-translating-a-field-with-translation-selection/51514

Thank you, but now there is a very different problem all of a sudden: Whenever I change the language settings in init.py to “de” (Source Language) and “ru” (Target Language) as well as LoadGrammarInfos to “False”, I get an error and the following Debug Info whenever I hit the Translate button in the dictionary window. When I do a fresh reinstall of the add-on it works again, but as soon as I permanently change the source and target language, the error comes back.

Anki 24.06.3 (d678e393) (ao) Python 3.9.18 Qt 6.6.2 PyQt 6.6.1 Platform: Linux-6.1.0-25-amd64-x86_64-with-glibc2.36

Traceback (most recent call last): File “/home/username/.local/share/Anki2/addons21/1552714896/TranslatorAddon/TranslatorDialog.py”, line 134, in translate translations = self.parser.getTranslation(vocab, src, tgt, grammarInfos) File “/home/username/.local/share/Anki2/addons21/1552714896/TranslatorAddon/Parser/PONSParser.py”, line 43, in getTranslation genus = html.unescape(“”.join(genus.findAll(text=True)).strip()) AttributeError: ‘NoneType’ object has no attribute ‘findAll’

===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Anki Translator Fixed by Shige [‘1552714896’, 2024-11-03T17:32, ‘None’, ‘’] AnkiConnect [‘2055492159’, 2024-07-26T06:55, ‘None’, ‘’] AwesomeTTS - Add speech to your flashcards [‘1436550454’, 2024-09-14T08:04, ‘None’, ‘’] Button Colours Good Again [‘2494384865’, 2022-09-27T12:18, ‘None’, ‘’] Change Interface Font [‘1431333984’, 2024-03-07T19:31, ‘None’, mod] Customize Keyboard Shortcuts [‘24411424’, 2023-11-01T10:17, ‘None’, ‘’] DeepL Translator [‘972129549’, 2024-04-26T22:11, ‘1.0.0’, mod] ReColor [‘688199788’, 2024-03-03T02:45, ‘3.0’, mod] Switch Note Type Hotkey [‘565948788’, 2021-10-04T05:46, ‘None’, mod]

===IDs of active AnkiWeb add-ons=== 1431333984 1436550454 1552714896 2055492159 24411424 2494384865 565948788 688199788 972129549

===Add-ons (inactive)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Enhance main window [‘877182321’, 2023-10-22T22:28, ‘None’, mod] Review Heatmap [‘1771074083’, 2022-06-30T03:43, ‘None’, ‘’]


After trying some more today, I think the problem is that the dictionary can not deal with German to Russian or Russian to German verbs. Only verbs. Nouns work fine.