adding homebrew dictionaries to a kobo, and other hacks

as far as I can tell, kobo does not provide a russian language dictionary for their eReaders, nor a russian -> english dictionary. nor even do they officially support the addition of dictionaries provided by third parties or created by the user. thankfully, they do provide a couple of unobstructed ways to modify the system, act as root on the device, and otherwise change things to your heart's content. for this I commend them.

how to change stuff

mounting the kobo over USB as a storage volume gives you access to the document storage on the device, plus the .kobo directory which can be modified with various third party tools. NickelMenu and KOReader are the two I use here and recommend to anyone. installing them is as simple as copying a bunch of stuff into that .kobo directory and rebooting the device. KOReader allows you to sync webpages as .epub from Wallabag which I feel is absolutely invaluable.

also present in the .kobo directory is a plain text file called ssh-disabled with the following contents:

To enable ssh:
- Rename this file to ssh-enabled
- Reboot the device
- Connect via: ssh root@device_ip

after doing this, you're asked to set a root password and immediately presented with a shell. other electronics manufacturers - take note. this is how you do it. from here, you can do whatever you please.

in order to add a custom dictionary, we need to make or acquire that dictionary. this abandoned but brilliant project, Penelope, will help you do that and its author has made some really good aggregated lists of community-made dictionaries on the mobileread forums. the kobo will only recognise dictionaries named the same as one of its inbuilt ones - for example, I replaced the italian -> english dictionary found in the dict directory with a russian -> english one downloaded from a third party. after doing so, my kobo successfully showed definitions of words highlighted in russian epubs when the ita -> eng dictionary was selected.

the catch

upsettingly, each time you use the "sync" button, the kobo will do a few things besides sync books. one of the other things it does is check system files against known checksums, and redownload them if there is any mismatch. this includes dictionaries. my solution to this is ugly but functional; add a NickelMenu item which when selected executes a script, copydict.sh. copydict.sh takes the russian -> english dictionary from elsewhere on disk and copies it over the ita -> eng one, and I run this manually after each sync. yes, I know that sucks. you could find some low-impact way to make a hook for the sync function, a timer and an rsync, a cronjob, or some other much better solution, but I did not. add button, button fix problem, press button when problem presents. stop tinkering and read book.

to do that:

create /mnt/onboard/.adds/nm/copydict and add:

menu_item :main :Restore Dictionaries Now :cmd_spawn :quiet :exec /mnt/onboard/.adds/scripts/copydict.sh

in copydict.sh, cp the custom dictionary file from somewhere else on the filesystem over the top of one of the existing system dictionaries, like:

#!/bin/sh
cp /mnt/onboard/.adds/yourcustomdict.zip /mnt/onboard/.kobo/dict/dicthtml-it-en.zip