Zotero Style Repository - Translators?

Hello all,

I've made some custom translators, that I would like to share within our research group. At the moment, we are donig this by people placing the JS into the right directory. However, it's cumbersome. Can such translators (.js not .csl) be added to the Zotero Style Repository? If yes, how do I submit such translators to the respository.

Thanks!

(Sedgeway from https://github.com/willsALMANJ/Zutilo/issues/129#)
  • No, that wouldn't make sense. It's a citation style repository, a mirror of the official CSL repository. The fact that Quick Copy in Zotero lets you choose either CSL styles or export translators doesn't change that.

    More importantly, though, translators are technically very different and have security implications that styles do not, so people shouldn't be installing translators from people they don't trust. We're not going to facilitate sharing of custom translators.
  • Hi @dstillman - many thanks!

    Would it be possible to have a gui option for loading a translator.js similar to the way you can add extensions? That would avoid people having to mess with their filesystems and offer an OS-independent way of handling the addition of translators?
  • No — again, translators have security implications, which is why bundled ones are carefully reviewed, and we really don't want to facilitate the spread of custom translators. It would be better for these things to be handled by plugins. (Plugins have even more serious security implications, of course, but that's more general understood, and there are existing mechanisms for installing/listing/updating/removing/blacklisting them.)
  • Ah - ok, intersting. So I'm realising properly that dropping translators into the Zotero folder is a bit of a 'hack'.

    Do you know the best place to start for a simple plugin? E.g. a plugin that would provide a "set of translators" (I imagine as some additions to the right-click menu or similar)? (If that's the right way to go?)
  • Better BibTeX installs — and removes, on uninstallation — multiple translators, so you could look at that for an example (though it's far more complicated and I believe also written in TypeScript, so you'd want to look at something else for the basic plugin structure).
  • ODF Scan is supposed to install a translator, but that's not working particularly reliably at this time -- still, I think may not be a bad place to start looking since it's otherwise pretty simple.
  • Thank you both, that's very helpful!
  • OTOH, my installer is reliable as far as I can tell -- don't know what ODF scan does differently since I think we call into Zotero the same way. But it's hard to compare the two because they use very different init paths -- mine is an old-style overlay extension, ODF scan is a restartless extension.

    You should indeed not look at BBT for an example plugin -- not only is it typescript, but it is a fairly complicated plugin, and you don't need all the stuff I've done to keep that manageable -- for a simple plugin, it's overkill. That said, this line and the next gets my translator from the bundled resources, this installs the translator. Those 3 lines are pure javascript, so those should be usable as-is. The rest of that function you can ignore, I do checks to only re-install the translator when it is changed. For most purposes that's overkill and I would just install it at every start, which I did for a long time.

    The process for uninstall is more complicated. You might not want to bother.
  • It would be best to remove the translator on uninstall. Part of the point of doing this as a plugin is to give users an easy way to remove the customization.
Sign In or Register to comment.