Page MenuHomePhabricator

CX1 Template editor (tracking) (deprecated)
Closed, InvalidPublic

Assigned To
None
Authored By
Pginer-WMF
Jul 5 2016, 7:30 AM
Referenced Files
F4533783: fields-editing-rich.png
Sep 28 2016, 6:42 PM
F4533785: fields-editing-poor.png
Sep 28 2016, 6:42 PM
F4402726: block templates - overview.png
Aug 26 2016, 2:12 PM
F4402729: inline templates - overview.png
Aug 26 2016, 2:12 PM
F4276753: adapted-block-template-editing.png
Jul 15 2016, 9:55 AM
F4276653: unadapted-block-template.png
Jul 15 2016, 9:55 AM
F4276713: adapted-block-template.png
Jul 15 2016, 9:55 AM
F4276725: adapted-block-template-hover.png
Jul 15 2016, 9:55 AM
Tokens
"Doubloon" token, awarded by RandomDSdevel."Love" token, awarded by Framawiki.

Description

The template editor was supported as part of Content Translation (CX1). When the new version (CX2) was developed the template editor was not supported and the default VE support for templates was used.

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:

block templates - overview.png (1×1 px, 188 KB)

inline templates - overview.png (1×1 px, 148 KB)

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

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
InvalidNone
Resolved santhosh
Resolved santhosh
OpenNone
Resolved santhosh
OpenNone
OpenNone
OpenNone
OpenNone
Resolved Petar.petkovic
OpenNone
Resolved santhosh
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedPginer-WMF
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolved santhosh
ResolvedNikerabbit
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedPginer-WMF
OpenNone

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

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]]}}

fields-editing-rich.png (820×1 px, 142 KB)

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

fields-editing-poor.png (820×1 px, 109 KB)

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.

Pginer-WMF renamed this task from Improved Content Translation template adaptation (tracking) to CX1 Template editor (tracking) (deprecated).Feb 21 2020, 4:21 PM
Pginer-WMF updated the task description. (Show Details)
Pppery subscribed.

Closing per the description update