From 58baa44ad446fe6dea2ca30a6c104aa28495c987 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 30 Dec 2025 14:28:56 -0500 Subject: [PATCH] Always use `Zotero.CreatorTypes.getLocalizedString()` Since some strings are now stored in schema.ftl https://forums.zotero.org/discussion/128757/z8-beta-films-dont-have-any-creator-types --- chrome/content/zotero/elements/itemBox.js | 9 ++++----- chrome/content/zotero/xpcom/report.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/elements/itemBox.js b/chrome/content/zotero/elements/itemBox.js index a59bbd29da..56bf1003d3 100644 --- a/chrome/content/zotero/elements/itemBox.js +++ b/chrome/content/zotero/elements/itemBox.js @@ -688,7 +688,7 @@ var localized = {}; for (let i = 0; i < creatorTypes.length; i++) { localized[creatorTypes[i].name] - = Zotero.getString('creatorTypes.' + creatorTypes[i].name); + = Zotero.CreatorTypes.getLocalizedString(creatorTypes[i].name); } for (let i in localized) { @@ -1159,7 +1159,7 @@ rowLabel.appendChild(labelWrapper); let label = this.createLabelElement({ id: 'creator-type-label-inner', - text: Zotero.getString('creatorTypes.' + Zotero.CreatorTypes.getName(typeID)), + text: Zotero.CreatorTypes.getLocalizedString(typeID), skipEventHandlers: true, }); labelWrapper.appendChild(label); @@ -2845,9 +2845,8 @@ var row = typeBox.parentNode; var fields = this.getCreatorFields(row); fields.creatorTypeID = typeID; - typeBox.querySelector("#creator-type-label-inner").textContent = Zotero.getString( - 'creatorTypes.' + Zotero.CreatorTypes.getName(typeID) - ); + typeBox.querySelector("#creator-type-label-inner").textContent + = Zotero.CreatorTypes.getLocalizedString(typeID); typeBox.setAttribute('typeid', typeID); this.modifyCreator(index, fields); diff --git a/chrome/content/zotero/xpcom/report.js b/chrome/content/zotero/xpcom/report.js index fd8acd0da4..4654b8e2ba 100644 --- a/chrome/content/zotero/xpcom/report.js +++ b/chrome/content/zotero/xpcom/report.js @@ -167,7 +167,7 @@ Zotero.Report.HTML = new function () { content += '\t\t\t\t\t\n'; content += '\t\t\t\t\t\t' - + escapeXML(Zotero.getString('creatorTypes.' + creator.creatorType)) + + escapeXML(Zotero.CreatorTypes.getLocalizedString(creator.creatorType)) + '\n'; content += '\t\t\t\t\t\t' + escapeXML(displayText) + '\n'; content += '\t\t\t\t\t\n';