Skip to content

v0.1.2

Choose a tag to compare

@cannolis cannolis released this 08 May 03:29
· 8 commits to main since this release

ZotRead v0.1.2 — really fix prefs blank on first install

v0.1.1 was supposed to fix the blank-prefs-on-first-install issue, but the fix made it worse: the prefs panel's labels stayed blank permanently, and clicking a dropdown no longer brought them back. v0.1.2 corrects that.

What was wrong in v0.1.1

MozXULElement.insertFTLIfNeeded was called on the prefs window itself. But preferences.xhtml already declares the FTL via <linkset rel="localization">, so the bundle ended up registered twice — and Firefox's l10n engine then refused to translate any of the elements at all.

The actual fix

  1. Main-window preheat (src/hooks.ts) — when Zotero's main window loads, the plugin now also pre-registers preferences.ftl so Firefox's l10n cache knows about it before the user ever opens Settings.
  2. Post-open re-translate (src/modules/preferenceScript.ts) — when the prefs pane opens, the plugin asks document.l10n to re-translate the DOM fragment. This is a no-op when everything is already wired up, but rescues the rare case where the bundle finished loading after first paint.

No double-registration. Tested on a fresh dev profile: prefs labels appear immediately.

Install

If you have v0.1 or v0.1.1 installed: download the new zot-read.xpi below and re-install via Tools → Add-ons → gear icon → Install Add-on From File… — your existing settings, anchors, and cache are preserved.

What changed

  • src/hooks.ts — onMainWindowLoad now also pre-registers zotread-preferences.ftl via insertFTLIfNeeded
  • src/modules/preferenceScript.ts — registerPrefsScripts calls document.l10n.translateFragment(documentElement) instead of insertFTLIfNeeded
  • package.json — version 0.1.1 → 0.1.2