From af3602124b0c3e2736a9654651ff3d89cc6e7edc Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 3 Sep 2024 10:17:42 -0400 Subject: [PATCH] Load DTD strings lazily (#4664) --- chrome/content/zotero/xpcom/intl.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/chrome/content/zotero/xpcom/intl.js b/chrome/content/zotero/xpcom/intl.js index 29663b803d..76da2c7b50 100644 --- a/chrome/content/zotero/xpcom/intl.js +++ b/chrome/content/zotero/xpcom/intl.js @@ -79,17 +79,6 @@ Zotero.Intl = new function () { Zotero.arrowPreviousKey = Zotero.rtl ? 'ArrowRight' : 'ArrowLeft'; Zotero.arrowNextKey = Zotero.rtl ? 'ArrowLeft' : 'ArrowRight'; - this.strings = {}; - const intlFiles = ['zotero.dtd', 'preferences.dtd', 'mozilla/editMenuOverlay.dtd']; - for (let intlFile of intlFiles) { - let localeXML = Zotero.File.getContentsFromURL(`chrome://zotero/locale/${intlFile}`); - let regexp = / { + const intlFiles = ['zotero.dtd', 'preferences.dtd', 'mozilla/editMenuOverlay.dtd']; + + let strings = []; + for (let intlFile of intlFiles) { + let localeXML = Zotero.File.getContentsFromURL(`chrome://zotero/locale/${intlFile}`); + let regexp = /