# Wiktionary Add-on

**URL:** <https://forums.ankiweb.net/t/wiktionary-add-on/19571>\
**Category:** Add-ons\
**Created:** [April 29, 2022, 10:43am UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571 "2022-04-29T10:43:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [April 29, 2022, 10:43am UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/1 "2022-04-29T10:43:56Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/7/7363e0f09b4a1f1b3511f86aa7081ba5ee6f66d7.png)

Anki add-on to look up words offline using Wiktionary data downloaded from [https://kaikki.org](https://kaikki.org)

See [Wiktionary - AnkiWeb](https://ankiweb.net/shared/info/2087444887) for downloading and instructions.

Please post any questions or issues you have here, or in [GitHub](https://github.com/abdnh/anki-wiktionary).

---

<div class="post-metadata">

**Author:** ![yaoberh](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/yaoberh/32/7505_2.png) [@yaoberh](https://forums.ankiweb.net/u/yaoberh)\
**Post date:** [April 30, 2022, 8:47pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/2 "2022-04-30T20:47:10Z")

</div>

Wow! You’re my hero…Been needing this for a very long time 😃  
Wondering why Chinese isn’t working though. Swedish and any other language I’ve tried do, however.

```auto

The following errors happened during the process:

failed to write file of word "PS/2接口": [Errno 2] No such file or directory: '/home/yaoberh/.local/share/Anki2/addons21/2087444887/user_files/Chinese/PS/2接口.json'

```

Mandarin json shows that no definitions could be found, and Chinese gives me this error

EDIT:  
For those using linux, rename any file with `⁄2` manually, by making the file yourselves. Because it registers it as a folder otherwise. Fixed!

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [April 30, 2022, 9:08pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/3 "2022-04-30T21:08:43Z")

</div>

The add-on ignores and reports issues with files that have problematic characters like `/`, which can’t be used in filenames (because it generates files for each entry in the imported dictionary).

Forbidden characters in filenames on Windows are the following:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/b/b866e8bd2482c3f8ef76bf63fdaa9a09b3f9db9d.png)

Linux is [less restrictive](https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names) about filenames.

The importing process should work normally for other words, though.

---

<div class="post-metadata">

**Author:** ![giannis1234](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@giannis1234](https://forums.ankiweb.net/u/giannis1234)\
**Post date:** [July 6, 2022, 4:07pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/4 "2022-07-06T16:07:24Z")

</div>

Hello,  
Is it possible to modify the script to accept .zim files? Or to make available addons for foreign versions of wikiword so that we get definitions in our target language?

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 6, 2022, 5:11pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/5 "2022-07-06T17:11:20Z")

</div>

> [@giannis1234](#):
>
> Is it possible to modify the script to accept .zim files?

Adding support for .zim files should be possible. I’ve added this to the todo list to look into. This will allow importing [far more dictionaries](https://wiki.kiwix.org/wiki/Content_in_all_languages).

> [@giannis1234](#):
>
> Or to make available addons for foreign versions of wikiword so that we get definitions in our target language?

[kaikki.org](http://kaikki.org) only provides the English Wiktionary’s dictionaries currently. The zim files at [wiki.kiwix.org](http://wiki.kiwix.org) include content from all supported languages, though.

---

<div class="post-metadata">

**Author:** ![giannis1234](https://avatars.discourse-cdn.com/v4/letter/g/7ab992/32.png) [@giannis1234](https://forums.ankiweb.net/u/giannis1234)\
**Post date:** [July 6, 2022, 5:31pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/6 "2022-07-06T17:31:44Z")

</div>

Thank you for your reply!  
If/when Zim files become usable for your add on, is it possible to combine the addon with the Create subs2srs cards with mpv video player addon(1213145732 )? This works in a way where you can instantly hit a hot key to take the audio line, subtitle, and screenshot from a video and create an anki card, not interrupting your watch time hardly at all, whereas with other mpv based methods you need to.  
Would it be possible to somehow combine the two to where you can click on a subtitle word on the screen instead of the hotkey and then have that word with its definition from a wiki (in my case the greek language wikiword zim that I have from kiwix) be added to the anki card as well as the other items like the subtitle line, screenshot and other items? I am not a coder so I do not know how complex this would be on the back end. I’d be happy to commission this through your Fiver if need be.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 7, 2022, 7:50am UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/7 "2022-07-07T07:50:38Z")

</div>

> [@giannis1234](#):
>
> Would it be possible to somehow combine the two to where you can click on a subtitle word on the screen instead of the hotkey and then have that word with its definition from a wiki (in my case the greek language wikiword zim that I have from kiwix) be added to the anki card as well as the other items like the subtitle line, screenshot and other items?

mpv’s interface is mostly keyboard-driven, so I’m not sure if it’s possible/easy to write a script that responds to mouse clicks and determine the word under the cursor. Hooking Wiktionary into the “Create subs2srs cards with mpv video player” add-on should be possible, though (Will require changes from both add-ons). Feel free to contact me through Fiverr - I’ll do some research and let you know if if this possible.

---

<div class="post-metadata">

**Author:** ![yaoberh](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/yaoberh/32/7505_2.png) [@yaoberh](https://forums.ankiweb.net/u/yaoberh)\
**Post date:** [July 7, 2022, 3:09pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/8 "2022-07-07T15:09:25Z")

</div>

Getting “Not found in dictionary” for every word in my chinese deck (3000 words).  
Tried fetching from both Traditional and Simplified fields.

The following issues happened during the process:  
“老师” was not found in the dictionary.

Tried with Chinese and Mandarin jsons. Any ideas？Thanks for the help

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 7, 2022, 3:20pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/9 "2022-07-07T15:20:06Z")

</div>

You are trying to import the JSON at the bottom of [this page](https://kaikki.org/dictionary/Chinese/index.html) and [this](https://kaikki.org/dictionary/Mandarin/index.html), right? Will test it and see what is the issue.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 7, 2022, 3:32pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/10 "2022-07-07T15:32:12Z")

</div>

(If you can share your vocabulary deck, that would be nice for quick testing)

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 7, 2022, 4:24pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/11 "2022-07-07T16:24:30Z")

</div>

> [@yaoberh](#):
>
> “老师” was not found in the dictionary.

This is probably correct. 老师 doesn’t exist in the JSON files provided by [kaikki.org](http://kaikki.org).

---

<div class="post-metadata">

**Author:** ![WGroleau](https://avatars.discourse-cdn.com/v4/letter/w/9fc348/32.png) [@WGroleau](https://forums.ankiweb.net/u/WGroleau)\
**Post date:** [July 7, 2022, 5:40pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/12 "2022-07-07T17:40:49Z")

</div>

Apple forbids most of those in filenames. Some of them it allows but you have to escape them to put them there.

---

<div class="post-metadata">

**Author:** ![yaoberh](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/yaoberh/32/7505_2.png) [@yaoberh](https://forums.ankiweb.net/u/yaoberh)\
**Post date:** [July 7, 2022, 7:36pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/13 "2022-07-07T19:36:20Z")

</div>

Yeah, I’m using the json file at the bootom of both Chinese and Mandarin.  
It doesn’t work with any word, not just 老师  
This is my deck:

> **[Mandarin\_\_800to5k](https://www.mediafire.com/file/s5qgrtv4ynsclzr/Mandarin__800to5k.apkg/file)**
>
> MediaFire is a simple to use free service that lets you put all your photos, documents, music, and video in a single place so you can access them anywhere and share them everywhere.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 7, 2022, 8:48pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/14 "2022-07-07T20:48:42Z")

</div>

It doesn’t work for the Mandarin file because that file apparently mostly has entries for the pinyin transcriptions, and not the Chinese characters. See [Mandarin word forms: list](https://kaikki.org/dictionary/Mandarin/words.html)

Regarding the Chinese file, the add-on fails to find about 900 words. Those don’t exist on Kaikki (I only checked a few, but it’s most likely the case.)

---

<div class="post-metadata">

**Author:** ![yaoberh](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/yaoberh/32/7505_2.png) [@yaoberh](https://forums.ankiweb.net/u/yaoberh)\
**Post date:** [July 8, 2022, 3:21pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/15 "2022-07-08T15:21:23Z")

</div>

Oh…that makes total sense if it tries to fetch pinyin…  
Strange thing is, I got this wordlist from wiktionary. They’re the most used words in mandarin. Strange they do not show up in kaikki.  
Is there any other dictionary I could try?  
If not, I’ll wait for any updates for zim files and then try the one from your link above.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [July 8, 2022, 4:28pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/16 "2022-07-08T16:28:44Z")

</div>

> [@yaoberh](#):
>
> Strange thing is, I got this wordlist from wiktionary. They’re the most used words in mandarin. Strange they do not show up in kaikki.

It probably has something to do with the fact that those missing words only have redirects to synonyms in their pages in Wiktionary. See [老师 - Wiktionary, the free dictionary](https://en.wiktionary.org/wiki/%E8%80%81%E5%B8%88) for example.  
Hopefully, the zim files are structured differently.

---

<div class="post-metadata">

**Author:** ![yaoberh](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/yaoberh/32/7505_2.png) [@yaoberh](https://forums.ankiweb.net/u/yaoberh)\
**Post date:** [July 8, 2022, 6:10pm UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/17 "2022-07-08T18:10:26Z")

</div>

Makes sense…

---

<div class="post-metadata">

**Author:** ![Ramana](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@Ramana](https://forums.ankiweb.net/u/Ramana)\
**Post date:** [August 31, 2022, 10:27am UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/18 "2022-08-31T10:27:09Z")

</div>

Hello, I am experience issues attempting to use your add-on. I imported a json file, add a note, click the W button, select the dictionary, then press add but there is an errorr saying “” was not found in the dictionary.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [August 31, 2022, 11:28am UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/19 "2022-08-31T11:28:53Z")

</div>

> [@Ramana](#):
>
> “” was not found in the dictionary.

Did you make sure the Word field you selected is the correct one and is not empty?

---

<div class="post-metadata">

**Author:** ![Ramana](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@Ramana](https://forums.ankiweb.net/u/Ramana)\
**Post date:** [August 31, 2022, 11:43am UTC](https://forums.ankiweb.net/t/wiktionary-add-on/19571/20 "2022-08-31T11:43:42Z")

</div>

I understood it now, thank you.

[Next page](https://forums.ankiweb.net/t/wiktionary-add-on/19571.md?page=2)
