From 7fb8f162c5b3368ce784b20655957b2f33457b1f Mon Sep 17 00:00:00 2001 From: gracile-fr Date: Wed, 11 Mar 2015 18:28:30 +0100 Subject: [PATCH] Add localized locator labels Fixes #557 --- .../zotero/integration/addCitationDialog.js | 2 +- chrome/content/zotero/integration/quickFormat.js | 3 +-- chrome/content/zotero/tools/csledit.js | 2 +- chrome/locale/en-US/zotero/zotero.dtd | 3 --- chrome/locale/en-US/zotero/zotero.properties | 16 ++++++++++++++++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/integration/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js index 34b5e0bfcf..17ee4ef841 100644 --- a/chrome/content/zotero/integration/addCitationDialog.js +++ b/chrome/content/zotero/integration/addCitationDialog.js @@ -115,7 +115,7 @@ var Zotero_Citation_Dialog = new function () { var i = 0; for(var value in locators) { var locator = locators[value]; - var locatorLabel = locator[0].toUpperCase()+locator.substr(1); + var locatorLabel = Zotero.getString('citation.locator.'+locator.replace(/\s/g,'')); // add to list of labels var child = document.createElement("menuitem"); child.setAttribute("value", value); diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index f3c0962a1c..af90a2cc29 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -79,8 +79,7 @@ var Zotero_QuickFormat = new function () { var menu = document.getElementById("locator-label"); var labelList = document.getElementById("locator-label-popup"); for each(var locator in locators) { - // TODO localize - var locatorLabel = locator[0].toUpperCase()+locator.substr(1); + var locatorLabel = Zotero.getString('citation.locator.'+locator.replace(/\s/g,'')); // add to list of labels var child = document.createElement("menuitem"); diff --git a/chrome/content/zotero/tools/csledit.js b/chrome/content/zotero/tools/csledit.js index 6a777b480c..1bcbc6a913 100644 --- a/chrome/content/zotero/tools/csledit.js +++ b/chrome/content/zotero/tools/csledit.js @@ -64,7 +64,7 @@ var Zotero_CSL_Editor = new function() { var locators = Zotero.Cite.labels; for each(var type in locators) { var locator = type; - locator = locator[0].toUpperCase()+locator.substr(1); + locator = Zotero.getString('citation.locator.'+locator.replace(/\s/g,'')); pageList.appendItem(locator, type); } diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd index 95aa707215..7a2ea98b25 100644 --- a/chrome/locale/en-US/zotero/zotero.dtd +++ b/chrome/locale/en-US/zotero/zotero.dtd @@ -187,9 +187,6 @@ - - - diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 4e13f370db..3a85556b07 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -663,6 +663,22 @@ citation.showEditor = Show Editor… citation.hideEditor = Hide Editor… citation.citations = Citations citation.notes = Notes +citation.locator.page = Page +citation.locator.book = Book +citation.locator.chapter = Chapter +citation.locator.column = Column +citation.locator.figure = Figure +citation.locator.folio = Folio +citation.locator.issue = Issue +citation.locator.line = Line +citation.locator.note = Note +citation.locator.opus = Opus +citation.locator.paragraph = Paragraph +citation.locator.part = Part +citation.locator.section = Section +citation.locator.subverbo = Sub verbo +citation.locator.volume = Volume +citation.locator.verse = Verse report.title.default = Zotero Report report.parentItem = Parent Item: