Predelnik / DSpellCheck

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

Language matching when set from API-call #339

Closed ffes closed 3 months ago

ffes commented 3 months ago

The languages I have downloaded and installed are en_US and nl_NL. But the sources I have to set the language only provide en or nl.

So when I parse the sources I have, I only have the two char language code and not the 5 char that is needed. For now I renamed the Hunspell files from en_US.* to en.* to make it work and did the same for the Dutch language files.

I see two possible solutions.

Either have a extra message to get all the available languages. This way the plugin that wants to set the language can do its magic to make sure the language is set.

Or when the message is sent to DSpellCheck, DSpellCheck should do the magic and recognise that en is the same as en_US.

ffes commented 3 months ago

Another work-around could be to iterate through NPPM_GETPLUGINSCONFIGDIR/Hunspell/*.dic to see what languages are available.

Predelnik commented 3 months ago

I think providing list of languages is the easiest way, it's a bit annoying to do with C API though, wonder if C++ API would be suitable as well.