View Single Post
Old 08-11-2014, 11:38 PM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
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:
  1. <tag lang="some_language">
  2. <html lang="some_language">
  3. opf <dc:language>some_language</dc:language>
  4. editor-preferred-language "some_language"

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.
davidfor is offline   Reply With Quote