How Do I Install New Dictionaries for Spell-Checking

Posted by ericp on 2007-09-21 10:38
Question: 

How do I install a new dictionary for Komodo's spell-checker, such as British English or German.

Answer: 

Komodo uses Mozilla's dictionaries. Each dictionary consists of two files, ln-LC.aff and ln-LC.dic, where "ln" is the language's two-letter ISO language code, and "LC" denotes its two-letter locale code. Komodo ships with the files en-US.aff and en-US.dic in the <komodo-install-dir>/lib/mozilla/dictionaries.

You can either copy existing Mozilla dictionaries from other programs, such as the <thunderbird-install-dir>/dictionaries directory, or find the dictionary you need at http://www.mozilla.com/en-US/thunderbird/dictionaries.html

Download the .xpi into a temporary directory, unzip it, and copy the .aff and .dic files to <komodo-install-dir>/lib/mozilla/dictionaries

Komodo should offer the new dictionaries in the Check Spelling dialog's Language drop-down bar. There is no preference to change dictionaries -- Komodo assumes that the most recent language is your preferred one, and remembers it.

One thing to keep in mind is that these dictionaries install into the program's installed area, not the profile area. This is a known bug with all Mozilla-based programs, and work is in progress to improve this on an overall basis -- the new spell-checkers will reportedly be faster, support more natural languages, and will be installed into the profile area. For now, when you migrate from version 4.2 of Komodo to a newer version, you'll have to manually copy the dictionaries over (unless the Komodo installer does that for you at that point).

pd | Fri, 2008-02-01 02:26

> This is a known bug with all Mozilla-based programs
I checked my Firefox 2.0.11 and Thunderbird 2.0.9 installations and found dictionaries under my user profile directory in: profile/<random string>/extensions/en-GB\@dictionaries.addons.mozilla.org/
Could that be make to work with Komodo profiles and what would be the directory to put it in then?

NB. The programs "dictionaries" directory contains only the stock US files, so it seems to really work.

ericp | Fri, 2008-02-01 11:40

It looks like we can drive the spellchecker module to look in
the Komodo profile area, not the installed program area. The
advantage of doing this is that when you upgrade Komodo, it will
copy your dictionaries from the old profile area to the new one.

I've written this up at http://bugs.activestate.com/show_bug.cgi?id=74629 --
you can CC yourself to follow progress, and possibly learn more about
Mozilla app internals than you thought you wanted to.

pd | Mon, 2008-02-04 02:35

Before I read your reply I made a quick testing by moving the en-GB dictionary directory from Firefox's user profiles extensions directory to the Komodo's and adding the "komodo compatibility" lines to the install.rdf
The dictionary is then shown in Komodo extensions, but is sited as "incompatible". But as I don't know anything about writing Mozilla/XUL extensions, I might have missed something. Or it might be a fundamental limitation of v4.2.1 of Komodo.

P.S. I will try to follw the bug thread you suggested :-)

ericp | Mon, 2008-02-04 10:07

Mozilla dictionaries are deployed as XPIs, but we currently aren't supporting
addon-style installation. Instead you need to follow the directions
given at the top of this FAQ. You can find a few more details at the
Mozilla knowledge base page:

http://kb.mozillazine.org/Dictionaries#Installing_manually_to_the_applic...

In your case you can copy the files en-GB.dic and en-GB.aff from the Firefox
profile area to Komodo's /lib/mozilla/dictionaries directory
and restart Komodo. Bring up the spellchecker, and the British dictionary
should now appear in the dropdown list of dictionaries in the dialog box.