Search: Use item field localization if string == key

91faa73b19 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.
This commit is contained in:
Abe Jellinek 2022-03-25 16:35:01 -07:00
parent a3322a9afb
commit 82228a1072

View file

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