Improved Content Translation template adaptation (tracking)
Open, NormalPublic

Description

Translating content with templates presents several challenges. Some simple approaches were defined initially for Content Translation to provide some support for this process, but as we want to support more advanced scenarios we need to find better solutions.

As part of this ticket we'll analyse the current problems and provide ideas to better support template adaptation. Different ideas are covered in more detail as subtickets:

An overview of the general interaction models is provided below for both block and inline templates:

Issues found during the research of template translation are listed in:

Related Objects

StatusAssignedTask
OpenNone
OpenNone
OpenNone
Resolvedsanthosh
Resolvedsanthosh
OpenNone
Resolvedsanthosh
OpenPginer-WMF
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedsanthosh
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedPginer-WMF
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedsanthosh
ResolvedNikerabbit
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
There are a very large number of changes, so older changes are hidden. Show Older Changes
Amire80 renamed this task from Designs for improved template adaptation (tracking) to Improved Content Translation template adaptation (tracking).Sep 13 2016, 7:09 AM
Amire80 removed Pginer-WMF as the assignee of this task.
Pginer-WMF updated the task description. (Show Details)Sep 27 2016, 12:15 PM

The designs for this task show a rich-text editing feature for template parameters, but VisualEditor doesn't even have that yet, because it's hard. For example, you assume that parameters that are page names or image names will be editable as links/images, but that's probably only the case if the template call looks like {{foo|link=[[Bar]]|image=[[File:Baz.png]]}} as opposed to {{foo|link=Bar|image=Baz.png}}. More generally, templates can do insane things with their parameters, like not rendering them (yes/no params for example are not rendered directly), rendering them conditionally, or rendering a manipulated version of them. Template wikitext is basically a programming language, and Lua is an actual programming language, so anything is possible.

For infoboxes it's generally the case that parameters are rendered exactly as they are input, but this assumption breaks down in more complex cases. That wouldn't be much of a problem if you could tell which parameters are safe/suitable for rich-text editing and which aren't, but without special TemplateData or Parsoid support (or maybe both) I don't think you can.

For example, you assume that parameters that are page names or image names will be editable as links/images, but that's probably only the case if the template call looks like {{foo|link=[[Bar]]|image=[[File:Baz.png]]}} as opposed to {{foo|link=Bar|image=Baz.png}}.

If the template is like the later, it has two parameters that are filled with two pieces of text, and that is what will be represented in the editor. There are no plans to do any kind of magic to figure out what text may be interpreted as. Rendering it as rich text would make a difference only when the content has wiki markup.

I recreated below how the templates could be translated in both cases:

{{foo|link=[[Bar]]|image=[[File:Baz.png]]}}

{{foo|link=Bar|image=Baz.png}}

In the second case, I agree you don't get the benefits of visualising the result (as it happens with the current template editor), but you still have the parameters aligned to facilitate the back and forth of translation, the regular tools for editing available as with any regular paragraph if needed (e.g., automatic translation in case you needed to translate "bar" into Spanish), and the ability to comfortably write more than one line of content. I'm not sure which is the problem in this case.

For translating we don't need to support all kinds of templates (since currently very few are supported), but I have not found an example that didn't fit in the proposed model (one of the most challenging parts is the use of templates as parameters for other templates, but I think they can work in the current model and will document that in T145857). If anyone can point to a template in a Wikipedia page that seems specially complex, I can try to represent it with the proposed model to see where it falls short.

Framawiki added a subscriber: Framawiki.
Pginer-WMF updated the task description. (Show Details)Mar 23 2017, 10:06 AM