Friday, November 1, 2013

Ubuntu, Firefox and all those useless dictionaries

So, you got Ubuntu installed in your computer, made your personal customizations and everything seems to be fine.

Well, that until you start using spell checking with Firefox and/or Thunderbird and discover that you haven't exactly tamed those animals.

For default, Ubuntu seems to install lots of dictionaries for both programs. If it's language settings include, for example, Portuguese and English, you will got spell checking with both languages in Firefox and Thunderbird, but probably not exactly what you want: when you click if your right mouse button in your text in progress, you will discover that English spell checking will take you four different English options, one for a different country. If you're coming from a upgrade or restore a previously used backup, then probably you'll get repeated options.

Fortunately, you can get rid of those country-specific dictionaries, but configuration for it will not be available in Firefox or Thunderbird.

Open up a terminal session and check out the commands output below:

youruser@yourhost:~$ ls /usr/lib/firefox/dictionaries
en_AU.aff  en_AU.dic  en_GB.aff  en_GB.dic  en_US.aff  en_US.dic  en_ZA.aff  en_ZA.dic  pt.aff  pt_BR.aff  pt_BR.dic  pt.dic  pt_PT.aff  pt_PT.dic

This list shows all dictionaries installed to Firefox. If you look for the same thing in the thunderbird folder of Thunderbird e-mail program, you'll see a similar output.

Let's remove them and configure dpkg to not install new files then, but move then to other location instead, which is a nice way to avoid the files to be restored every time you upgrade Firefox and/or Thunderbird.

youruser@yourhost:~$ sudo rm -f /usr/lib/firefox/dictionaries
[sudo] password for youruser:


youruser@yourhost:~$ sudo dpkg-divert --add /usr/lib/firefox/dictionaries 
Creating 'local diversion from /usr/lib/firefox/dictionaries to /usr/lib/firefox/dictionaries.distrib'

Restart Firefox and/or Thunderbird. If you got no dictionary after that, don't worry: just go to Tools -> Complements menu options and install your desired dictionaries. After that, you probably won't need to worry about those settings again until you got a fresh setup of Ubuntu.