Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 08-25-2015, 04:01 AM   #1
ColMac
Connoisseur
ColMac began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Apr 2012
Device: Kindle Fire
Spelling language

My PC is in the UK and naturally set up only for English UK.

I have a number of books that I have got from US sources, and if I check spelling using Edit Book, I get a lot of errors reported where a US spelling is used in the book, but the spell checker reports it as an English(GB) word. I would like to eliminate these reports and check some books using a US dictionary.


In the example I am looking at currently, there is no language defined in the book's (epub) metadata.

In Edit Book preferences, I have set English-US as the preferred Variant for the English language

In the Calibre Help file it says " .... Language information is taken from the books metadata and from lang attributes in the HTML files. ...."

I have searched "All text files for any lang codes, and the only one I can find is on the title page as follows.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">


I have also searched for a GB text string and got no hits.

So something is still forcing the spell-checker to identify these words as English (GB).

Can anyone point me in the direction of a possible solution please.
ColMac is offline   Reply With Quote
Old 08-25-2015, 04:38 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by ColMac View Post
My PC is in the UK and naturally set up only for English UK.

I have a number of books that I have got from US sources, and if I check spelling using Edit Book, I get a lot of errors reported where a US spelling is used in the book, but the spell checker reports it as an English(GB) word. I would like to eliminate these reports and check some books using a US dictionary.


In the example I am looking at currently, there is no language defined in the book's (epub) metadata.

In Edit Book preferences, I have set English-US as the preferred Variant for the English language

In the Calibre Help file it says " .... Language information is taken from the books metadata and from lang attributes in the HTML files. ...."

I have searched "All text files for any lang codes, and the only one I can find is on the title page as follows.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">


I have also searched for a GB text string and got no hits.

So something is still forcing the spell-checker to identify these words as English (GB).

Can anyone point me in the direction of a possible solution please.
The metadata starts with the books (Language} in the Library (it normally comes from the book upon adding.

BTW, look in the content.opf

<dc:language>en-GB</dc:language>
theducks is offline   Reply With Quote
Old 08-25-2015, 06:16 AM   #3
ColMac
Connoisseur
ColMac began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Apr 2012
Device: Kindle Fire
Hi & Thanks for the help.

Quote:
The metadata starts with the books (Language) in the Library (it normally comes from the book upon adding).
BTW, look in the content.opf
I don't have a content .opf file anywhere in my library, but I do have a metadata.opf one in each folder. I assume that's the relevant one

The one for this book has only one entry with the word "language" included.

<dc:language>en</dc:language>

So this doesn't appear to be forcing the spell checker towards English (GB).

Colin
ColMac is offline   Reply With Quote
Old 08-25-2015, 06:46 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Change it to

<dc:language>en-US</dc:language>
kovidgoyal is offline   Reply With Quote
Old 08-25-2015, 07:10 AM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@ColMac - if your books are either US spelling or UK spelling (i.e. not mixed within a book) try switch dictionaries Edit->Preferences->Editor Settings->Manage Dictionaries.

If you have books with both or you want a swiss-army-knife to cover all books then there are some EN dictionaries at Apache that carry both spelling variants (e.g. 'spelt' and 'spelled', but only 'dispelled' and 'bespelled' ). They're rather big so they may have an adverse effect on performance when they're used.

BR
BetterRed is offline   Reply With Quote
Old 08-26-2015, 03:03 AM   #6
ColMac
Connoisseur
ColMac began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Apr 2012
Device: Kindle Fire
Quote:
Originally Posted by kovidgoyal View Post
Change it to

<dc:language>en-US</dc:language>
Did as suggested, it made no difference.

I also spotted that there is a content.opf file listed in contents when in Edit book mode, but changing that also made no difference
ColMac is offline   Reply With Quote
Old 08-26-2015, 03:06 AM   #7
ColMac
Connoisseur
ColMac began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Apr 2012
Device: Kindle Fire
Quote:
Originally Posted by BetterRed View Post
@ColMac - if your books are either US spelling or UK spelling (i.e. not mixed within a book) try switch dictionaries Edit->Preferences->Editor Settings->Manage Dictionaries.
Yes I do have both types thanks, and it was "switch dictionaries" that brought me to this problem.
ColMac is offline   Reply With Quote
Old 08-26-2015, 08:50 PM   #8
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by ColMac View Post
Did as suggested, it made no difference.

I also spotted that there is a content.opf file listed in contents when in Edit book mode, but changing that also made no difference
The language can be set in other places as well. One of the sources of books I have sets the language at the top of each html file. But, it can be set on a tag or in the class used.
davidfor is offline   Reply With Quote
Old 08-26-2015, 10:27 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by ColMac View Post
Did as suggested, it made no difference.
The metadata.opf in the library folders is a database backup for your books, it does not ever affect anything (except in the singular case of a calibre library Database Restore).
You want the content.opf in the ebook file, as viewed in the Editor.

Quote:
I also spotted that there is a content.opf file listed in contents when in Edit book mode, but changing that also made no difference
It should, unless the language is overridden later on, inside the individual html files.

The "lang" attribute can appear anywhere at all in the (x)html. See the w3schools guide to html language.
eschwartz is offline   Reply With Quote
Old 08-27-2015, 02:18 AM   #10
ColMac
Connoisseur
ColMac began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Apr 2012
Device: Kindle Fire
Thanks again to all for their input.

Quote:
Originally Posted by eschwartz View Post
The metadata.opf in the library folders is a database backup for your books, it does not ever affect anything (except in the singular case of a calibre library Database Restore).
You want the content.opf in the ebook file, as viewed in the Editor.
I had not appreciated the significance (or lack of) of the metadata.opf file. Thanks for explaining that.

Quote:
Originally Posted by eschwartz View Post
The "lang" attribute can appear anywhere at all in the (x)html. [/URL].
Going back to the first post, I had explained that

Quote:
I have searched "All text files for any lang codes, and the only one I can find is on the title page as follows.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

I have also searched for a GB text string and got no hits.
I've just checked this again. To confirm, there are no lang attributes in the content.opf file. There is one on the title page, and as advised, I changed it from "en" to "en-US". There are none in any other xhtml files.

Yet my spell checker (with US selected as preferred variant) lists all the words as English (GB).

Just in case, there is an error in that code, the whole line from the Titlepage.xhtml file is as follows

Quote:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
ColMac is offline   Reply With Quote
Old 08-27-2015, 02:56 AM   #11
ColMac
Connoisseur
ColMac began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Apr 2012
Device: Kindle Fire
Just spotted that I had used lower case for "us". have changed it now to "US" and still no difference.
ColMac is offline   Reply With Quote
Old 08-27-2015, 08:33 PM   #12
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@ColMac -- the books that you got from US sources -- if they are not copyrighted, is there a link to let someone else look at them?
phossler is offline   Reply With Quote
Old 08-28-2015, 12:06 AM   #13
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by ColMac View Post
Just spotted that I had used lower case for "us". have changed it now to "US" and still no difference.
This thread has been giving me a sense of deja vu. Searching back found https://www.mobileread.com/forums/sho...d.php?t=244207 which covers a lot this. I posted an order of language selection towards the end. From that, you should be able to work out where to define the language to get it correct.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
About language and spelling roger64 Editor 6 08-26-2014 12:22 PM
Controlling spelling language BobC Editor 9 08-06-2014 12:45 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


All times are GMT -4. The time now is 03:42 PM.


MobileRead.com is a privately owned, operated and funded community.