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 03-19-2017, 01:14 PM   #1
LCA
Junior Member
LCA began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2016
Device: calibre
Setting spelling language variant on tag level

I would like to control the spelling language variant on tag level, eg to set the spelling for a citation with German old spelling (language tag is de-1901, new spelling would be de-1996), I would write:

<span lang="de-1901">daß Fluß etc.</span>

and neither "daß" nor "Fluß" should show as errors.
But that does not work.

Any help?
LCA is offline   Reply With Quote
Old 03-19-2017, 10:49 PM   #2
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
I have done this for French or other languages in dialog in English books. It does work. But, you need to have a dictionary for the language installed.
davidfor is offline   Reply With Quote
Advert
Old 03-19-2017, 10:55 PM   #3
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
And you need to use language codes from the ISO 639 standard. I dont think de-1901 is in that standard.

Your best bet would be to use completely unrelated language code with a dictionary installed for it while spellchacking and after it is done, change it back to de-1901 with a search and replace.
kovidgoyal is offline   Reply With Quote
Old 03-20-2017, 04:01 AM   #4
LCA
Junior Member
LCA began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2016
Device: calibre
It does work for ISO639 language codes like "de" or "fr" but apparently does not take account of codes with variant tags like "de-1901" or "de-1996" according to RFC 1766 and RFC 5646. The codes "de-1901" (German, old spelling) and "de-1996" (German, new spelling) are ok (see here; they are mentioned in RFC 5646, too).

Now, it happens that a text in the main part complies with new spelling, but contains citations using the old spelling. For both spelling variants dictionaries are installed in Calibre (new spelling as "dic-0SKY2G" and old spelling as "dic-1MYkc4") and there is a mapping

"preferred_dictionaries": {
"deu-DE": "dic-0SKY2G"
}

in prefs.json. What would be needed is a way to let the code "de-1996" map to "dic-0SKY2G" and "de-1901" map to "dic-1MYkc4".

@Kovid: I do not see how to follow your suggestion. Should I install a dictionary I would not use (e.g. Khmer) and copy the files from the German variant to the corresponding directory under ~/config/calibre/dictionaries? That would be an ugly hack.

In general, a situation as described above is IMHO not exotic but quite common. For instance, a scientific text would have the main part in American English but may contain lengthy verbatim citations in British English. So both language variants would be needed simultaneously.
LCA is offline   Reply With Quote
Old 03-20-2017, 05:59 AM   #5
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
Country variants are supported fine, from ISO 3166. Historical variants not so much. Which is why I suggested simply using a trick for your rather specialized use case.
kovidgoyal is offline   Reply With Quote
Advert
Old 03-20-2017, 07:02 AM   #6
LCA
Junior Member
LCA began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2016
Device: calibre
Ok. Thanks for the hint. I have now in the folder with the old spelling changed the filenames:

de-DE.aff → de-AT.aff
de-DE.dic → de-AT.dic

and in the file locales there changed:

de-DE →de-AT

Using language designation "de-DE" for new and "de-AT" for old spelling seems to work. Thanx!
Changing the language in content.opf seems to require a restart of the editor.
LCA is offline   Reply With Quote
Reply

Tags
language code, spelling


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 CODES: variant forms of spelling chaot Workshop 19 02-03-2017 06:59 PM
Spelling language ColMac Editor 12 08-28-2015 12:06 AM
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
DR800 How can I change zoom level setting? Spectrum iRex 0 05-21-2010 10:14 AM


All times are GMT -4. The time now is 06:20 AM.


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