Add Zotero.localeCompare

Can be used directly in Array.sort() as the sorting function.
Uses LocaleCollateion.compareString internally
This commit is contained in:
Aurimas Vinckevicius 2014-11-14 02:54:53 -06:00
parent 9700cdde38
commit a56e800d7c

View file

@ -1531,6 +1531,12 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
};
}
this.defineProperty(this, "localeCompare", {
get: function() {
var collation = this.getLocaleCollation();
return collation.compareString.bind(collation, 1);
}
}, {lazy: true});
/*
* Sets font size based on prefs -- intended for use on root element