Page MenuHomePhabricator

Support for manual mappings in template translation
Open, MediumPublic

Description

As part of template translation (T139332), users may find situations where there is not an automating mapping between the source and target templates. Users should be able to indicate the mapping manually when there is not existing mapping between the fields in the source and the target templates.

Proposed solution

When there is no mapping between the source and the target template, users can define such mapping. Similarly to what is done with paragraphs in a translation, users will add fields one by one and indicate the corresponding mapping with the target template.

manual-invite.png (820×1 px, 120 KB)

  • Initially no fields are added.
  • Users are invited to add the field they hover (or the initial one if none has been added.
  • Corresponding fields are highlighted.

manual-added.png (820×1 px, 125 KB)

  • Once a field is added, the content is adapted by following the usual approach (which users can change).
  • Users need to select the target field.

manual-select-field.png (820×1 px, 137 KB)

  • Selection aids are provided to easily select the mapping.
  • Field names are shown with one line of the description to show additional context.
  • Unassigned fields are shown on top.

manual-editing.png (820×1 px, 133 KB)

  • Once the mapping is established, users are able to change it to another field.

Event Timeline

Initially no fields are added.

In many cases, we can automatically find mappings and prefill the values(using template data or even with the proposed stored param mapping as JSONConfig). In such cases, dont we want to automattically add those fields and provide options to add the rest?

For example, A common template like {{Convert}} has nameless params and hence params are names as 1,2,3... We can easily map them to a target language automatically and provide the translator as initial form values.

Initially no fields are added.

In many cases, we can automatically find mappings and prefill the values(using template data or even with the proposed stored param mapping as JSONConfig). In such cases, dont we want to automattically add those fields and provide options to add the rest?

The "manual mapping" strategy is proposed as a fallback for the cases when automatic mapping is not possible. If we know which parameter in the translation corresponds to the source one, we should provide it already filled. If we do not know, we let the user decide which parameters are needed.

  • Recursive template editing. Templates may contain fields which contain a template. It should be possible to edit those.

I created a separate ticket for recursive templates:

T147428: Support translation of recursive templates

(I'll do the same for "Compact unused fields" and leave the current ticket for "manual mapping" which already seems big enough to fit a singe ticket)

Pginer-WMF renamed this task from Designs for editing complex mappings in template translation to Designs for manual mappings in template translation.Nov 10 2016, 2:02 PM
Pginer-WMF updated the task description. (Show Details)

Change 320971 had a related patch set uploaded (by Santhosh):
Manual template param adaptation using placeholder

https://gerrit.wikimedia.org/r/320971

Change 320971 merged by jenkins-bot:
Manual template param adaptation using placeholder

https://gerrit.wikimedia.org/r/320971

Amire80 updated the task description. (Show Details)

"Unassigned fields are shown on top." — this makes sense, but most of them will probably be unassigned, at least initially, so it should be more like "assigned fields are shown at the bottom" (or maybe not shown at all).

Other than that it sounds right.

Design part completed in current sprint. Moving to backlog for later implementation.

Arrbee renamed this task from Designs for manual mappings in template translation to Support for manual mappings in template translation.Dec 6 2016, 6:56 AM