2018-07-30 08:20:05 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
describe("Zotero.Intl", function() {
|
|
|
|
describe("#getString()", function () {
|
|
|
|
it("should return the right plural form", function* () {
|
|
|
|
if (Zotero.locale != 'en-US') {
|
|
|
|
this.skip();
|
|
|
|
}
|
|
|
|
var str1 = Zotero.getString('fileInterface.itemsWereImported')
|
|
|
|
.split(/;/)[1]
|
|
|
|
.replace('%1$S', 2);
|
|
|
|
var str2 = Zotero.getString('fileInterface.itemsWereImported', 2, 2);
|
|
|
|
assert.equal(str1, str2);
|
|
|
|
});
|
|
|
|
});
|
2018-08-01 11:40:45 +00:00
|
|
|
|
|
|
|
describe("#localeCompare", function () {
|
|
|
|
it("shouldn't ignore whitespace", function () {
|
|
|
|
assert.equal(Zotero.localeCompare("Chang", "Chan H"), 1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("shouldn't ignore leading punctuation", function () {
|
|
|
|
assert.equal(Zotero.localeCompare("_Abcd", "Abcd"), -1);
|
|
|
|
});
|
|
|
|
});
|
2018-07-30 08:20:05 +00:00
|
|
|
});
|