This article provides details on how to go about localizing the descriptions of Mozilla add-ons, as well as for other metadata about your add-on. Because a new method for doing so was implemented in Gecko 1.9 (Firefox 3), there are two sets of instructions below.

Localizing in Gecko 1.9

Gecko 1.9 includes a new, more robust method for localizing add-on descriptions and other metadata. All of the different descriptions now appear in the install.rdf file using em:localized properties. Each has at least one em:locale property marking the locale that the information should be used for and then all the various strings for the locale. The following example demonstrates this (most normal manifest properties have been removed for brevity):

All of the metadata mentioned below can be localized in this way. The localization information provided by the em:localized property can be overriden using a set of localized preferences as detailed below.

The process for selecting the em:localized property to use for a given locale is as follows:

If a property exists with an em:locale that matches the locale exactly, then use that.

If we have inexact matches then use the one with the most matching parts, parts being separated by a dash (e.g., es would match for es-ES and vice versa).

If there is more than one locale with the same number of matching parts, then use the most general one (e.g., en in preference to en-GB when searching for en-US).

The current app locale will be searched for and then there will be a fallback search for en-US.

If a preference isn't set and there isn't a matching em:localized property for the current locale or en-US, then the properties specified directly on the install manifest are used as a last resort, as they were always used before Gecko 1.9.

Localizing before Gecko 1.9

Before Gecko 1.9, add-on developers must go through a special process to define localized add-on descriptions for add-ons targeting toolkit-based apps (such as Firefox or Thunderbird).

If you do not currently have them, create localized properties files. Make sure to use UTF-8 encoding (without BOM) to ensure foreign characters display correctly.

Add the following line to each of your localization properties files (where EXTENSION_ID matches your extension ID (<em:id> from install.rdf) and LOCALIZED_DESCRIPTION is the description of your extension that you want to appear in the given language):