VSSpellChecker icon indicating copy to clipboard operation
VSSpellChecker copied to clipboard

Files names for custom dictionaries

Open Durimar opened this issue 5 years ago • 1 comments

For now, custom dictionary file name may by only in format <lang>_<Culture>.aff If i try to use file name like this - <lang>_<Culture>_<some_description>.aff VSSpellChecker don't see the dictionary.

My suggestion: the name of the files should begin with a two letter prefix for the language code, followed by an underscore or hyphen, then two letters that indicate the country code, followed by another underscore or hyphen, and then a descriptive name (for example, en_US_medical.dic for a medical dictionary in the US version of the English language, or for a less specific English medical dictionary, you could omit the country code like this: en_medical.dic).

Thanks for good extention.

Durimar avatar Dec 09 '19 08:12 Durimar

Language names can vary in the number of parts (en-US, arn, az-Cyrl, az-Cyrl-AZ, az-Latn, az-Latn-AZ, etc.). As such, it can't assume that it's only one or two parts. What I can do is start with the full filename without the extension as it currently does and, if it doesn't match a language name, strip off the last part after a dash or underscore an try again and repeat until it runs out of parts. If a match is found, the unused part(s) can be used as a suffix on the display name to keep the dictionaries unique.

However, that introduces the ability to have multiple dictionaries for the same language which is not currently supported internally so there is quite a bit of rework involved to support that. It can be done but will take some time to ensure it's done properly.

Since it's touches so much, I will probably address asynchronous loading of dictionaries at the same time (issue #139).

EWSoftware avatar Dec 09 '19 16:12 EWSoftware