pgaskin / dictutil

Tools, documentation, and libraries related to Kobo dictionaries.
https://pgaskin.net/dictutil
MIT License
58 stars 4 forks source link

Default dictionary name displayed in footer. #5

Closed EricBrunMawuli closed 4 years ago

EricBrunMawuli commented 4 years ago

First let me thank you for your awesome work.

I was able to build successfully a custom dictionary thanks to dictgen. I copied it in the correct folder of my Kobo device, and it work like a charm.

The only issue is that the name of the previous (default) dictionary is still displayed in the footer of a word definition. I attached a screenshot where I underlined the name of the dictionary name.

Is it possible to set a custom name in the definitions footer ? Or at least remove the default one?

link to screenshot (https://drive.google.com/open?id=1wNBrP0GMs6co5298sQmjyZpShu2G7vuY)

pgaskin commented 4 years ago

Can I see a snippet of your dictfile for that word? Also, what do you mean by the previous dictionary (the built in one, the source dictionary if you converted, etc)?

pgaskin commented 4 years ago

Oh, nevermind, I see what happened. It's hardcoded in libnickel.

You can either name your dictionary something else or patch it.

pgaskin commented 4 years ago

I just had another idea. Try adding the following entry and see what happens (I haven't tested it myself yet):

@ test
<html>
<p>Some text.</p>
<span class="end"><style>.end,.end+*{display: none !important;}</style></span>
EricBrunMawuli commented 4 years ago

Thank you for your suggestions, I'll try to add <span class="end"><style>.end,.end+*{display: none !important;}</style></span> at the end of my entries.

pgaskin commented 4 years ago

Try it on one first. If it works, I'll probably add an option to either dictgen or dictutil install to do it automatically.

EricBrunMawuli commented 4 years ago

It did work. Adding <span class="end"><style>.end,.end+*{display: none !important;}</style></span> as a footer for each entry did the trick. Any idea to add custom footer string (e.g. : My Great Dictionnary, v.1.0)? Anyway, thank you for your help !

pgaskin commented 4 years ago

To add a custom footer string, just put it at the end of the entry. It's all the firmware does itself.

BoboTiG commented 4 years ago

@geek1011 out of curiosity, do you have access to the exact HTML code that is automatically added around the dictionary name?

pgaskin commented 4 years ago

It's a <p> (it might be <div>, I forgot) tag with contents from the current translation (use lconvert from Qt linguist to extract them). That's why hiding the element after the last one works.