This paDieserge describes how to package a Hunspell spell check dictionary as a Firefox add-on, or how to update your existing add-on, so that it can be installed, uninstalled and updated without a restart.
Parts neededdictionary add-on, you first need two things:
- A spell check dictionary in Hunspell or Myspell format, with a license which allows you to use it. Such a dictionary consists of two files, one with a
.dicand one with an
- A locale code to describe the language of the dictionary. For example
da. It is important to choose the right locale code, or the spell checker will not be able to match the language of your dictionary against the language of a web page in order to select the right dictionary to use.
If you are creating a new dictionary, as opposed to updating an existing one, please make sure that there is not already a dictionary available for your locale. If there already is one, try contacting the author to get it updated, or contact AMO editors if the author does not respond.
A Firefox add-on is a ZIP file renamed to use an
.xpi file extension instead of the normal
.zip file extension. To create a dictionary add-on, simply create a ZIP file which contains the following files and folders:
.aff files must be placed in a subfolder named
dictionaries within the ZIP file. Both files must have the locale code as their file name. You also have to add a file named
install.rdf to the root of the ZIP file. This file contains information about your add-on such as name and version number (see below). In addition to these required files, you may add optional files, for example to give your add-on an icon or to describe the license of the dictionary.
Here is an example of the
install.rdf file. You can create and edit it with a plain text editor such as Notepad.
Other install.rdf metadata such as em:localized, em:description, em:creator,
em:developer, em:translator, em:contributor or em:homepageURL
<!-- Firefox -->
<!-- Thunderbird -->
<!-- SeaMonkey -->
There are some rules about how you should adapt the
- If you are creating a new dictionary add-on, we recommend that the
em:idconsists of your locale code followed by
@dictionaries.addons.mozilla.org, but if there is more than one dictionary for your language (for example the German "old spelling" versus "new spelling" dictionaries), you may need to choose another ID, that follows the rules of em:id. If you update an existing dictionary add-on, you must keep the existing
em:id, or your users will not be updated to the latest version.
em:versionshould follow the rules of Mozilla add-on version numbers, and if you update an existing dictionary add-on, the new version number must be greater than the old one.
- Don't change
em:unpack, and don't add a
em:bootstrapelement. Type = 64 indicates that the add-on is in the restartless format, and unpack is required for Hunspell to read the dictionary.
- Although the restartless format for dictionary add-ons were introduced in Gecko 10, dictionary updates only works starting from Gecko 18. The
em:minVersionshould therefore be the same as in the example above (or greater). If you set
em:minVersionto a lower value, Gecko 10-17 will not be able to update your dictionary add-on once the restartless dictionary is installed (bug 782118), and Gecko 10-16 may warn the user that your dictionary is not compatible, when users try to update to a newer version of Firefox/Thunderbird (bug 782115).
- Update the
em:maxVersionto the greatest versions available.
Once you have added these files to your ZIP file and renamed the file to have the
.xpi extension, you can install your add-on in Firefox and test it. After a successful test, you can upload your add-on to addons.mozilla.org and ask for it to be included in the Dictionaries & Language Packs page.