Skip to main content
All docs
V22.2

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 - This dictionary consists of two files: ISpell affix file (*.aff) and the Base Words (*.xlg or *.dict).
  • Hunspell / OpenOffice - This dictionary consists of two files: Hunspell affix file (*.aff) and the Base Words (*.dic).

You can use the following resources to find dictionaries compatible with the Spell Checker:

Install Dictionaries

This example describes how to add the French dictionary downloaded from the Open Office French Dictionaries extension.

Follow the steps below:

  1. Download the spelling dictionary extension you want to add to the Spell Checker, change the extension of the downloaded file to “.zip”, and unpack this archive.

  2. Create a new folder (in this example, “Fr-Fr”) for your new dictionary. The “dictionaries” subfolder contains .aff and .dic files, as shown in the screenshot below:

    spell-checker-french-folder

  3. Open the Editor | All Languages | Code Analysis | Spell Checker options page.

    spell-checker-options

  4. In the Dictionaries group, click the “+” button to add a new dictionary.

    add-dictionary

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

    add-dictionary-dialog

  6. 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:

    dic-path

  7. In the Options section, set the “Culture” setting to “French” to use the “Fr-Fr” dictionary instead of the built-in “En-Us” dictionary.

    path

    Note

    If you want the Spell Checker to use multiple dictionaries, set the “Culture” setting to “Invariant Culture”.

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

french-spelling-example

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:

Visua Studio option - Run code analysis in separate process

This enables the spell checker to display both a squiggly line under misspelled words and the Spell Checker context menu.