diegodlh / zotero-cita

Cita: a Wikidata addon for Zotero with citations metadata support
GNU General Public License v3.0
233 stars 12 forks source link

Fix localisation in dialog windows #283

Closed Dominic-DallOsto closed 3 months ago

Dominic-DallOsto commented 3 months ago

Before we were passing in the Wikicite object so we could access its string formatting functions.

This worked for base formatting, but not if the dialog window called a function that then called further string formatting (eg. getPID) because this didn't use the Wikicite object we passed in, but a secondary imported one, and the addon object used for localisation in src/utils/locale.ts was undefined.

To fix this, we instead pass in the addon object and assign it to window so it's globally accessible within the window.

Ideally it should be possible to configure this with esbuild, or to assign to globalThis instead of window (see eg. here) but we can address this later.

github-actions[bot] commented 2 months ago

:rocket: This ticket has been resolved in v1.0.0-beta.0. See Release 1.0.0-beta.0 for release notes.