canmove, Confirmed users
1,570
edits
(Finalised spec as per comments.) |
|||
| Line 9: | Line 9: | ||
The first place is in the add-on's install.rdf file. The information here is used during install and by [https://addons.mozilla.org addons.mozilla.org]. This information is only present in one locale. | The first place is in the add-on's install.rdf file. The information here is used during install and by [https://addons.mozilla.org addons.mozilla.org]. This information is only present in one locale. | ||
The second place is in a localizable property e.g. <tt>extensions.<add-on id>.name</tt>. This can be used in the application after an extension is installed and is used in preference to the previous place since it is fully localizable. | The second place is in a localizable property e.g. <tt>extensions.<add-on id>.name</tt>. This can be used in the application after an extension is installed and is used in preference to the previous place since it is fully localizable, however these properties are only available when the add=on is installed and enabled. | ||
== New Requirements == | == New Requirements == | ||
The primary requirement here is that the localizable information must be available both in the application ''and'' to external users of the add-ons such as [https://addons.mozilla.org addons.mozilla.org]. This means that the localizable information should appear in a defined place inside the add-on xpi, preferably in the install.rdf file | The primary requirement here is that the localizable information must be available both in the application ''and'' to external users of the add-ons such as [https://addons.mozilla.org addons.mozilla.org]. | ||
A secondary requirement is that the localizable information must be available while the add-on is disabled. | |||
This means that the localizable information should appear in a defined place inside the add-on xpi, preferably in the install.rdf file since both AMO and the application already read their information from there. | |||
== Proposed Implementation == | == Proposed Implementation == | ||
| Line 21: | Line 25: | ||
=== Install Manifest Extension === | === Install Manifest Extension === | ||
It is proposed that a new property be added to the add-on's install manifest, <tt>em:localized</tt>. It will relate a set of localizable information to the add-on which can contain all the existing localizable information and in addition contains <tt>em:locale</tt> | It is proposed that a new property be added to the add-on's install manifest, <tt>em:localized</tt>. It will relate a set of localizable information to the add-on which can contain all the existing localizable information and in addition contains at least one <tt>em:locale</tt> property that marks which locales the information should be used for. The following is an example install manifest with most other properties removed for brevity: | ||
<pre> | <pre> | ||
| Line 57: | Line 61: | ||
</pre> | </pre> | ||
Note that when an <tt>em:localized</tt> exists for the required locale then all other localizable information is ignored. That means that if the <tt>em:localized</tt> does not have a description property then the add-on is considered to not have a description, regardless of whether a description is specified directly on the install manifest. | |||
=== Backwards Compatibility === | === Backwards Compatibility === | ||
| Line 74: | Line 68: | ||
It is suggested that add-on authors will want to continue using the localized properties in certain situations since that mechanism allows a third party locale pack to localize their add-on's metadata. | It is suggested that add-on authors will want to continue using the localized properties in certain situations since that mechanism allows a third party locale pack to localize their add-on's metadata. | ||
== Related bugs == | == Related bugs == | ||
* {{Bug|257155}} - Bug tracking this requirement. | * {{Bug|257155}} - Bug tracking this requirement. | ||