We validate language codes for mediawiki export in the function "fixLang" in ZoteroService.js. However, output can be improved, both by modifying potential input instead of removing it, and also being more strict potentially with the post-fix.
Description
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Declined | None | T115326 Many language wiki templates (pl, it, en, cs) don't accept xx-XX style language codes | |||
Open | None | T93561 Improve language code validation |
Event Timeline
Comment Actions
Hey @Mvolz, I guess that this report by a Polish Wikipedian also belongs here? Thanks.
Comment Actions
Also, because the validation pattern in Citoid's fixLang is /^[a-z]{2}(?:-?[a-z]{2,})*$/i, it doesn't allow some values that would work with Wikipedia's CS1/2 citation templates, as listed here.
For example, abq-latn or es-419 do not match the pattern (resulting in Citoid getting rid of them), while these are valid values for CS1/2 templates' language parameter.