Dictionaries in Firefox/Thunderbird 2

I recently committed a patch which allows spellchecker dictionaries to be packaged up as extensions in Firefox 2. To test this patch, I created (by hand) a French dictionary extension, but never really posted how to create this kind of extension in general. To rectify this, and promote creating this new kind of extension for inclusion on addons.mozilla.org, I have created a simple webtool that will create an extension from uploaded dictionary files: dictionary-packager. Source is available if you want to run it on your own server.

I chose to write this as a webtool instead of a XULRunner app because we don’t have zipwriting capabilities yet in the Mozilla platform, and I was lazy and knew how to do this easily in PHP ;-).

Atom Feed for Comments 4 Responses to “Dictionaries in Firefox/Thunderbird 2”

  1. לינמגזין Says:

    יצירת מילוני MySpell כהרחבות עבור פיירפוקס 2…

  2. Toniher Says:

    Thanks Benjamin! Tested and works fine.

  3. dietrich ayala Says:

    I hope you have register_globals turned off, or that “exec(rm -rf $globalvariable)” bit could be bad. I’d suggest hard-coding the path to anything passed to that command, or just overwrite the temp files every time and remove the rm calls altogether.

  4. Chris Says:

    Thanks for the script, but it didn’t work for me right out of the box (crashed with Error Processing Form Language code must be ab[-CD[-modifier]] regardless what I entered in the language code field). I fiddled around with the post.php to get it running locally and I guess that you forgot some bracket in this line:

    $locale_pattern = ‘/^[a-z]{2,3}(-[A-Z]{2,3})?(-[a-z]{2,3})?$/’;
    should be
    $locale_pattern = ‘/^([a-z]{2,3})(-[A-Z]{2,3})?(-[a-z]{1,4})?$/’;
    (the modifier could be 1 to 4 characters long).



Leave a Reply