Page MenuHomePhabricator

Communicate the different levels of template availability
Closed, ResolvedPublic2 Estimated Story Points

Assigned To
Authored By
Pginer-WMF
Mar 21 2022, 10:20 AM

Description

As a follow-up to the work on the template card (T295973) for the mobile editor of Section Translation, we want to communicate the different levels of data availability by adjusting the message, visual style and actions available in each case:

  • No equivalent template. If there is no equivalent template, a message indicating so ("Equivalent template not available for <target-language>") will be shown with a grey background. The "Apply" action will be disabled in such case.
  • No parameters match. The target template exists, and the source template has filled parameters but none of them could be copied to the target. Thus, the template can be added, but it will be empty. A grey background will be used. The action to edit is labelled as "Edit the translation". The action to "Apply" is active and adds the target template with no filled parameters.
  • Parameters matching. Some (or all) the parameters from the source template can be transferred to the target (this includes the case where source has no parameters filled). Background is blue and the edit action is labelled as "Review and edit translation". The action to "Apply" adds the target template with some parameters filled with the data from the source one.

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


Note that a separate ticket will be adding an indicator to explain the adaptation status in more detail by using an icon an explanatory panel: T295545: Explain the template mapping status

Event Timeline

santhosh set the point value for this task to 2.Apr 5 2022, 5:58 AM

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

[mediawiki/extensions/ContentTranslation@master] SX block template adaptation: Support different availability levels

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

Change 790741 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX block template adaptation: Support different availability levels

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

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

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20220517

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

Change 792418 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20220517

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

@ngkountas couple of questions here,

  • In the first image the ellipsis (3 dot) is missing, should it be there? As shown in your mock above
  • In the second image should there be a text message next to the icon ?

Article used for testing/translation here : PKO Bank Polski

Screen Shot 2022-06-27 at 10.31.02 PM.png (865×466 px, 167 KB)

Screen Shot 2022-06-27 at 10.33.57 PM.png (859×440 px, 189 KB)

  • In the first image the ellipsis (3 dot) is missing, should it be there? As shown in your mock above

In this case, I think the issue is in the mockup. The three dots are not expected to be shown for the template card.

  • In the second image should there be a text message next to the icon ?

Good catch. The label should always show the name of the original template (i.e., the template in the source language). In this particular case, the template is missing in the target language, but the source name should still be available.

We may want to double-check that the source language name is used in all the cases (e.g., the first example showing "Distinguish" in both cases does not make it clear whether source or target is used).

To add to the second question, this is something that happens in some (relatively rare) cases, where the source templates miss a template definition. In this specific case for example, although the source template has an "about" attribute and thus is recognized as a block template by our code, it doesn't hold any template definition (no "mw" data attribute) and the source template name is not available. This is the reason why it's not displayed in the screenshot. For sure this is not desirable, but there is a lot of room for such kind of improvements in block templates, so that we can safely support all unique cases.

To add to the second question, this is something that happens in some (relatively rare) cases, where the source templates miss a template definition. In this specific case for example, although the source template has an "about" attribute and thus is recognized as a block template by our code, it doesn't hold any template definition (no "mw" data attribute) and the source template name is not available. This is the reason why it's not displayed in the screenshot. For sure this is not desirable, but there is a lot of room for such kind of improvements in block templates, so that we can safely support all unique cases.

Thanks for the added context. Based on that, this does not seem a blocker for the current task. I think that makes sense to capture this as a separate ticket. So I created T311500: Avoid template card showing an empty name when template definition is missing.
There we can discuss whether to try to get the template name in some way, or use a generic "Template" indicator.

@Pginer-WMF that being said, we can move to this to the done column and and use T311500 to address the second issue correct ?

@Pginer-WMF that being said, we can move to this to the done column and and use T311500 to address the second issue correct ?

Yes. My only consideration is that the ticket covers 3 scenarios (No equivalent template, No parameters match, and Parameters matching). However, in the comments I only saw screenshots for two of them (No equivalent template, and Parameters matching). So I wanted to check if the three scenarios were verified.

@ngkountas is there a fast way to get to an article where one can observe No parameters match data availability? As I have checked out a lot of articles and I am yet to observe it

@Pginer-WMF I am able to get an article for the two scenarios. for the third ( No parameters match ) , its a bit different difficult to get an article with such a template. If you do have a template I can check or test with for this specific scenario I'll appreciate or I can keep checking.

@Pginer-WMF I am able to get an article for the two scenarios. for the third ( No parameters match ) , its a bit different difficult to get an article with such a template. If you do have a template I can check or test with for this specific scenario I'll appreciate or I can keep checking.

I tried translating the Etymology section of the Tokyo article from English to Urdu in the test server. The first template of Infobox Chinese type with an equivalent in Urdu that seems to lack metadata, and parameters cannot be transferred. It seems to be rendered according to the ticket description:

Template cardEditing sentenceEditing templateApplied
test.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&title=Special%3AContentTranslation&from=en&to=ur&sx=true&page=Tokyo(iPhone SE).png (1×750 px, 97 KB)
test.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&title=Special%3AContentTranslation&from=en&to=ur&sx=true&page=Tokyo(iPhone SE) (1).png (1×750 px, 31 KB)
test.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&title=Special%3AContentTranslation&from=en&to=ur&sx=true&page=Tokyo(iPhone SE) (2).png (1×750 px, 78 KB)
test.m.wikipedia.org_w_index.php_title=Special_ContentTranslation&title=Special%3AContentTranslation&from=en&to=ur&sx=true&page=Tokyo(iPhone SE) (3).png (1×750 px, 176 KB)

@Pginer-WMF yes this is exactly what we were looking for. It also satisfies the last template. We can move this to DONE.

Thanks!