56

I want Firefox to assume that text may be in a mixture of languages and words should be looked up in multiple dictionaries. (For example, everything in en-GB, en-US, ru, be and be-classic should be consider as good, everything else should be underlined and corrections from all dictionaries should be offered). Is there an add-on for "multi-language spell-check"?

Alternatively, can I merge all dictionaries into one big combined dictionary?

3
  • 1
    What Operating System are you on ? – Studer Feb 12 '10 at 20:56
  • GNU/Linux Debian (mostly squeeze) – Vi. Feb 12 '10 at 20:58
  • I also wish Firefox could do this. Not strictly an "answer," but you could try using Chrome, which does support multiple-language spell checking out of the box: google.com/support/chrome/bin/answer.py?hl=en&answer=95604. – Arthaey Jun 20 '11 at 18:26
26

I use French and English in almost all of my emails and this is a nightmare.

There is a (quite simple) solution, but you need to hack one of your dictionaries: copy-paste the content of e.g. your English dictionary into your French one; it works! As simple as that!

This is how I solved this issue on Mac OS X:

  1. Go to /Users/HERE_YOUR_USER/Library/Application Support/Firefox/Profiles (use Cmd-Shift-G if your Library folder is hidden), and select your profile folder (mine was default.uo0) and the extensions folder.

  2. You will see folders for each of your dictionaries (en-US@dictionaries.addons.mozilla.org and fr-classique-reforme1990@dictionaries.addons.mozilla.org in my case). In each main folder, a dictionaries folder.

  3. Copy the content of the .aff and .dic of one of your dictionaries into the .aff and .dic file of the other. Don't copy the first line in the .dic file; it's the word count!

Warning: in the .dic file, update the word count on the first line. It must be the number of lines of the file minus 1 (the first which is the word count).

  1. Restart Firefox! And now, vous pouvez taper en français et in English in the same text area!
7
  • Just did a cp extensions/en-gb@flyingtophat.co.uk/dictionaries/* extensions/pt-BR@dictionaries.addons.mozilla.org/dictionaries/ here. Didn't seem to work very well. How did you join the files exactly? – jpbochi Feb 19 '14 at 15:07
  • I had English and Ukrainian dictionaries (in this order). When I copied Ukrainian into English, it didn't work at all. But when I copied English into Ukrainian, it worked but I needed to remove SET ISO8859-1 before en-gb.aff, otherwise plurals and other forms would be marked. – oleksandr_yefremov May 7 '15 at 9:13
  • Bizarre, these dictionary folders are not in my profile folder... – bart Aug 21 '15 at 20:44
  • @François Thanks! That's an elegant solution. Do you have to do this over and over again with every update of Firefox? – ikashnitsky Nov 9 '15 at 18:40
  • @IIya nope, the dictionary is still bilingual after several Firefox updates. But don't update your dictionary ;) – François Dispaux Nov 17 '15 at 16:02
8

Unfortunately, I don't believe there is an easy solution to this. I use two different languages on a daily basis and the best (not ideal) solution is a combination of multiple dictionaries and an add on such as:

Dictionary Switcher or Quick Locale Switcher

Both of which present their own problems.

Another, less than ideal solution, is:

ImTranslator

Whilst it is a translator, it also supports multilingual spell checking.

2
7

Thanks François; this was inspiring. The corresponding solution in Ubuntu/Linux does the same for the hunspell. I wanted to combine my English dictionary with Hebrew, and I did this:

cd /usr/share/hunspell
sudo cp he.dic he.dic.bak
sudo cp he.aff he.aff.bak
sudo sh -c 'cat en_US.dic >> he.dic'
sudo sh -c 'cat en_US.aff >> he.aff'

(The sh -c is required since the append, >>, operation needs sudo privileges also). And of course fix the number of lines on the top of the .dic file like you said (count the lines using wc -l he.dic.

1
2

Thanks fidlr, this was inspiring. ;)

I wanted to do the same without using root rights for that. So I based my work on you and came to use the personal dictionary: Warning, my personal dictionary was empty, it will surely destroy yours if you have some data in here.

cd ~/.mozilla/firefox/*.default/
nbLines=$(wc -l < /usr/share/hunspell/fr_FR.dic)
cut -d/ -f1 /usr/share/hunspell/fr_FR.dic | tail -$(( --nbLines )) >> ./persdict.dat

I remove the first line of the dictionary, because it's the number of dictionary entries in the .dic file.

2
  • This is the only answer, that still works directly in Thunderbird 78.x. However, more processing may be needed; The persdict.dat file is "dumb" and lines are interpreted directly as words. By contrast, hunspell dictionaries contains flags separated by /, which need to be stripped, and different grammatical forms have to be generated. In my case I added the English dictionary to persdict.dat, and had to add plural variants and title-case variants separately. – kdb Jan 20 at 15:13
  • 1
    Also, for skipping the first lines it is easier to just use tail -n +2. – kdb Jan 20 at 15:14
2

Somewhat embarrassingly, I mixed up Thunderbird and Firefox. The method should work equally for both though, except that the firefox profiles are stored in ~/.mozilla/firefox, not ~/.thunderbird.


As of writing, most answers don't work straight forward or at all anymore. The closest is the recommendation to add content to persdict.dat, but the answer of Dolanor doesn't work straight forward with modern versions of spell checkers, because the dictionary files typically don't contain all variants of the words -- but rather rules how to form them from a dictionary of base forms.

What I did instead was to use the command

unmunch /usr/share/hunspell/en_US.{dic,aff}

to generate a list of all variants and append that to $HOME/.thunderbird/<PROFILEFOLDER>/persdict.dat. This should work for any language; In my case I am using a German dictionary in thunderbird, with en_US added to the persdict.dat file.

0

I found a hack that sort of works using the Firefox user dictionary.

You can manually add individual words to your personal user dictionary which will then not be marked as typos. You can also edit the file for it ('persdict.dat' within your Firefox profile folder) and add LOTS of words to it. I downloaded a dictionary list for my second language with 400k words and just paste it in the .dat file, which is essentially a text file you can open with any editor.

Now I can type in two languages without annoying spell check underlines.

0

Modifying dictionary no loner works (dictionaries are elsewhere than specified in answers and are signed, so no modification is possible). It is possible to add entries to persdict.dat - words that you add manually go there. To generate all possible words in polish on Linux close Firefox and use following command:

unmunch /usr/share/hunspell/pl_PL.{dic,aff} 2>/dev/null \
 | iconv -f iso-8859-2 -t utf-8 \
 > /home/mateuszzz/.mozilla/firefox/z2d3veoq.default-release/persdict.dat

I determined input encoding with program enca.

This still isn't full solution, as Capitalized variants of words are not generated and still treated as errors ("dobrze" is recognized as correct, "Dobrze" at beginning of sentence is not).

Warning: it is important to close Firefox before running this command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.