Firefox doesn’t find system spell-checking dictionaries

22 Jan

Most software package maintainers usually expect people to use their pre-bundled versions of computer applications and this is a good thing for multiple reasons that stretch well beyond the scope of this article. Doing regular web development work, however, one soon realises that relying on the package release cycle of their operating system’s distribution for something as basic as their web browser can sometimes be not worth the risk of missing on new features or functionality that may have already become favourite to and deeply ingrained into the workflows of a critical mass of their target audience. Not being able to address these may thus prove to be a large mistake leading to too low retention rates of end-users.

This is the main reason why I decided to switch to the latest official Firefox version as published by Mozilla. However, I was initially unable to use the spell-checking dictionaries that are otherwise available in natively installed applications. Instead, I seemed forced to settle for those provided as Firefox Add-ons, which, quite honestly, often are simply not as good as the better maintained ones in the various distribution repositories.

So you, like me, did not want to wait for the newest Firefox version to make their way into your distribution and installed it manually, meaning that it does not support automatically using the spelling dictionaries provided by the system[1]. Therefore, if you want spell-checking to be enabled in the editor when you write on web forms, you will need to install such dictionaries separately. This is tedious, to say the least, and you can make use of the already configured ones. Luckily, Firefox understands Hunspell syntax and you can just use your distribution’s packages, normally called hunspell-XX-YZ where XX is the shortest available ISO 639 language code (usually 2 letters from the ISO 639-1 substandard) and YZ is an optional modifier for the language variant to be used that is available for some languages only. Some common examples:

  • German: hunspell-de-de (Germany), hunspell-de-at (Austria), hunspell-de-ch (Switzerland)
  • English: hunspell-en-gb (UK), hunspell-en-ca (Canada), hunspell-en-med (medical dictionary)
  • others: hunspell-bg (Bulgarian), hunspell-el (Modern Greek), hunspell-cs (Czech), etc

If you do not want to include any user-provided dictionaries from Mozilla’s website and prefer to use the same ones as in your other applications, you can build upon the following instructions[2]. You first need to find the Firefox installation directory, e.g. /opt/firefox/browser if you manually installed it directly in /opt. It should contain a subfolder components, and you can create shortcuts/symlinks to the respective *.dic and *.aff files of your favourite spell-checking dictionaries in a folder dictionaries alongside the latter.

In case you simply want to use all Hunspell dictionaries available system-wide, you can also just create dictionaries as a symbolic link to their shared location. Generally, you should issue something more or less like ln -s /usr/share/hunspell /opt/firefox/browser/dictionaries. Feel free to adapt it according to your needs. This does not stop you from installing Firefox-only dictionaries in the normal way since they are added as extensions although they are normally visible in a separate section of about:addons.

Because Hunspell is based on MySpell, it is also compatible with older MySpell dictionaries, so you can also use any of those for Firefox if you prefer so. One easy source of such dictionaries is the LibreOffice project, which uses the same spelling engine. You may also already have them if you use Apache’s OpenOffice.

[1]: as of 2017-01-22, cf. Bug #422399: should be able to use Linux system spell checker (like Enchant)
[2]: adapted from MozillaZine Knowledge Base’s article on how to install spelling dictionaries manually

Leave a Reply

Your email address will not be published. Required fields are marked *