Add localized string for timestamp CSL locator

Not included in the CSL locales:

https://forums.zotero.org/discussion/comment/412060/#Comment_412060
This commit is contained in:
Dan Stillman 2022-07-09 18:07:07 -04:00
parent fe74b02d28
commit cf8819cc06
3 changed files with 11 additions and 0 deletions

View file

@ -47,6 +47,11 @@ Zotero.Cite = {
* @return {String} - Localized string (e.g., 'Livre')
*/
getLocatorString: function (locator) {
// 'timestamp' not included in CSL locales
if (locator == 'timestamp') {
return Zotero.getString('citation.locator.timestamp');
}
// Get the best CSL locale for the current Zotero locale
var cslLocale = Zotero.Utilities.Internal.resolveLocale(
Zotero.locale,

View file

@ -868,6 +868,7 @@ citation.showEditor = Show Editor…
citation.hideEditor = Hide Editor…
citation.citations = Citations
citation.notes = Notes
citation.locator.timestamp = Timestamp
report.title.default = Zotero Report
report.parentItem = Parent Item:

View file

@ -10,6 +10,11 @@ describe("Zotero.Cite", function () {
assert.equal(Zotero.Cite.getLocatorString('sub-verbo'), 'Sub verbo');
});
it("should get 'timestamp' in en-US", function () {
Zotero.locale = 'en-US';
assert.equal(Zotero.Cite.getLocatorString('timestamp'), 'Timestamp');
});
it("should get 'book' in fr-FR", function () {
Zotero.locale = 'fr-FR';
assert.equal(Zotero.Cite.getLocatorString('book'), 'Livre');