zotero/styles-repo

Style previews aren't localized for dependent styles

rmzelle opened this issue · 7 comments

It looks like localization doesn't work anymore for the previews of dependent CSL styles.

E.g. https://www.zotero.org/styles?q=id%3Aabi-technik shows "Hisakata, Rumi, Shin ’ya Nishida, and Alan Johnston." and "edited by Andreas D. Baxevanis and B. F. Francis Ouellette". This same style does localize correctly to German when installed in Zotero Standalone.

I doubt this ever worked — I don't think citeproc-node ever supported it (and I don't think it would be limited to dependent styles). @fcheslack would have to comment on how easy it would be to support this.

Ah, OK — then I guess it's just that we use the parent previews for the dependent styles, so we'll have to generate these separately.

Fix here will be modifying generate-previews to check if the dependent style has a different default-locale from the parent and, if so, generating a new preview using the parent code with default-locale replaced. (If citeproc-node were updated to handle the dependent's default-locale, we could just send along the dependent code, but this way we could also cache the parent + default-locale combo. Not sure if there are enough default-locale dependents for that to matter.)

@tnajdek: I haven't checked the code carefully, but it looks like this is doing some unnecessary work? I think dependent styles with default-locale="en-US" for parents without default-locale are all being regenerated (and aren't cached for the combo of parent + en-US, either, even if it ran that once, which it shouldn't need to, since the parent preview is en-US already).

@dstillman you're correct, seems I've forgot a type cast. Fix PR coming!

Thanks!