diegodlh / zotero-cita

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

Cita preferences (and item pane section header and sidenav) not translated to some languages #288

Open diegodlh opened 3 weeks ago

diegodlh commented 3 weeks ago

Cita preferences are not translated to most of the languages we support.

Apparently they are only translated to English (en-US) and German (de), and all other translations are ignored.

Because both en-US and de are supported locales by Zotero, I guess this may be related to the way how we support locales not supported by Zotero (see 15de93b). Note, however, that they are not translated to zh-Hant and zh-Hans, even though these are supported by Zotero, and we have preferences translations for these languages.

Maybe this could be fixed if we move that piece of code from src/utils/locale.ts to static/bootstrap.js, as suggested here?

The thread I opened in the zotero-dev mailing list may provide further ideas: https://groups.google.com/g/zotero-dev/c/GUovOSrtQy4

diegodlh commented 3 weeks ago

Note that translations do work in citationEditor.xhtml, citationImporter.xhtlm and identifierImporter.xhtml (have not tried selector.xhtml).

However, these use Wikicite.getString() (which in turn relies on our custom Localization object set up by our initLocale function), as opposed to preferences.xhtml which relies on native Fluent markup-based approach.

diegodlh commented 3 weeks ago

Noting too that Zotero.plugins.registerLocales() seems to be running before the extension bootstrap.js' startup() function. So moving the aforementioned code into bootstrap.js will probably not fix this issue.

diegodlh commented 3 weeks ago

7033ea2 fixed that the item pane section header label and sidenav tooltiptext did not show.

However, they also seem to be not translated to languages other than en-US and de.