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
This commit is contained in:
Dan Stillman 2025-12-30 14:28:56 -05:00
parent c6ef23a650
commit 58baa44ad4
2 changed files with 5 additions and 6 deletions

View file

@ -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);

View file

@ -167,7 +167,7 @@ Zotero.Report.HTML = new function () {
content += '\t\t\t\t\t<tr>\n';
content += '\t\t\t\t\t\t<th class="' + creator.creatorType + '">'
+ escapeXML(Zotero.getString('creatorTypes.' + creator.creatorType))
+ escapeXML(Zotero.CreatorTypes.getLocalizedString(creator.creatorType))
+ '</th>\n';
content += '\t\t\t\t\t\t<td>' + escapeXML(displayText) + '</td>\n';
content += '\t\t\t\t\t</tr>\n';