Page MenuHomePhabricator

Add de-localization support for the special {{self}} wrapper template
Open, Needs TriagePublic

Description

The template https://commons.wikimedia.org/wiki/Template:Self is special in so far that it wraps other templates. All its unnamed parameters (at the moment up to 6) are used to include other templates that have this name. I.e. these parameters are template names and should be de-localized as such. For example, {{self|Lizenzname}} should be de-localized just as {{Lizenzname}}, assuming a matching de-localization rule ;Lizenzname:license name exists.

https://www.wikidata.org/wiki/Q6670109 shows that many wikis stick to "self" as the canonical English name. Only a few localize it.

Baseline:

  • Hard-code the English "self" and accept {{self| as an optional prefix. Limit this to license templates without parameters. Warning: Parameters in {{self|actual template name|…|…}} don't correspond to parameters in the actual license template. Instead they reference other license templates. Make sure this doesn't get messed up by any transfer rule.
  • Check if "self" is in the list of unlocalizations and prioritize it, so it's done before all other unlocalizations.
  • Possibly add support for multiple license templates in {{self|…|…}}.