![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
About language and spelling
Hi
I began to work on an French OCR file to produce an EPUB. I then realized all the html files had a xml declaration including the wrong language (English) . I modified all the files to "fr-FR" - see below - and saved. However, when I later checked the spelling (using a French dictionary), I saw that a lot of words were still mistakenly considered as English. (see screenshot). It maybe a bug or I did a mistake when changing the language? Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-FR"> Last edited by roger64; 08-11-2014 at 02:48 AM. |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
It might be useful to have a look at this recent thread :
https://www.mobileread.com/forums/sho...d.php?t=243887 Try declaring the language in the content.opf file and bear in mind that Kovid fixed a bug to do with this only last week. BobC |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@Bob
Thanks for your help. I have read this comment from Kovid Goyal "The language from content.opf will work unless the html files define their own languages, in which case the latter will win." For what I can see, we need to specify the language for both: not only for the html files but also for the content.opf file. Now, all the words in my EPUB are qualified as French. ![]() EDIT: using the latest Calibre version |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
@Roger
The other point that occurs is that you have : <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-FR"> what happens if you use : <html xmlns="http://www.w3.org/1999/xhtml" lang="fr"> Of course I don't know if your files are xhtml or just html (or even whether it would make a difference) BobC |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
From the other thread, it chooses the language using the most specific settings. So, in order it is:
I tested it with a book in English that had some dialog in Spanish (a character tended to swear in Spanish) and Hebrew (different character, same reason). When I wrapped spans around the dialog, or added a language attribute to a paragraph, the spelling errors went away. Neat, but a lot of work. I also tried the opf and file level setting. I used "en-US" in the OPF and "en-GB" in the file and "colour" was correctly spelt and "color" incorrect. Something I had forgotten to try last week was if the file was less specific than the OPF. So, I have just tried "en-GB" and "en" in the file. With this combination, whatever is the editor specified default is used. So choosing US in the editor showed "colour" as incorrect and "color" as correct. For the attributes on the html tag, the epub I used started with both. Either seem to work but the non-xml one seemed to have precedence. One other thing I just noticed, if I change the language in the OPF, I have to save and reopen the file for it to take affect. Changing any of the others has an affect in the current session. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thanks for this useful information
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,050
Karma: 11391181
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Hm,
I have - html <xml lang="de"> - opf <dc:language>de</dc:language> There is no special tag language information, and I don't know how to find the "editor-prefered language" (maybe due to the translation). When I click "tools-spellcheck", there appears the word list of the German dictionary that I have installed and marked as active (the default unchecked as active). But in the "live spellcheck" in code view, almost every german word is marked as erroneous, so it must be the default dictionary that is working here. How can I change the dictionary for the "live spellcheck", please? Problem resolved: The Hyphenation tool had been activated! Last edited by Leonatus; 08-26-2014 at 12:48 PM. Reason: Problem resolved |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Controlling spelling language | BobC | Editor | 9 | 08-06-2014 12:45 AM |
check spelling | Divingduck | Editor | 99 | 05-13-2014 12:26 AM |
Spelling anomalies | DMB | General Discussions | 71 | 06-19-2012 07:55 AM |
Seriously thoughtful Spelling contractions | SameOldStory | Lounge | 47 | 09-08-2010 09:08 PM |
Spelling Macro | PieOPah | Workshop | 36 | 12-13-2008 02:27 AM |