Page MenuHomePhabricator

Support translation of Web2Cit monitor templates
Closed, ResolvedPublic

Description

The Web2Cit monitor uses custom templates to write its overview, result and log pages. One of the reasons for this choice was to allow translations to other languages.

Copying email to @Superzerocool below (in Spanish) with ideas on how this may be implemented:

  • Por último, con respecto al uso de plantillas para strings traducidos. Siguiendo las instrucciones acá, creé esta tabla de traducción Web2Cit de ejemplo. En esta página de prueba en Meta invoqué esas traducciones con {{#invoke:TNT}}, y un parámetro no documentado lang= para pedir el idioma de la interfaz con {{int:lang}}, en vez del predeterminado (el de la página). Qué tal?
  • Por otra parte, en la misma página, usé el template Translatable template para obtener la versión traducida correspondiente del template {{Tech header}} según el lenguaje de la interfaz {{int:lang}}. E incluso puedo pasarle parámetros al template traducido. Incluyo esto sólo porque lo probé primero y pensé que quizá pudiera servirte para otros casos.

Event Timeline

Consider creating a Web2Cit Monitor Results template on-wiki so that these and other format changes (such as adding a Web2Cit Monitor Results category as proposed in T329573#11907779) can be made without changing Web2Cit-Monitor code and, more importantly, without triggering watchlist notifications (which should be limited as much as possible to translation results changes).

Created these drafts:

diegodlh claimed this task.

I created Template:Web2Cit/results/domain to handle this.

It uses Module:TNT for localization and translations from https://commons.wikimedia.org/wiki/Data:I18n/Web2Cit.tab. I changed documentation to reflect this: https://meta.wikimedia.org/w/index.php?title=Web2Cit&diff=prev&oldid=30545349

Spanish translations have been provided, in addition to English.

In addition, the template uses newly created Module:Web2Cit/results, which takes most formatting logic from the Web2Cit bot into this module. This way we better make sure that results pages only change when translation results change, for better support of T329573.

Web2Cit Monitor bot has been changed accordingly in a3581d88. Deployment is still pending.