Localized metadata fails for multiple properties (contributor, translator, developer)

RESOLVED FIXED in mozilla1.9alpha7

Status

()

Toolkit
Add-ons Manager
--
major
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: mossop, Assigned: mossop)

Tracking

({dev-doc-complete})

Trunk
mozilla1.9alpha7
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

11 years ago
There's a problem which stops the localizable property values for the multiple choice properties from being retrieved.
(Assignee)

Comment 1

11 years ago
Created attachment 270323 [details] [diff] [review]
patch rev 1

Have to return an array of resources rather than an enumerator of resources from rdfGets.

We could alternatively make GetTargets handle an enumerator return rather than converting the enumerator to an array then wrapping with an ArrayEnumerator. But that muddies the API a little.
Attachment #270323 - Flags: review?(robert.bugzilla)
Comment on attachment 270323 [details] [diff] [review]
patch rev 1

>Index: toolkit/mozapps/extensions/src/nsExtensionManager.js.in
>===================================================================
>RCS file: /cvsroot/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in,v
>retrieving revision 1.223
>diff -u8 -p -r1.223 nsExtensionManager.js.in
>--- toolkit/mozapps/extensions/src/nsExtensionManager.js.in	25 Jun 2007 21:38:19 -0000	1.223
>+++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in	29 Jun 2007 13:39:05 -0000	
>@@ -8157,23 +8157,27 @@ ExtensionsDataSource.prototype = {
>    *    extensions.{GUID}.[contributor].1
>    *    extensions.{GUID}.[contributor].2
>    *    extensions.{GUID}.[contributor].3
>    *    ...
>    *
>    * to specify localized text for each of these properties.
>    */
>   _getLocalizablePropertyValues: function(item, property) {
>+    var values = [];
>     var localized = this._getLocalizedResource(item);
>-    if (localized)
>-      return this._inner.GetTargets(localized, property, true);
>+    if (localized) {
>+      var targets = this._inner.GetTargets(localized, property, true);
>+      while (targets.hasMoreElements())
>+      	values.push(targets.getNext());
stray tab
>+      return values;
>+    }

I think this should first try to get the pref values and if those aren't present try to get the values from rdf to maintain the previous behavior where a pref can override an extension's metadata.
Attachment #270323 - Flags: review?(robert.bugzilla) → review-
Same is true for _getLocalizablePropertyValue... is there a reason why the previous behavior should be changed? If not please fix _getLocalizablePropertyValue as well. Thanks!
(Assignee)

Comment 4

11 years ago
Created attachment 270430 [details] [diff] [review]
patch rev 2

Well my reasoning was that the new information would supercede the old way but there we go.
Attachment #270323 - Attachment is obsolete: true
Attachment #270430 - Flags: review?(robert.bugzilla)
(Assignee)

Comment 5

11 years ago
Will need to update the documentation for this change.
Keywords: dev-doc-needed
(In reply to comment #4)
> Created an attachment (id=270430) [details]
> patch rev 2
> 
> Well my reasoning was that the new information would supercede the old way but
> there we go.
I'd say it is preferable to use the extension metadata but what about the case where a locale pack for an add-on is provided for an add-on that has localized metadat and is already released? The locale pack wouldn't be able to override the add-on provided metadata then.
Attachment #270430 - Attachment is patch: true
Attachment #270430 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 270430 [details] [diff] [review]
patch rev 2

Thanks Dave!
Attachment #270430 - Flags: review?(robert.bugzilla) → review+
(Assignee)

Comment 8

11 years ago
Checking in toolkit/mozapps/extensions/src/nsExtensionManager.js.in;
/cvsroot/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in,v  <--  nsExtensionManager.js.in
new revision: 1.225; previous revision: 1.224
done
(Assignee)

Comment 9

11 years ago
Updated http://developer.mozilla.org/en/docs/Localizing_extension_descriptions to match the new behaviour.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Keywords: dev-doc-needed → dev-doc-complete
Resolution: --- → FIXED
(Assignee)

Updated

11 years ago
Target Milestone: --- → Firefox 3 M7
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.