94

IntelliJ spellchecker comes with only English and Arabic bundled (strange, I think it is made in east Europe, they didn't even bundle their language?).

My customer is German so all my code is mixed English (code)/German (interface) and I can't find a German dictionary for IntelliJ.

mahan
  • 12,366
  • 5
  • 48
  • 83
nraynaud
  • 4,924
  • 7
  • 39
  • 54

9 Answers9

100

Current IDEA versions load dictionaries in UTF-8, you don't need to convert them to the platform encoding, ignore the iconv step below.

The dictionary can be produced using aspell for Unix/Mac OS X or under Cygwin. You need to have aspell and appropriate dictionary installed.

Here is the example for Russian dictionary I've used:

aspell --lang ru-yeyo dump master | aspell --lang ru expand | tr ' ' '\n' > russian.dic

For German it would be:

aspell --lang de_DE dump master | aspell --lang de_DE expand | tr ' ' '\n' > de.dic
leonheess
  • 16,068
  • 14
  • 77
  • 112
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • thanks for the answer, I see that I got the right person :) I'm on mac and it looks like aspell is not included. In the end I took the dic from this plugin : http://plugins.intellij.net/plugin/?&id=1658 and converted the charset to macroman. But it looks like german is not a good language for dictionaries of this kind, many of my insurance-related words are unknown. – nraynaud Dec 23 '09 at 06:48
  • That dictionary is in UTF-8, could be a conversion or encoding issue. I'd recommend to wait for the next IDEA update with the new Spellchecker plug-in. Aspell for Mac can be installed separately: http://docs.moodle.org/en/Configuring_aspell_on_Mac_OS_X . – CrazyCoder Dec 23 '09 at 09:32
  • IDEA 9.0.2 EAP (build 94.585) should handle UTF-8 dictionaties fine, give it a try: http://confluence.jetbrains.net/display/IDEADEV/Maia+EAP. – CrazyCoder Mar 17 '10 at 19:36
  • On Ubuntu 10.10 with IntellijIDEA 9.0.4 this command for getting the russian dict file with "yeyo" support: aspell --lang ru dump master | aspell --lang ru expand | tr ' ' '\n' > russian.dic – Grigory Nov 19 '10 at 01:00
  • 5
    For some languages, the generated dictionary can be really big. E.g. I tried to generate dictionary for Hungarian language - and I stopped the process when the dictionary file reached the 3G. For smaller (but, of course, lesser useful) dictionary I created dictionary with `aspell --lang hu dump master | cut -d/ -f1 > hungarian.dic`. Smaller, but enough for some usages. – Gabor Garami Nov 21 '12 at 23:36
  • the language code 'de' did not work for me. For german, I had to use 'de_DE' (DE for Germany). There is also 'de_AT' and 'de_CH' (for Austria and Swiss). – stackunderflow May 10 '19 at 06:36
  • NB: path has to be set up to aspell command line in win10; the exe seems not be in path – netalex Jan 24 '20 at 11:27
  • 3
    The command for german should be `aspell --lang de_DE dump master | aspell --lang de expand | tr ' ' '\n' > de.dic` ("--lang de" instead of "--lang de_DE" after the first pipe) -- Otherwise I am getting an error because **/usr/lib/aspell/de_DE.dat** does not exist (**de.dat** does exist). – ph_0 Feb 03 '20 at 10:59
  • 1
    this modification worked for me `aspell --lang=de dump master | aspell --lang=de expand | tr ' ' '\n' > de.dic` and I had to install de language before with `sudo apt install aspell-de` – Oleg Abrazhaev Aug 19 '20 at 13:07
58

I downloaded the ASCII spanish dictionary from this page, you would of course use your preferred language. Then I copied the included .dic file to my project folder and it worked without any change.

There are many other languages than spanish.

I get this info from this archived page,

who included additional details and format conversions that I didn't need.
Troglo
  • 1,497
  • 17
  • 18
  • 5
    and dont forget to change the encoding. It doesnt work if it's not utf-8 – Ricardo Martins Oct 02 '14 at 13:52
  • 3
    Despite the name, the *ASCII* version contains Spanish characters (looks like ISO-8859-1/Windows-1252). Both versions ("ASCII" and "Unicode") seem to work fine as long as you re-encode them as **UTF-8**. – Álvaro González May 12 '15 at 12:08
  • 2
    the dictionnary I downloaded had utf-16 format. Worked fine after changing the encoding to utf-8 – maxbellec Jul 25 '16 at 08:27
19

This is based on all answers from here but including all the steps. I'm on Mac OS X (I think it will work on linux as well, except aspell installation) and I want the spanish dic

Only execute on terminal those lines that start with $ symbol

  1. Install aspell:

    $ brew update
    $ brew install aspell
    
  2. Download Aspell dic from their official repo

  3. Extract tar.bz2 file
  4. Go to extracted directory using terminal

    $ cd Downloads/aspell6-es-1.11-2
    
  5. Compile and install dic.

    $ ./configure
    Finding Dictionary file location ... /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60
    Finding Data file location ... /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60
    $ make
    /usr/local/bin/prezip-bin -d < es.cwl | /usr/local/bin/aspell  --lang=es create master ./es.rws
    $ make install
    mkdir -p /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60/
    cp es.rws castellano.alias es.multi espanol.alias spanish.alias /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60/
    cd /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60/ && chmod 644 es.rws castellano.alias es.multi espanol.alias spanish.alias
    mkdir -p /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60/
    cp es.dat es_affix.dat /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60/
    cd /usr/local/Cellar/aspell/0.60.6.1/lib/aspell-0.60/ && chmod 644 es.dat es_affix.dat
    
  6. Create the .dic file using:

    $ aspell -l es dump master | aspell -l es expand | tr ' ' '\n' > es.dic
    
