Page MenuHomePhabricator

Avoid translating to shim-type templates, use the proper target templates
Closed, ResolvedPublic

Description

Some templates acts as "shims" for easy reuse of templates from other languages, and are often assumed to be used together with substing. This makes it possible to easily copy-paste a template into a target wiki and "i just works". I does not simply work with ContentTranslation, as most of these easy-to-use shims lacks proper TemplateData. Thus CT fails badly when they are encountered, and often with misplaced error messages.

Usually such shims reuse another internal template, but this is not enough to properly distinguish them.

Is there any other option than make separate WD-entries for such templates?

Event Timeline

jeblad created this task.Feb 11 2018, 8:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 11 2018, 8:40 PM
jeblad renamed this task from Avoid translating to shim-type templates to Avoid translating to shim-type templates, use the proper target templates.Feb 11 2018, 8:40 PM

I'm a bit confused: Isn't the whole point of these shim templates to make translation easier? Aren't they at least supposed to be more suitable for use for Content Translation?

A more general task that proposes marking of meta-categories of templates: T165053: Add a way to denote different desired behaviors for different types of templates

Perhaps ideas recently brought up by @ssastry and @cscott can also be somewhat relevant, e.g. https://www.mediawiki.org/wiki/Parsing/Notes/Wikitext_2.0/Typed_Templates

The real solution, of course, is something along these lines: T121470: Central Global Repository for Templates, Lua modules, and Gadgets. Yes, it's big, complicated, and far-fetched, but it's much-needed.

Tried to open a discussion at Wikidata about linking of the templates, d:Wikidata:Project chat#Templates used for substing

jeblad added a comment.EditedFeb 11 2018, 9:57 PM

The shim templates will not translate anything unless they are substed, and without TemplateData they fail badly. Usually CT just calls the same template and carry over the link, with an error message as result.

An example is this edit where a previous translation has failed. At nowiki the template w:no:Template:Cite news is a shim. The actual template that should be used is w:no:Template:Kilde avis. The shim has no TemplateData and should not be used.

Yes, the ultimate solution is T121470: Central Global Repository for Templates, Lua modules, and Gadgets, but right now I'm more inclined to figure out how to solve the problem and to avoid fixing translations manually. ;)

Pginer-WMF closed this task as Resolved.May 14 2019, 3:44 PM
Pginer-WMF claimed this task.
Pginer-WMF added a subscriber: Pginer-WMF.

An example is this edit where a previous translation has failed. At nowiki the template w:no:Template:Cite news is a shim. The actual template that should be used is w:no:Template:Kilde avis. The shim has no TemplateData and should not be used.

With the new version of the editor, it seems that the Cite news template in English is correctly transformed into w:no:Template:Kilde avis in Norwegian (Bokmål). So I'm closing the ticket, but feel free to provide more details or specific examples where the issue persists.

This quick link can be used for testing the translation. The 8 parameters from the source example have been transferred to the the published translation.