Predelnik / DSpellCheck

Notepad++ Spell-checking Plug-in
GNU General Public License v2.0
198 stars 32 forks source link

Language-Based Options When Adding Word to Dictionary #345

Open aksarben opened 2 months ago

aksarben commented 2 months ago

When spell checking HTML documents, can you make the context menu for adding a word for a dictionary take into account the language of the text being checked? Or is this functionality available already and I haven't found it?

I have a very large Web site (over 16K pages), and the most pages have text in multiple languages. HTML lets authors specify the language for the overall page and individual page elements, but DSpellCheck ignores these language tags and only offers to add words to a single dictionary.

As a result, my English language dictionary is becoming bloated with hundreds (maybe thousands) of non-English words, because I can’t tell DSpellCheck to add the word to a different dictionary.

Details:

The first element of an HTML page normally shows the default language for the page:

<html lang="en-us">

Elements on an HTML page using a non-default language would use a lang tag to so indicate. For example, a German word or phrase on an English language page would look like this:

The music for <span lang="de">Ode an die Freude<span> comes from Beethoven’s 9th Symphony.

The World Wide Web Consortium, which sets HTML standards, explains that one reason language tags are availalble is so spell checkers can determine which dictionary to look in. See https://www.w3.org/International/questions/qa-lang-why.

Predelnik commented 1 month ago

Unfortunately it won't be easy to parse those tags, currently plugin uses only syntax coloring to determine whether certain part should be spell-checked or not. Adding knowledge about more precise file structure would require quite a bit of work.