Intellij IDEA, Cucumber and German Spell Checking

Now that Intellij IDEA (12.1.3 in my case) supports auto completion & syntax highlighting for cucumber features not only in english but also in any other language that is available for gherkin it would be nice to have native spell checking as well.

To use your native language with cucumber you just have to place a language comment at the first line of your feature file. For example see this super useful feature description:

# language: de

Funktionalität: deutsche Feature-Beschreibungen
  Um cucumber in unserer Muttersprache zu benutzten
  möchte ich als Szenario-Schreiber
  die deutschen Schlüsselwörter benutzen

  Szenario: deutsche Schlüsselwörter & Steps
    Angenommen ich schreibe eine Feature-Beschreibung
    Wenn ich die deutschen Gherkin-Schlüsselwörter benutze
    Dann werden die deutschen Steps aufgerufen

To get spell checking for an additional language in IntelliJ we need to add a dictionary for that language. This is done in a few simple steps:

  • first, we need a dictionary for our language. This is a plain text file with a lot of words, each on a single line. I found a german dictionary on sourceforge.
  • second, we need to make sure it is encoded in utf–8. The german.dic file was encoded in latin–1. If it is not encode in utf–8 use your text editor of choice (e.g. Notepadd++ or TextWrangler or …) and convert it to utf–8 (no BOM).
  • third, create a folder (e.g. dictionaries) where you want to save the dic file
  • fourth, tell IntelliJ about the dictionary folder following the documentation, which is in short:
    1. open the Settings dialog
    2. type ‘spell’ into the search box and select Spelling
    3. switch to the Dictionaries tab
    4. and add the folder to the Custom Dictionaries Folder list

You should see now the dictionary under Dictionaries as a user dictionary and the checkbox enabled.

That’s it, no more typos in the features :-)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s