Localize extension descriptions: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
No edit summary
(No difference)

Revision as of 07:25, 28 June 2005

This page is part of the extension development documentation project.

Ask your questions in MozillaZine Forums. Also try browsing example code.

Note: development documentation is in process of being moved to Mozilla Development Center (MDC).

To localize the description of an extension, you need to use a special preference key to override the description specified in your install.rdf file. This name of this preference key is "extensions.{app_guid}.description", where "app_guid" is the GUID string that is unique to each extension.

Below are instructions on how to modify this preference key. These instructions require knowledge of how to use the default preferences file in your extension package.

Instructions

  1. Create your default preferences file, if you don't already have one yet.
  2. Add the preference key "extensions.{app_guid}.description" to it.
  3. Set the value of the preference key to be the URL of a localized properties file. (e.g., "chrome://my_app/locale/names.properties")
  4. Create or edit the corresponding localized properties file.
  5. Add a new name-value pair to the properties file with the name also set to "extensions.{app_guid}.description" and the value set to the description of your extension.

Example

If all goes well, your preferences file (defaults\preferences\prefs.js) may look like this:

pref("extensions.{abcdef01-1234-abcd-1234-012345abcdef}.description", "chrome://my_app/locale/names.properties");

And your localized properties file (chrome://my_app/locale/names.properties) may look like this:

extensions.{abcdef01-1234-abcd-1234-012345abcdef}.description = Plays a sound when the time has come to shine.