View Single Post
Old 01-24-2020, 10:14 AM   #5
KevinH
Wizard
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: 4,203
Karma: 2621090
Join Date: Nov 2009
Device: many
Okay did some snooping and Chrome does NOT support the lang or xml:lang attribute at all.

See this bug report closed as won't fix:

https://bugs.chromium.org/p/chromium...tail?id=389498

That aside, they do have a "all-languages" spellcheck feature that will ignore the lang attributes as well but will check each word in all language pack dictionaries that the user installed. That way you can mix in words from more than one language and if it is correct in any of them it is considered correct.

The problem is of course then if you have both German and English dictionaries installed, it
will think that the following sentence is correct:

"He poked me in the ein."

Since "ein" is a valid word in German.

The only way around this would be completely write our own spellcheck parser that will parse each web page's DOM tree and assign a language code to each word parsed and to use that language code to decide which dictionary the word should be checked against.

This is NOT something on my to-do list for PageEdit at all.

In Sigil's CodeView, being able to support multi-language spellchecking that follows the lang attribute of a tag is not that hard.

The problem comes when you try doing spellchecking on-the-fly as someone writes/edits the code. This happens because syntax highlighting (which includes spellchecking) is handled on a line by line basis and would need to keep a stack of beginning and ending language regions that cross lines dynamically on the fly along with the fact that a single line may hold words from multiple languages.

Supporting multi-language spellchecking (via a spellchecking tool - not on the fly during dynamic editing that observes and uses the xml:lang or lang attributes *IS* still on my To-Do list for Sigil and will come sometime later.
KevinH is offline   Reply With Quote