ilius / pyglossary

A tool for converting dictionary files aka glossaries. Mainly to help use our offline glossaries in any Open Source dictionary we like on any modern operating system / device.
GNU General Public License v3.0
2.19k stars 238 forks source link

Kobo dictionary not working on device #408

Closed skoinks closed 1 year ago

skoinks commented 1 year ago

Hello,

I am trying to create a Bulgarian dictionary for my Kobo Nia reader. That is to say, a definitions dictionary, not one that translates between two different languages. After some adjustment, I got the operation to complete successfully and the dictionary shows up on my e-reader, but no definitions appear (reader thinks the dictionary is empty). As the Kobo format uses some sort of obfuscation, I can't verify the contents of the html and words file myself, so I'm not sure how to verify it has converted successfully and hence whether the problem is with the reader or the conversion. I'm using a tab file I created from a dictionary I found online. Here I've included my input and output files, in case it's something I'm doing wrong on the input side: bgthes_tab.txt dicthtml-bg.zip

I have a Russian-English dictionary that's working, so I know the device supports reading Cyrillic for the dictionary. I tried copying a file called "11.html" from that dictionary in case it was some sort of definition file (it seems to be present in all the other included Kobo dictionaries) but that didn't help.

Thank you in advance!

ilius commented 1 year ago

Did you use PyGlossary to convert to dicthtml format?

If so, please convert to .df file, then try converting it to dicthtml with dictutil tool. The author is a Kobo dictionary expert while I don't know much about Kobo (I don't even have a Kobo device or simulator).

I can give one suggestion though, to split the Tabfile or .df file into multiple files and convert all to dicthtml and test to see if any of them work.

You can split Tabfile with PyGlossary to files of approximately 1000 bytes by passing --write-options=file_size_approx=1000 for example.

skoinks commented 1 year ago

Thank you for the swift response! Using the dictgen utility you linked, I was able to convert a .df dictionary to a dicthtml.zip file and it worked wonderfully! I had previously exported my tabfile to Kobo Reader format, and then just zipped the html and words file together manually. Perhaps the problem was there. Thanks again!