This ticket explores how to provide support the translation of block templates such as infoboxes. This involves providing a way to include/remove them as well as editing them in the context of a translation (allowing to compare source and translated content in a fluent experience).
[[ http://pauginer.github.io/prototypes/translation/block-templates/index.html | A prototype ]] allows you to try the main concept also captured below:
{F4367691, size=full}
# Design goals
- **Edit as usual.** Templates contain content that users want to translate/adapt. Having an initial translation for it, getting links properly adapted and edit content as rich text is expected when manipulating the content inside a template. That is, the editing support that Content Translation provides should still be available when editing content even if it is part of a template.
- **Fluent editing.** Editing in place without blocking the user contributes to a more fluent experience.
- User control. The user should be in charge on deciding which templates to include and how to adapt them.
# Proposed solution
I'm illustrating a solution in two scenarios:
**Template cannot be adapted**
{F4276653, width=600}
- After adding a section to translate, the translation shows a block indicating that the template was not adapted.
- A template card in the tools panel provides options on how to adapt it:
-- "Keep original template" will keep the source template as is. After publishing, a reminder (guided tour or notification) will encourage the user to adapt the template manually.
-- "Skip template" will remove the template and skip it from being included when publishing.
- The template card may include a link to "translate missing templates" to lead the user towards the process of providing the mapping information for this kind of templates if such process exist (as part of CSX or separate tool).
**Template is adapted and the user edits its content**
{F4276713, width=600}
- By default, a block template such as an infobox should be added to the translation as any other paragraph. The equivalent template in the taget language should be used and the information should be translated according to the Automatic translation" strategy used by the user (e.g., translated with Apertium or using source text).
- A special template card will show the corresponding templates and provide control on the template presence (adapt, keep original or skip).
{F4376173, width=600}
- When the user is in the translated template section, hovering the template will invite the user to edit its contents. Clicking will change the template to edit mode...
{F4276753, width=600}
- Template content is presented as a connected list of rich text editable sections with a label. Users can edit their content but not the labels.
- In editing mode, both source and target templates are presented in this tabular format (only target being editable).
- Sections are aligned between source and target templates. The equivalent parameters are shown side by side and editing the target content will make both expand to keep them aligned.
- Only the parameters used in the source will be shown in the target. The target template will have a "View more properties" that will list the remaining parameters for the target template. This allows the user to fill some parameters that do not exist in the source (or were not filled) but are necessary for the target wiki.
- There will be only one template in edit mode at a time. Moving out of the section or editing a different template will restore the template to display mode. Similarly, editing a template inside a template will replace the whole block (the back action can be used to go back to the previous context).