From 9c7d3c3c4e022927549e551c33cb16fb0a602248 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Sun, 27 Jan 2013 05:24:58 -0600 Subject: [PATCH] Consider type-specific "title" alternatives for validating web translations --- chrome/content/zotero/xpcom/translation/translate.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 12c883c37f..5c46ba2e72 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -578,6 +578,10 @@ Zotero.Translate.Sandbox = { item.accessDate = "CURRENT_TIMESTAMP"; } + //consider type-specific "title" alternatives + var altTitle = Zotero.ItemFields.getName(Zotero.ItemFields.getFieldIDFromTypeAndBase(item.itemType, 'title')); + if(altTitle && item[altTitle]) item.title = item[altTitle]; + if(!item.title) { translate.complete(false, new Error("No title specified for item")); return;