View Single Post
Old 07-24-2020, 11:30 AM   #28
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
Yes it could quickly grep and check the html tag and body tag looking for an lang attribute to determine the primary language to do on the fly checking in for a specific xhtml file.

But as I explained, it can not easily do full on the fly red squiggly checking in multiple languages at the same time, when editing the file is being done.

When editing a file, the CV code may not even be parseable at some point. And language attributes need not be on the same line nor even close to the words being checked. They may be inherited from a div with a lang attribute that may be many many nodes above the current location (its great great grandparent). And a simple cut and paste may effectively change the language of a word.

So the red squiggly that is checking spelling on the fly would have to work only with fully parseable xhtml and would have to create and parse the DOM tree after every change.
That is a big overhead I am not willing to inflict on Sigil for so little real use or payback.
I hope people do know they can add known foreign words to a custom dictionary which works just fine when the number of second or third language words is smaller.

The only other approaches are checking in all used languages in that file, or just the primary used language when checking on the fly.

BetterRed likes the latter but I am a fan of the former.


That said.. since spell checking using the spellcheck dialog uses static pages and it can parse the complete page and properly extract all of the language attributes properly.

So unless someone can figure a way not to have to reparse a file after every single change and somehow properly determine the language of a piece of text with just local information, I do not yet see a workable solution for on the fly checking that I would be willing to integrate into Sigil.

Last edited by KevinH; 07-24-2020 at 11:34 AM.
KevinH is offline   Reply With Quote