Refactor l10n code. Remove use of react-intl. (#2975)

Strings from .dtd files are now accessible from Zotero.getMessage
as the eventual move to Fluent would remove their distinction.
This commit is contained in:
Adomas Ven 2023-01-17 22:59:19 +02:00 committed by Adomas Venčkauskas
parent bcfdaaabab
commit cfbfcf20bf
19 changed files with 150 additions and 181 deletions

View file

@ -18,9 +18,16 @@ describe("Zotero.Intl", 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);
});
});
it("there should not be duplicate string keys in .dtd and .properties files", function () {
let dtdStrings = Object.keys(Zotero.Intl.strings);
for (let key of dtdStrings) {
assert.throws(() => Zotero.Intl._bundle.GetStringFromName(key));
}
});
});