Page MenuHomePhabricator

CX2: Don't add block templates to the translation if equivalent template is missing
Open, HighPublic

Description

Templates are not available in all languages, and we want to communicate these issues to the user (T192271). In addition, we want to provide a default behaviour that is useful and creates the least confusion.

Currently, block level templates for which there is no equivalent template in the target wiki get copied over to the translation. For example the Curiosity rover article on English has an Infobox spaceflight template which is missing in Spanish. When translating the Curiosity rover article from English to Spanish, the original English template is added to the Spanish translation (as shown below). The template name is shown in red text without any of the original information being visible, but it can be inspected showing the parameters are filled. This can be confusing and make the tool look broken.

Proposed solution

When a block template does not have a corresponding template for the target language, it should not be added to the translation. This combined with the warnings for template adaptation (T192271) should lead the user to a less confusing situation and reduce the chances of the wrong template to leak into the translation.

  • "Add new template" action will open the new template dialog in order to insert a new template to the translated paragraph, in the same way as if the user accessed the option to add a template from the edit toolbar.

Note that this proposal is only for those cases where we cannot find a corresponding template. If we can find the right template, it will be added to the translation (even if the mapping of all the parameters could not be complete).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 20 2018, 11:32 AM
Pginer-WMF triaged this task as Normal priority.Sep 20 2018, 11:33 AM
Pginer-WMF updated the task description. (Show Details)Sep 20 2018, 11:59 AM
Arrbee moved this task from Needs Triage to CX2 on the ContentTranslation board.Oct 1 2018, 1:52 PM
Pginer-WMF updated the task description. (Show Details)Nov 6 2018, 11:28 AM

Change 472075 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Remove missing block templates

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

Change 472075 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Remove missing block templates

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

After doing QA, this ticket should be moved to In progress column to implement "Add new template" action inside an issue card.

Change 473154 had a related patch set uploaded (by Nikerabbit; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] ve.ce.CXTransclusionBlockNode: Prevent js error when the model is null

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

Change 473154 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] ve.ce.CXTransclusionBlockNode: Prevent js error when the model is null

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

Etonkovidova closed this task as Resolved.EditedNov 15 2018, 1:10 AM
Etonkovidova added a subscriber: Etonkovidova.

@Pginer-WMF - "Add new template" and "Learn more" options are not displayed on the "Template unavailable" issue card. The template might be added via Insert-Tempalte menu, so for now I am marking this ticket as 'Resolved' (unless you still want these options to be part of the ticket) .

I tried this in production and the basics are there, but found a couple aspects to improve:

  • The empty paragraph should be editable and focused. Currently, an empty area is generated on the translation paragraph, but the user cannot type immediately there, and the associated issue card is not shown as expanded because the input focus is not in the paragraph. This makes it hard to orient and understand what's going on. The expected result is for the input focus to be in the empty paragraph (similar to when a text paragraph is added with the "No MT option"), which will show the warning card expanded with all the details, and users can just type the content they want to.
  • Keep the target template if there is an equivalent template. The approach described in this ticket was intended for block templates for which the equivalent template does not exist, and only for such case. However, for cases where the equivalent template exists according to Wikidata it seems that the template is also removed currently. I used Tokyo (en -> es) as an example, where the Infobox settlement is available in Spanish among other languages. In such cases we should keep the template (even if the parameters could not be transferred to the target template), for the user to add the details manually. More details about this scenario are covered in T209473: CX2: Communicate template exists in the target wiki but mapping could not be completed).

Change 475987 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Remove the template only if target template does not exit

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

Pginer-WMF raised the priority of this task from Normal to High.Dec 5 2018, 10:11 AM

Change 475987 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Remove the template only if target template does not exist

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

Petar.petkovic added a subscriber: santhosh.

Change 486204 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Put "Add new template" button inside missing block template issue card

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

Change 488068 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Use empty paragraph for unadapted block templates

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

Change 486204 merged by Nikerabbit:
[mediawiki/extensions/ContentTranslation@master] Put "Add new template" button inside missing block template issue card

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

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptMar 18 2019, 11:44 AM
Arrbee added a subscriber: Arrbee.Apr 17 2019, 7:39 AM

@Petar.petkovic are we stuck on reviews here?

@Petar.petkovic are we stuck on reviews here?

While it's true that the patch haven't got much reviews, the patch is causing some problems with saving user edits when block template is missing and that part needs to be fixed before merging.

Change 488068 had a related patch set uploaded (by Nikerabbit; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Use empty paragraph for unadapted block templates

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

There seems to be some issues identifying and distinguishing the cases of templates not being found vs. templates being found but not filled. I created a separate ticket (T224437: Incomplete template adaptation presented as missing) but this may be relevant for the current one too.

Patch for this ticket is in progress for a long time because there are transaction problems when missing block template is replaced with empty paragraph and user starts typing. @Esanders could you take a look to see what the problem is?

JTannerWMF moved this task from To Triage to Needs Discussion/Analysis on the VisualEditor board.
JTannerWMF added a subscriber: JTannerWMF.

Adding this to our board for visibility