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 ;-).
July 26th, 2006 at 4:20 am
יצירת ×ž×™×œ×•× ×™ MySpell כהרחבות עבור פיירפוקס 2…
…
July 26th, 2006 at 9:34 am
Thanks Benjamin! Tested and works fine.
July 26th, 2006 at 1:09 pm
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.
November 8th, 2007 at 9:53 am
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).
HTH
Chris