From 45596e70e9f79a227da775c7b4e9f8aaa8d19875 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 17 Apr 2026 11:26:15 -0400 Subject: [PATCH] Work around Fluent issue leaving "{$version}" in post-upgrade banner Some users see the literal "{$version}" placeholder in the banner, likely due to some Fluent quirk triggered by plugin localizations. (Missing localizations? Missing strings?) After translation, check the version span and substitute manually if needed. https://forums.zotero.org/discussion/129171/version-variable-is-displayed-in-zotero-8-upgrade-banner/p1 https://forums.zotero.org/discussion/130864/just-upgraded-to-zotero-9-on-debian-through-check-for-updates-and/p1 --- chrome/content/zotero/zoteroPane.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 4c4abd5215..13c9a6b85d 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -6705,6 +6705,18 @@ var ZoteroPane = new function () { let link = document.getElementById('post-upgrade-new-features-link'); link.href = ZOTERO_CONFIG.NEW_FEATURES_URL.replace('{version}', majorVersion); document.getElementById('post-upgrade-container').removeAttribute('collapsed'); + + // Workaround for a Fluent issue (possibly triggered by plugin localizations) where + // $version isn't substituted, leaving "{$version}" visible in the banner. The same issue + // can cause other problems, and it would be good to figure out what's triggering it, but + // this one is visible enough that it's worth fixing manually. + document.l10n.translateElements([div]).then(() => { + let span = document.getElementById('post-upgrade-appver'); + if (span.textContent.includes('$version')) { + span.textContent = span.textContent + .replace(/\{\s*\$version\s*\}/g, majorVersion); + } + }); };