[Project_owners] Localization extension description

Bartosz Piec bpiec at student.uci.agh.edu.pl
Tue Jan 24 23:11:49 EST 2006


Ramiro Aparicio napisał(a):
> But I have seen in ietab extension that they are able to localize the 
> extension description shown in extension manager. In his 
> ietab.properties you can see:

I have done it that way in OperaView:

gOperaViewBundle = document.getElementById("bundle_operaview");

try {
const nsISupportsString = Components.interfaces.nsISupportsString;

var pref = 
Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.{87f54a61-c9b3-4138-a38a-33c31770bb9e}.");

var str = 
Components.classes["@mozilla.org/supports-string;1"].createInstance(nsISupportsString);

str.data = gOperaViewBundle.getString("operaview.description");

pref.setComplexValue("description", nsISupportsString, str);
}
catch (err) {}

operaview.description is taken from locales.

-- 
Regards,
Bartosz Piec


More information about the Project_owners mailing list