Sunday, March 9, 2014

Adding custom dictionaries to Kobo devices

I recently bought a Kobo Glo. Great little e-reader, that one.

I spent a while struggling to figure out how to install a Turkish-English dictionary on it, because it's not supported by default. I decided to write a little tutorial about installing other dictionaries on a Kobo device, in case I or anyone else ever need it to do this again.

Check whether the dictionary you want is already available

1. Check here whether Kobo already made the dictionary you want. If yes, download the file, connect your Kobo device to your computer and place it in the ".kobo\dict" folder and you are done. If not, go to step 2.

2. Check here whether someone else already made a custom dictionary for the language pair you want. If so, you can skip to step 13 for instructions on how to put the file on your Kobo device.

Make a custom dictionary

3. Download the dictionary you want in StarDict format. This website has a lot of dictionaries.

4. Unzip it the .tar dictionary file. You will get a .dz, .idx and .ifo file. Rename the .dz file to .gz. Extract the .gz file so you end up with a .dict file. Give the .dict, .ifo and .idx representative names, eg. tur_en.dict, tur_en.idx, and tur_en.ifo.

5. Go here and download the latest version of Penelope.

6. Unzip the Penelope script and place it in the folder of your choice, for example "c:\Penelope". Put the dictionary files in the same folder as the Penelope files.

7. Install Python 3.3.4.

8. Download the marisa.zip file here or here. It containes two Windows executables It was built from open source Marisa code by the user EbokJunkie on mobileread.com. Penelope script invokes these executables. You can put them anywhere; I put them to "C:\tmp".

9. Right click the file penelope3.py and choose Edit with IDLE. Find the variables MARISA_BUILD_PATH and MARISA_REVERSE_LOOKUP_PATH and set their location to "c:/tmp/marisa-build.exe" and to "c:/tmp/marisa-reverse-lookup.exe" respectively, or wherever you saved the marisa files. Save penelopa3.py.

10. Open the command prompt and make the Penelope folder your current folder by typing the command "cd c:\Penelope".

11. Type the following command to start the conversion: "penelope3.py -p tur_eng -f tur -t eng --output-kobo". Replace the variable "tur" with the language you want to translate from and "eng" with your target language.

12. You will end up with a Kobo dictionary file now, for example dicthtml-tur-eng.zip.

Transfer the dictionary file to your Kobo device

13. Connect your Kobo device to your computer and go to the ".kobo\dict" folder on the reader.

14. In order to get your Kobo device to recognize the dictionary files, you have to use it to replace an existing original dictionary. To do this, you have to use the file name of an existing original dictionary. For example, I don't use the Spanish dictionary, so I renamed the file "dicthtml-es-en.zip" on my Kobo device to "dicthtml-es-en-backup.zip", so I will still have a backup in case I need it later. Then I renamed my Turkish-English dictionary to "dicthtml-es-en.zip".

15. Unplug your Kobo device, tap a word in a book and use the "Spanish" dictionary to look up words in your dictionary.

Credits: