Firefox format (ResourceBlender)

From Lime 49 Wiki
Jump to: navigation, search

This format is used by extensions for Mozilla Firefox (among others) and consists of a contents.rdf, .properties and .dtd file for each language in the extension.

To access the resource bundles from an extension, first add a stringbundle tag to the XUL page on which the JavaScript file is included, then obtain a DOM reference to it and call getString. For example:

myextension.xul

<stringbundleset id="stringbundleset">

    <stringbundle id="my-bundle" src="chrome://myextension/locale /myextension.properties"/>

</stringbundleset>


myextension.js

var bundle = document.getElementById('my-bundle');

alert(bundle.getString('myelement'));

Elements in the XUL bundle can be accessed as XML entities. Eg:

<menuitem label="&myelement;">


See Also


Back to ResourceBlender Help Contents

Personal tools