Skip to content

Commit

Permalink
Localize strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
arantius committed Nov 4, 2010
1 parent 89280b5 commit 17add9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions content/addons4-overlay.js
Expand Up @@ -7,6 +7,8 @@ Components.utils.import("resource://greasemonkey/addons4.jsm");

var sortersContainer;
var sortExecuteOrderButton;
var stringBundle;

window.addEventListener('load', init, false);

// Patch the default createItem() to add our custom property.
Expand Down Expand Up @@ -63,12 +65,20 @@ function init() {

window.addEventListener('ViewChanged', onViewChanged, false);

var stringBundleService = Components
.classes['@mozilla.org/intl/stringbundle;1']
.getService(Ci.nsIStringBundleService);
var stringBundle = stringBundleService
.createBundle('chrome://greasemonkey/locale/gm-addons.properties');

// Inject this content into an XBL binding (where it can't be overlayed).
sortExecuteOrderButton = document.createElement('button');
sortExecuteOrderButton.setAttribute('checkState', '0');
sortExecuteOrderButton.setAttribute('class', 'sorter');
sortExecuteOrderButton.setAttribute('label', 'Execution Order');
sortExecuteOrderButton.setAttribute('tooltiptext', 'Sort by execution order');
sortExecuteOrderButton.setAttribute(
'label', stringBundle.GetStringFromName('executionorder'));
sortExecuteOrderButton.setAttribute(
'tooltiptext', stringBundle.GetStringFromName('executionorder.tooltip'));
sortExecuteOrderButton.collapsed = true;
sortersContainer = document.getElementById('list-sorters');
sortersContainer.appendChild(sortExecuteOrderButton);
Expand Down
2 changes: 2 additions & 0 deletions locale/en-US/gm-addons.properties
@@ -0,0 +1,2 @@
executionorder=Execution Order
executionorder.tooltip=Sort by execution order

1 comment on commit 17add9a

@erikvold
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.