From 82228a107269254ade50535b155e700be2ae8092 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Fri, 25 Mar 2022 16:35:01 -0700 Subject: [PATCH] Search: Use item field localization if string == key 91faa73b19df90cfd70250a3a67c4fa71864cd13 made getString return the key instead of throwing on non-en-US locales, so we check if the getString result is equal to the key even if it doesn't throw. Fixes #2472. --- chrome/content/zotero/xpcom/data/searchConditions.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/searchConditions.js b/chrome/content/zotero/xpcom/data/searchConditions.js index 19117329e8..8ad33adcc5 100644 --- a/chrome/content/zotero/xpcom/data/searchConditions.js +++ b/chrome/content/zotero/xpcom/data/searchConditions.js @@ -710,11 +710,15 @@ Zotero.SearchConditions = new function(){ } try { - return Zotero.getString('searchConditions.' + str) - } - catch (e) { - return Zotero.ItemFields.getLocalizedString(str); + let conditionKey = 'searchConditions.' + str; + let conditionString = Zotero.getString(conditionKey); + if (conditionString !== conditionKey) { + return conditionString; + } } + catch (e) {} + + return Zotero.ItemFields.getLocalizedString(str); }