From a1655e5643f5ea77b282bd6ff05717fd6c611afc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 11 Feb 2021 01:28:32 -0500 Subject: [PATCH] Remove colon from "[n] notes:" line at top of notes panes --- chrome/content/zotero/contextPane.js | 6 ++---- chrome/content/zotero/itemPane.js | 16 +--------------- chrome/locale/en-US/zotero/zotero.properties | 4 +--- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/chrome/content/zotero/contextPane.js b/chrome/content/zotero/contextPane.js index 15f71ed185..558ec3e8c8 100644 --- a/chrome/content/zotero/contextPane.js +++ b/chrome/content/zotero/contextPane.js @@ -473,8 +473,7 @@ var ZoteroContextPane = new function () { })); var c = notes.length; - var str = 'pane.item.notes.count.' + (c == 0 && 'zero' || c == 1 && 'singular' || 'plural'); - label.value = Zotero.getString(str, [c]); + label.value = Zotero.getString('pane.item.notes.count', c, c); } ReactDOM.render( @@ -793,8 +792,7 @@ var ZoteroContextPane = new function () { _removeNote(id); }); var c = parentNotes.length; - var str = 'pane.item.notes.count.' + (c == 0 && 'zero' || c == 1 && 'singular' || 'plural'); - label.value = Zotero.getString(str, [c]); + label.value = Zotero.getString('pane.item.notes.count', c, c); } context.update = Zotero.Utilities.throttle(_renderNotesPanel, 500); diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index ce315d6bcc..a09227341b 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -457,21 +457,7 @@ var ZoteroItemPane = new function() { function _updateNoteCount() { var c = _notesList.childNodes.length; - - var str = 'pane.item.notes.count.'; - switch (c){ - case 0: - str += 'zero'; - break; - case 1: - str += 'singular'; - break; - default: - str += 'plural'; - break; - } - - _notesLabel.value = Zotero.getString(str, [c]); + _notesLabel.value = Zotero.getString('pane.item.notes.count', c, c); } } diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index bddcd7b941..18f04ef788 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -368,9 +368,7 @@ pane.item.creator.moveDown = Move Down pane.item.notes.allNotes = All Notes pane.item.notes.untitled = Untitled Note pane.item.notes.delete.confirm = Are you sure you want to delete this note? -pane.item.notes.count.zero = %S notes: -pane.item.notes.count.singular = %S note: -pane.item.notes.count.plural = %S notes: +pane.item.notes.count = %1$S note;%1$S notes pane.item.notes.editingInWindow = Editing in separate window pane.item.attachments.rename.title = New title: pane.item.attachments.rename.renameAssociatedFile = Rename associated file