chachan
  • 2,382
  • 1
  • 26
  • 41
  • this is the only answer that works for me in 2016 on a Mac. Use Editor > Spelling in IntelliJ's preferences to install the *.dic file. – Stefan Haberl Mar 25 '16 at 08:53
  • Can we do the same using hunspell? – SalahAdDin Jun 03 '16 at 15:58
  • Link with `ftp://`is wrong (or will simply download 0index.html); http://ftp.gnu.org/gnu/aspell/dict/0index.html is the overview page to select your language. – Christian Ulbrich Dec 07 '19 at 14:44
  • Brew also works in linux, install it with `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` – Cadoiz Oct 26 '22 at 09:42
15

Download a .dic from wherever you want (example). Then go to File > Settings > Spelling. There open the Dictionaries tap and add the path to the folder where you have saved the .dic in. It will auto-detect any .dic inside that folder. Apply.

banan3'14
  • 3,810
  • 3
  • 24
  • 47
Xhark
  • 781
  • 1
  • 9
  • 24
8

Converting a Unicode dict to UTF-8 did the trick for me (sample for German / Linux computer):

NOTE: the converted german-dict can be downloaded here (<- already working).

If you need an other language please follow these steps:

  1. (Just in case) If you have already linked .dic-files in IntelliJ, please remove them temporary by pressing the red minus in the settings.

  2. Get your UNICODE(!) dictionary from here.

  3. Now convert it to UTF-8, so IntelliJ will accept it:

    ~/Downloads/de_neu $ iconv -f UNICODE -t UTF-8 de_neu.dic > de_neu_utf8.dic

  4. Go to File > Settings > type "dict" in the search and click Dictionaries > click the green plus and add the folder where "de_neu_utf8.dic" is stored.

  5. Click OK, and you should be good to go. :)

Oliv
  • 10,221
  • 3
  • 55
  • 76
Martin Pfeffer
  • 12,471
  • 9
  • 59
  • 68
  • im running git bash on windows but it seems it does not support `UNICODE` `iconv: conversion from UNICODE unsupported` – Peter Nov 03 '17 at 13:22
5

My PyCharm came bundled with a plugin called "Grazie". ("Provides intelligent spelling and grammar checks for text that you write in the IDE.")

You could find (or install) it under:

Preferences -> Plugins.

With that you can setup your language under:

Preferences -> Editor -> Proofreading

Screenshot of the proofreading section to add languages

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Timbo
  • 81
  • 1
  • 2
  • 2
    @snakecharmerb PyCharm is basically a special version of IntelliJ, so things that work or exist for PyCharm, are very likely to exist for IntelliJ as well. – Mark Rotteveel Jan 27 '21 at 17:16
  • 1
    In other versions of the plugin, it is Settings → Editor → Natural Languages – Michael2 Nov 04 '21 at 11:12
  • @Michael and OP Unfortunately, neiter does "Settings → Editor → Natural Languages", [nor do the subpoints "Spelling"/"Grammar" exist in my Jetbrains (ultimate Edition)](https://i.stack.imgur.com/nlsCu.png): Can you help me? – Cadoiz Oct 26 '22 at 09:32
3

Hunspell dictionaries support was added recently to Intellij platform.

You may install Hunspell plugin to your IDE and you will be able to add any hunspell dictionary to IntelliJ spellchecker as it is, no additional dictionary transformations are required in this case

Hunspell dictionaries can be found at:

  1. GitHub repos (https://github.com/wooorm/dictionaries, https://github.com/titoBouzout/Dictionaries)
  2. SCOWL collection: http://wordlist.aspell.net/dicts/
  3. OpenOffice extensions: http://extensions.services.openoffice.org/en/dictionaries
  • 1
    Hunspell is official plugin from the JetBrains. It is mentioned in the IntelliJ documentation (see [Custom Dictionaries](https://www.jetbrains.com/help/idea/spelling.html) section). Unfortunately I was unable to make it work. – Ilya Serbis Jan 17 '19 at 16:22
  • See https://youtrack.jetbrains.com/issue/IDEA-210183 Yes it's extremely annoying that those ... hm RUSSIAN developers haven't implemented PROPER Russian support.. Please upvote for that issue.. – Rules Apr 02 '19 at 02:06
1

I found some useful dictionaries here on WinEdt website. They need some reformatting :on my computer, I had to replace \r by \r\nin the .dicfile, then encode it in UTF-8 using Notepad++.

Marecky
  • 1,924
  • 2
  • 25
  • 39
Benj
  • 1,184
  • 7
  • 26
  • 57
1
  1. Install the Hunspell plugin to your IDE
  2. Find your language dictionary in https://github.com/LibreOffice/dictionaries
  3. Download the .dic file that contains the list of words, and the .aff file that's a list of language rules
  4. On your IDE Settings/Preferences dialog Ctrl+Alt+S, select Editor | Proofreading | Spelling
  5. Add both files at the custom dictionary list
Zzaly Oreo
  • 31
  • 1
  • 4