Add a way to denote different desired behaviors for different types of templates
Open, Needs TriagePublic


ContentTranslation needs to deal with templates a lot. One of the issues that comes up quite often is that different groups of templates need to be handled differently.

Ideally, Content Translation should help translators focus on writing the article's prose and deal as little as possible with markup, formatting, templates' technicalities, etc.

Some templates are relevant to the article's content, and they can and should be adapted, but there are templates that don't need adaptation at all, and there are several subtypes of those.

  • Some templates are useful in the source language because of inherent features of that language, and should be virtually substituted before translation. For example, the {{Ha}} template in the Hebrew Wikipedia is a wiki syntax typing shortcut that relies on a feature of the Hebrew grammar, so it is irrelevant in all other languages. {{Ha|Knesset}} expands to [[Haknesset|Knesset]], and the translation interface should have [[Haknesset|Knesset]] and not the template. (I transliterated the Hebrew letters for easier readability.)
  • Some templates are completely irrelevant to the translation process, and shouldn't be loaded into the translation interface at all if they can't be adapted. For example, navigation templates, or templates with links to portals, especially if these templates or portals don't exist in the target wiki.
  • Some templates are mostly for formatting text, for example English Wikipedia's {{Quote}}. If such a template cannot be adapted to the target Wikipedia, it may still be useful to simply auto-copy the text to the translation. If not adapted at all, this will look like a strange hole in the translation.

How can this be implemented? I can think of several ways:

  1. Putting templates of the above types in categories. This doesn't require creating magic words and doesn't require changes in core MediaWiki, but it will still require changes in the ContentTranslation extension so it would be able to read them, and it will require configuring the category names for each wiki.
  2. Magic words registered and implemented in the ContentTranslation extension. This is similar to #1, but has the advantage of easier localization: the magic words would simply be available everywhere without the need to create categories.
  3. Magic words implemented in core MediaWiki. Knowing these properties of templates can be useful beyond translation.
  4. New properties in the TemplateData extension. This will require some changes to the TemplateData editor. For example, there could be a property like "translationAction", with the possible values of "pre-substitute", "hideIfUnadaptable", "copyValueIfUnadaptable". Or, the names could be less tied to translation, for example "templateFamily" with the values "languageSpecific", "navigation", "formatting".

What makes the most sense to me is the TemplateData way, because TemplateData is already the way to specify metadata about the template, but other thoughts are welcome.

Amire80 created this task.May 11 2017, 3:33 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptMay 11 2017, 3:33 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Amire80 renamed this task from There is no way to denote different desired behaviors for different types of templates to Add a way to denote different desired behaviors for different types of templates.Jun 20 2017, 10:11 AM
Framawiki added a subscriber: Framawiki.