Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files names for custom dictionaries #204

Open
Durimar opened this issue Dec 9, 2019 · 1 comment
Open

Files names for custom dictionaries #204

Durimar opened this issue Dec 9, 2019 · 1 comment

Comments

@Durimar
Copy link

Durimar commented Dec 9, 2019

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.

@EWSoftware
Copy link
Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants