Don't throw from getString() for missing strings in non-English locales

Just show the key

We still merge strings before pushing betas, but this means it won't
crash for source builds, or if we forget. Not sure why we didn't do this
15 years ago.
This commit is contained in:
Dan Stillman 2022-03-24 07:03:23 -04:00
parent 1d1adbca70
commit 91faa73b19

View file

@ -128,7 +128,13 @@ Zotero.Intl = new function () {
else if (e.name != 'NS_ERROR_FAILURE') {
Zotero.logError(e);
}
throw new Error('Localized string not available for ' + name);
let msg = 'Localized string not available for ' + name;
if (Zotero.locale == 'en-US') {
throw new Error(msg);
}
// In non-English locales, just return key if string is unavailable
Zotero.debug(msg, 1);
return name;
}
return l10n;
};