Closed tartanpion closed 11 years ago
Most of my files don't have hyphenation at all. I was about to report it as a new Issue. @jgoguen what do you think I should do? keep the two problems in the same issue or create a new one?
@giorgio130 : hyphenation will appear if you deselect "justification OFF"
@tartanpion I don't set the XML language declaration. If it's set at all, I just pass through whatever is there; if it isn't set, I don't create it. However, it's possible that if it's not set the Kobo defaults to the English dictionary. Given that you've seen such a serious bug with the Kobo using a non-English declaration, I would prefer not to set the XML language at least until the Kobo developers fix that. I haven't looked inside KoboRoot.tgz so I'm not familiar with the contents; is there a separate hyphenation dictionary in there or just the standard definition and translation dictionaries? Are you able to send me the original book (before converting it with this plugin), or at least the OPF file and a couple of content files? I suspect that xml:lang is set in them, or possibly that it isn't set at all and Sigil is adding it to make the XHTML files fully valid.
@giorgio130 Try turning off justification (it's in the per-book reading settings I believe) and see if you get hyphenated words. It's possible that you still won't, I have justification off and I see very few hyphenated words. I never noticed if the hyphenation was ever wrong though. Either way, it's not my bug; that's a Kobo settings issue if hyphenation isn't showing or is showing incorrectly. Looks like Kobo may have a bug around hyphenation when xml:lang is set
I have some example files, where hyphenation shows up or doesn't depending on how the epub is created. It would be nice to find the change causing it and set it in the plugin. I am SURE it is not depending on justification settings, with the same settings in one file hyphenation shows up and in the other one it doesn't. Should I open a new issue?
EDIT: uh, I was actually wrong - hyphenation appears if I turn ON justification, in both files and consistently. I will explore some way to set the correct language...
Don't create a new issue yet, I think it may be the same issue manifesting differently. Still not convinced I can do anything about it, especially for people who read books in different languages. There's probably some way I could read dicthtml.zip to get the current language, but what to do for the person who has their interface set to Polish and uploads a set of mixed English and Polish books? Or for the Russian who uploads a mixed set of Russian, English, and German books? The best I could do would be to allow setting your preferred xml:lang, but them you have to remember to only upload that language and then change it every time you have books in a different language.
Another thing I can try is to look in the metadata files that come with each ePub and try to set xml:lang from there and see if that works. Can either of you send me a non-English book that has hyphenation in the wrong places, and what language your interface and the book is, and I'll rip it open and check for built-in language settings?
Commit dcb66ce: Only calculate the hyphenation dictionary once per book and properly detect when to use the default dictionary
My books are in french. Hyphenation use the wrong dictionnary in every case. Even if i force with calibre (0.9.23) xml:lang="fr" : html, body { widows: 0; orphans: 0; padding: 0; margin: 0; height: 100%; xml:lang="fr"; } The convertion in kepub when open with sigil, make appear xml:lang="en" ; making probably use of the wrong hyphenation dictionary in the kobo. If i edit with sigil the book with xml:lang="fr", i have a bug in the kobo with sometimes a corruption of the db, with a reinitialisation of the firmware mandatory. But even if i substitute the english dictionary with the french one in a KoboRoot.tgz : the wrong hyphenation appear...