Ajatt-Tools / anki.koplugin

KOReader plugin enabling Anki card generations for words looked up in the internal dictionary.
49 stars 6 forks source link

Could not determine language of word! Stored note offline #14

Closed 233177712 closed 2 months ago

233177712 commented 8 months ago

Thx for your amazing koplugin! I have reached an issue like this: IMG_20231230_131330 After clicking the button "Add to Anki" the first time,there goes an alert like above.

192.168.6.180 is the IP address of my PC where AnkiConnect is running, the connection through e-reader to PC is working fine I think Screenshot_20231230-125444 Is there any anything goes wrong with my settings in Anki Settings->General Settings? (I didn't change any item in Anki Settings->Anki Note Settings.)

nairyosangha commented 8 months ago

The warning you're getting is not related to your settings. The plugin is trying to query forvo to get audio for the word you looked up. It needs to know the language of the word in question to be able to do that.

It tries to get the language from your dictionary, or from the document you're reading. If there's no language set for either of those, it will show that warning. If you don't care about having audio for the word you looked up, you can just leave out the field in your config. If you do want audio, you could add language info to your dictionary's .ifo file, in your case you could add the line ifo_lang=en-zh

Another option would be to edit the document you're reading so the language is present there, although I'm not sure you can do that for PDF docs

squishygian commented 5 months ago

Hello I just started having this issue as well out of nowhere even though I have forvo completely deleted in config I have also deleted it’s folder, and tried reinstalling/reconfiguring multiple times and nothing works ☹️ what could be triggering it when I try to add a word?

nairyosangha commented 5 months ago

Hello I just started having this issue as well out of nowhere even though I have forvo completely deleted in config I have also deleted it’s folder, and tried reinstalling/reconfiguring multiple times and nothing works ☹️ what could be triggering it when I try to add a word?

out of nowhere

I assume it started occurring suddenly when reading a new document? Possibly it was always running forvo but up until now it was able to determine the language of the words you were looking up. I can only guess

I have forvo completely deleted in config

You mean the audio_field field right? Just making sure

I have also deleted it’s folder

not sure what you mean with this.

If the audio_field isn't set anywhere, meaning it's not present in config.lua nor in your personal settings (I recall you installed that patch before :), then it shouldn't actually try to query for forvo audio, which means you can't run into that error. Since it is happening anyway, it has to be set in one of those places.

Now that I think about it, once you ever set it manually in the UI to anything at all you probably can't disable it via the UI. You should double check the settings/ankiconnect.lua file directly and make sure there's no audio_field in there either.

squishygian commented 5 months ago

Hello I just started having this issue as well out of nowhere even though I have forvo completely deleted in config I have also deleted it’s folder, and tried reinstalling/reconfiguring multiple times and nothing works ☹️ what could be triggering it when I try to add a word?

out of nowhere

I assume it started occurring suddenly when reading a new document? Possibly it was always running forvo but up until now it was able to determine the language of the words you were looking up. I can only guess

I have forvo completely deleted in config

You mean the audio_field field right? Just making sure

I have also deleted it’s folder

not sure what you mean with this.

If the audio_field isn't set anywhere, meaning it's not present in config.lua nor in your personal settings (I recall you installed that patch before :), then it shouldn't actually try to query for forvo audio, which means you can't run into that error. Since it is happening anyway, it has to be set in one of those places.

Now that I think about it, once you ever set it manually in the UI to anything at all you probably can't disable it via the UI. You should double check the settings/ankiconnect.lua file directly and make sure there's no audio_field in there either.

You are incredible sir, the way you can perfectly diagnose and solve these issues without ever physically troubleshooting the device in question is nothing short of genius.

nairyosangha commented 2 months ago

I've changed this flow a bit, it will not even allow you to save a note like this offline anymore, and I've added extra info on how to solve it in a new FAQ section: https://github.com/Ajatt-Tools/anki.koplugin?tab=readme-ov-file#faq

Feel free to ask if you have further questions