Page MenuHomePhabricator

Basic support for Template card in Section Translation
Closed, ResolvedPublic

Description

As part of the initial support for block templates (T294650), we plan to show a specific template card when translating a block template.
This ticket captures the essential aspects of such card as a first iteration (more context in the parent ticket: T294650)

When a block template is in the source article, the whole template will be hishlighted and the suggested template will be shown in this new card.

Overview.png (768×1 px, 136 KB)
Template card Layout.png (768×1 px, 70 KB)

A custom card will replace the card proposing a translation. For templates, the contents fo the template are not shown translated due to the limited space. Instead, the following is shown:

  • Source template name with a template icon.
  • Suggested template with an option to edit it.
    • If there is no equivalent template, a message indicating so will be shown ("Apply" action will be disabled in such case).
    • Editing the template will lead to the edit view with the template editor open for the adapted template in the target language.
    • The rest of the process should work in the same way it does for sentences: saving changes or applying moves to the next element (sentence, image, template, etc.).

Mapping.png (768×1 px, 67 KB)


Follow-up tickets will expand the card with:

  • Parameter mapping success indicator
  • Option to replace the template with an alternative one.

Event Timeline

Change 742184 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX Pick a sentence: Add BlockTemplateAdaptationCard SFC

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

Change 743192 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX: Check if target template exists before re-rendering

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

Change 742184 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX Pick a sentence: Add BlockTemplateAdaptationCard SFC

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

Change 743192 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Check if target template exists before re-rendering

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

Change 754807 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.1.0+20220118

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

Change 754807 merged by Santhosh:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.1.0+20220118

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

Tried to translate the "Preparation" section of the Paneer article from English to Thai and the template card kept loading indefinitely when the Infobox nutritional value template (which does exist in Thai ) was selected:

test.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&title=Special%3AContentTranslation&from=en&to=th&sx=true&page=Paneer(iPhone SE).png (1×750 px, 106 KB)

Related cxserver changes are not deployed yet. They were bundled with Flores MT deployment patch https://gerrit.wikimedia.org/r/c/operations/deployment-charts/+/751547. Ideally it should not have grouped.

I tried again and the card is shown for the previous example (where the template exists in the target language):

test.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&title=Special%3AContentTranslation&from=en&to=th&sx=true&page=Paneer(iPhone SE) (1).png (1×750 px, 110 KB)

However, the infinite load still happens for cases where the template does not exist in the target wiki (T300954). I also found another issue (T300958) while testing this. In both cases, I think it is ok to keep them as separate follow-ups.

However, before resolving the current ticket and creating more follow-ups I wanted to confirm with @ngkountas whether the following part of the spec is expected to be supported:

  • Suggested template with an option to edit it.
    • If there is no equivalent template, a message indicating so will be shown ("Apply" action will be disabled in such case).
    • Editing the template will lead to the edit view with the template editor open for the adapted template in the target language.
    • The rest of the process should work in the same way it does for sentences: saving changes or applying moves to the next element (sentence, image, template, etc.).

Mapping.png (768×1 px, 67 KB)

@Pginer-WMF regarding the question above, the functionality about missing templates (or templates without matching parameters) has indeed been implemented but at this point it doesn't work properly. So for QA purposes, we can simply ignore them for this ticket and focus on the support of partially and fully supported templates. Missing templates are currently blocked by the issue tracked in this task (T300954) and we can further investigate it and review it again once we fix that issue.

Perfect. Thanks for the clarifications, @ngkountas. I created a follow-up ticket to capture how the suggested template info and style adapts to each case: T304293: Communicate the different levels of template availability

@ngkountas thanks for the clarification

With available templates for a specific language, users are able to perform section translation

When templates for a section is not available in a language it reads "Equivalent template not available for XXX"

Screen Shot 2022-06-12 at 7.33.50 PM.png (646×317 px, 192 KB)

QA PASS