How to: Add a Dictionary to the Spell Checker
- 3 minutes to read
The Spell Checker includes an English (U.S.) built-in dictionary against which misspellings are compared. Dictionaries for other languages can also be added to the Spell Checker.
Dictionaries for the Spell Checker
The Spell Checker supports the following types of dictionaries:
- ISpell
- Dictionaries are available at the following location: ISpell Dictionaries. A dictionary consists of two files: ISpell affix file (*.aff) and Base Words file (*.xlg or *.dict).
- Hunspell
- Dictionaries are available at the following locations:
- Firefox add-ons. Download a spell checker file for the desired language, change the file extension from
.xpi
to.zip
, and extract thedictionaries
folder. - OpenOffice extensions. Download an extension file for the desired language, change the file extension from
.oxt
to.zip
, and extract thedictionaries
folder. - LibreOffice Dictionaries Repository
- Collection of Hunspell Dictionaries
Note
We do not provide dictionaries and are therefore not liable for any inaccuracies, deficiencies, or incompatibilities that may arise from the use of third-party dictionaries, including but not limited to the availability of the dictionaries in the specified formats.
Install Dictionaries
This example describes how to add the French dictionary downloaded from the Open Office French Dictionaries extension.
Follow the steps below:
Download the file with the .oxt extension, change its extension to “.zip”, and unpack this archive. The archive includes the
dictionaries
folder with.aff
and.dic
files.Open the Editor | All Languages | Code Analysis | Spell Checker options page.
In the Dictionaries group, click the “+” button to add a new dictionary.
In the Add Dictionary dialog, enter the dictionary name, choose its type from the drop-down list (“Hunspell/OpenOffice dictionary (.dic + .aff)” for this example), and click OK.
Select the newly added dictionary in the Dictionaries list. Specify the following settings for this dictionary:
1) Click the ellipsis button in the Grammar path field, and select the *.xlg or *.aff dictionary file.
2) Click the ellipsis button in the Dictionary path field and select the *.dic dictionary file.
3) Choose the encoding of the dictionary text files from the drop-down list (supplied by the dictionary source).
4) Choose the dictionary culture.
The following screenshot shows the configured “Fr-Fr” dictionary:
In the Options section, set the “Culture” setting to “French” to use the “Fr-Fr” dictionary instead of the built-in “En-Us” dictionary.
Note
If you want the Spell Checker to use multiple dictionaries, set the “Culture” setting to “Invariant Culture”.
Click Apply and OK to save these changes and close the Spell Checker options page.
CodeRush allows you to save changes to a specific settings layer. For more information, see the following topic: Save Options to a Specific Layer.
The Spell Checker uses the “Fr-Fr” dictionary to check spelling inside the code editor.
In the following screenshot, the Spell Checker checks comments (the “Comments” option is enabled in the Context section of the Spell Checker options page):
Note
Make sure that the option “Run code analysis in a separate process“ in the Tools → Options → Text Editor → C# → Advanced option page is turned off:
This enables the spell checker to display both a squiggly line under misspelled words and the Spell Checker context menu.