Google Dictionary [Official Support]

Dear sir:

this add-on is useful, thanks a lot!

but I find the “right click menu” and “hot key” function is not working with Batch edit (in windows 10)

My config

{
“0101-User-Agent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.30”,
“0201-Display ‘Add Pronunciation’ button?”: “No”,
“0202-Display ‘Add 1st Definition’ button?”: “Yes”,
“0203-Display ‘Add All Definitions’ button?”: “Yes”,
“0204-Display ‘Add Translation’ button?”: “Yes”,
“0205-Add labels to play buttons?”: “Yes”,
“0301-Pronunciation field number”: “3”,
“0302-Add US pronunciation?”: “Yes”,
“0303-Add GB pronunciation?”: “Yes”,
“0304-US or GB pronunciation first?”: “US”,
“0305-Keep pronunciation duplicates?”: “No”,
“0401-Not overwrite separator”: “

-----------------------------

”,
“0402-Not overwrite separator color”: “white”,
“0403-Titles color”: “white”,
“0404-Synonyms and antonyms separator”: ", ",
“0405-Overwrite 1st Definition?”: “Yes”,
“0406-Overwrite All Definitions?”: “Yes”,
“0501-1st Definition phonetic field number”: “2”,
“0502-1st Definition phonetic title”: “”,
“0503-1st Definition phonetic color”: “white”,
“0511-1st Definition part of speech field number”: “4”,
“0512-1st Definition part of speech title”: “”,
“0513-1st Definition part of speech color”: “white”,
“0521-1st Definition definition field number”: “4”,
“0522-1st Definition definition title”: “”,
“0523-1st Definition definition color”: “white”,
“0531-1st Definition example field number”: “5”,
“0532-1st Definition example title”: “”,
“0533-1st Definition example color”: “white”,
“0541-1st Definition synonyms field number”: “0”,
“0542-1st Definition synonyms title”: "Similar: ",
“0543-1st Definition synonyms color”: “white”,
“0551-1st Definition antonyms field number”: “0”,
“0552-1st Definition antonyms title”: "Opposite: ",
“0553-1st Definition antonyms color”: “white”,
“0601-All Definitions field number”: “4”,
“0611-All Definitions phonetic field number”: “2”,
“0612-All Definitions phonetic title”: “”,
“0613-All Definitions phonetic color”: “white”,
“0621-All Definitions part of speech field number”: “4”,
“0622-All Definitions part of speech title”: “”,
“0623-All Definitions part of speech color”: “white”,
“0631-All Definitions definition field number”: “4”,
“0632-All Definitions definition title”: “”,
“0633-All Definitions definition color”: “white”,
“0641-All Definitions example field number”: “5”,
“0642-All Definitions example title”: “”,
“0643-All Definitions example color”: “white”,
“0651-All Definitions synonyms field number”: “0”,
“0652-All Definitions synonyms title”: "Similar: ",
“0653-All Definitions synonyms color”: “white”,
“0661-All Definitions antonyms field number”: “0”,
“0662-All Definitions antonyms title”: "Opposite: ",
“0663-All Definitions antonyms color”: “white”,
“0701-Translation field number”: “7”,
“0702-Translation target language”: “zh-TW”,
“0703-Add language name to translation title?”: “No”,
“0704-Translation title”: “”,
“0705-Translation color”: “white”,
“0706-Add transliteration to translation?”: “No”,
“0707-Transliteration color”: “white”,
“0708-Overwrite translation?”: “No”
}

Hello Lee,
Sorry for the late reply.

Please check the below folder, I have uploaded your config file and a video showing how it works with your config. Please check them and let me know if any question is left.

https://drive.google.com/drive/folders/1-fGsLf8g13sSdoAJxB33ujCNLMe7o6eS?usp=sharing

As I checked, only Alt+1 (shortcut for the “1st Definition”) didn’t work. Unfortunately, it seems that the keyboard shortcuts and the way programs and OSs handle them differ from system to system and many of the combinations are already used. I will check and try to find a solution, meanwhile please use the button instead of the shortcut.

Thanks,

Roozbeh

Hello dear add-on users,
There was an issue in the add-on when fetching the audio files after Anki updated to versions v2.1.50+ that is now resolved, and you can use add-on v5.0.1 with either old or new Anki versions (2.1.49 or 2.1.50+). I prefer using the “stable” (according to the Anki website) Anki version 2.1.49 yet, because of a bug (?) in the new versions that do not distinguish between the entry and the media file names, as the example below:

Hi Roozbeh. Thanks for your impressive add-on

There is one thing though; the definition that addon provides, is different to the definition that google provides! I don’t understand this as it’s a Google dictionary add-on. (pictures added below)


Plus as you can see there is no Synonyms in the Add-on’s definition.

Thank you for your response.

Hello villa,
Thanks for using the add-on and highlighting this case. I had noticed some discrepancies between the Google search results and the add-on, usually not big as this!

In fact, the add-on uses the service from “Free Dictionary API” for the definition part (unlike the pronunciations, that it directly fetches from Google). I have assumed (I don’t remember why!) that Free Dictionary API uses Google definition, though its developer does not explicitly claim that, probably to avoid “complications”.

I can look up to find whether a better matching API is available, and your help is also welcome :slightly_smiling_face: ! Doing the work from scratch doesn’t make sense, it’d be a whole new project.

cannot add pronunciation

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you’ve discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.54 (b6a7760c) Python 3.9.7 Qt 6.3.1 PyQt 6.3.1
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-11-30 12:45:46

Caught exception:
Traceback (most recent call last):
File “C:\Users\DELL\AppData\Roaming\Anki2\addons21\1346635841\anki_funcs.py”, line 118, in
lambda _, b=browser: _add_pronunciation_mp3s_batch(b))
File “C:\Users\DELL\AppData\Roaming\Anki2\addons21\1346635841\anki_funcs.py”, line 169, in _add_pronunciation_mp3s_batch
mp3_urls_and_filenames = scrape.search_google(word)
File “C:\Users\DELL\AppData\Roaming\Anki2\addons21\1346635841\scrape.py”, line 74, in search_google
mp3_urls_and_filenames = _scrape(
File “C:\Users\DELL\AppData\Roaming\Anki2\addons21\1346635841\scrape.py”, line 51, in _scrape
mp3_filenames.append(re.search(settings.patterns(
AttributeError: ‘NoneType’ object has no attribute ‘group’

After successfully using Google Dictionary Anki Add On for about 30 minutes it just stopped working entirely. No error message. It just won’t do anything. I deleted and reinstalled it. Still Nothing. Even changed My User Agent (as I probably should’ve to begin with) but still nothing. I did delete all the instances of “black” in the config file and zeroed out all the field numbers except for “Parts of Speech” field number because I was just trying to get that little piece of info into my cards. It was working, albeit slowly. I was just doing like 30 cards at a time b/c it was causing my Mac pinwheel to pop-up and drag my machine down. But they were eventually popping up. However, in the end, I scrolled back up and they disappeared. Now…nothing works with Google Dictionary. What is the deal?

Hello Abderrahman,

Thanks for using the add-on and for your encouragement.

Yes, to disable adding GB pronunciation, you can go to:

Tools > Add-ons > select Google Dictionary > Config

In the Config, change
“0303-Add GB pronunciation?”: “Yes”

To

“0303-Add GB pronunciation?”: “No”

(just change the Yes to No).

The next pronunciations you add will only include the US one.

To delete the GB pronunciations from the entries you have already added, you can delete the related text in the Front box in the Browse section. Refer to the attached video for an illustration.

Regards,

Roozbeh

(Attachment Recording 2023-08-30 225440.mp4 is missing)

Hello Abderrahman,

Thanks for using the add-on and for your encouragement.

Yes, to disable adding GB pronunciation, you can go to:

Tools > Add-ons > select Google Dictionary > Config

In the Config, change
“0303-Add GB pronunciation?”: “Yes”

To

“0303-Add GB pronunciation?”: “No”

(just change the Yes to No).

The next pronunciations you add will only include the US one.

To delete the GB pronunciations from the entries you have already added, you can delete the related text in the Front box in the Browse section. Refer to the attached video for an illustration.

Regards,

Roozbeh

Recording 2023-08-30 225440.gif

Hello,
I can’t install it, because I receive this error, I’ve already tried to reinstall it
and also installed this package

Anki 23.10.1 (fac9e0ee) Python 3.9.15 Qt 6.6.0 PyQt 6.6.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-12-02 09:23:38

When loading Google Dictionary:
Traceback (most recent call last):
File “aqt.addons”, line 245, in loadAddons
File “C:\Users\lampa\AppData\Roaming\Anki2\addons21\1346635841_init_.py”, line 10, in
from . import anki_funcs
File “C:\Users\lampa\AppData\Roaming\Anki2\addons21\1346635841\anki_funcs.py”, line 5, in
from PyQt5.QtWidgets import QMenu
ModuleNotFoundError: No module named ‘PyQt5’

Looking at the GitHub repository, I think the author of the add-on just needs to make one small change to fix the problem mentioned in this error message.

In anki_funcs.py, just change:
from PyQt5.QtWidgets import QMenu
to
from aqt.qt import QMenu

However, there could be other 23.10 compatibility issues besides just this one. This forum thread could be helpful for the author: Porting tips for Anki 23.10

The short-term solution for you would be to use the Qt5 version of Anki 23.10.1 instead of the Qt6 version. But this short-term fix will probably stop working in a month or two.

To clarify: ENABLE_QT5_COMPAT will be removed in early 2024, but that only applies to the Qt6 build of Anki; the Qt5 version will not stop working.

Hi
after downloading the new version of anki23.12.1 Qt 6, the google dictionary add ons does not work. I copied the debug information and i will paste below
Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Windows-10-10.0.17134

When loading Google Dictionary:
Traceback (most recent call last):
File “aqt.addons”, line 245, in loadAddons
File “C:\Users\Muhammad\AppData\Roaming\Anki2\addons21\1346635841_init_.py”, line 10, in
from . import anki_funcs
File “C:\Users\Muhammad\AppData\Roaming\Anki2\addons21\1346635841\anki_funcs.py”, line 5, in
from PyQt5.QtWidgets import QMenu
ModuleNotFoundError: No module named ‘PyQt5’

Please help

I simply fixed this add-on for Anki 23+ and uploaded it to AnkiWeb.
After the original add-on has been updated to Anki 23.10+, this fork is not needed.

2 Likes

if i try to install this addon in qt6 anki, it fails.
so i installed qt5 to use this addon.
if you are interested, plz fix it.
thx in advance

Hello,
I’ve occured with “add-on startup failed” error.

Debug info:
Anki 24.06.2 (33a92379) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Windows-10-10.0.19045

When loading Google Dictionary:
Traceback (most recent call last):
File “aqt.addons”, line 247, in loadAddons
File “C:\Users\mehme\AppData\Roaming\Anki2\addons21\1346635841_init_.py”, line 10, in
from . import anki_funcs
File “C:\Users\mehme\AppData\Roaming\Anki2\addons21\1346635841\anki_funcs.py”, line 5, in
from PyQt5.QtWidgets import QMenu
ModuleNotFoundError: No module named ‘PyQt5’

I also checked for any updates for Anki.

If you scroll up this thread, you’ll see that the add-on is not compatible with Qt6 versions of Anki. Try the alternative version above.