Update strings and add test for ADS Bibcode extraction (#2128)

This commit is contained in:
Abe Jellinek 2021-08-04 17:37:49 -06:00 committed by GitHub
parent 4475e86eac
commit 4ebed5dee7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -176,7 +176,7 @@
<!ENTITY zotero.tagColorChooser.setColor "Set Color"> <!ENTITY zotero.tagColorChooser.setColor "Set Color">
<!ENTITY zotero.tagColorChooser.removeColor "Remove Color"> <!ENTITY zotero.tagColorChooser.removeColor "Remove Color">
<!ENTITY zotero.lookup.description "Enter ISBNs, DOIs, PMIDs, or arXiv IDs to add to your library:"> <!ENTITY zotero.lookup.description "Enter ISBNs, DOIs, PMIDs, arXiv IDs, or ADS Bibcodes to add to your library:">
<!ENTITY zotero.lookup.button.search "Search"> <!ENTITY zotero.lookup.button.search "Search">
<!ENTITY zotero.createParent.title "Create Parent Item"> <!ENTITY zotero.createParent.title "Create Parent Item">

View file

@ -1180,7 +1180,7 @@ lookup.failure.description = Zotero could not find a record for the specified
lookup.failureToID.description = Zotero could not find any identifiers in your input. Please verify your input and try again. lookup.failureToID.description = Zotero could not find any identifiers in your input. Please verify your input and try again.
lookup.failureTooMany.description = Too many identifiers. Please enter one identifier and try again. lookup.failureTooMany.description = Too many identifiers. Please enter one identifier and try again.
createParent.prompt = Enter a DOI, ISBN, PMID, or arXiv ID to identify this file createParent.prompt = Enter a DOI, ISBN, PMID, arXiv ID, or ADS Bibcode to identify this file
locate.online.label = View Online locate.online.label = View Online
locate.online.tooltip = Go to this item online locate.online.tooltip = Go to this item online

View file

@ -382,6 +382,15 @@ describe("Zotero.Utilities.Internal", function () {
assert.propertyVal(identifiers[2], "arXiv", "hep-ex/9809001"); assert.propertyVal(identifiers[2], "arXiv", "hep-ex/9809001");
assert.propertyVal(identifiers[3], "arXiv", "math.GT/0309135"); assert.propertyVal(identifiers[3], "arXiv", "math.GT/0309135");
}); });
it("should extract ADS bibcodes", async function () {
var identifiers = ZUI.extractIdentifiers("9 2021wfc..rept....8D, 2022MSSP..16208010Y.");
assert.lengthOf(identifiers, 2);
assert.lengthOf(Object.keys(identifiers[0]), 1);
assert.lengthOf(Object.keys(identifiers[1]), 1);
assert.propertyVal(identifiers[0], "adsBibcode", "2021wfc..rept....8D");
assert.propertyVal(identifiers[1], "adsBibcode", "2022MSSP..16208010Y");
});
}); });
describe("#resolveLocale()", function () { describe("#resolveLocale()", function () {