Page MenuHomePhabricator

Links to templates in CX go to wrong wiki
Closed, ResolvedPublic4 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

It points to https://en.wikipedia.org/wiki/Mod%C3%A8le:Infobox_Musique_(artiste), which goes nowhere

What should have happened instead?:

It should point to https://fr.wikipedia.org/wiki/Mod%C3%A8le:Infobox_Musique_(artiste)

Other information (browser name/version, screenshots, etc.):

Discovered while testing T338360

Event Timeline

Nikerabbit moved this task from Needs Triage to Bugs on the ContentTranslation board.
hueitan renamed this task from Links to templates in ContentTranslation go to wrong wiki to Links to templates/images in ContentTranslation go to wrong wiki.Apr 10 2025, 12:47 AM
hueitan updated the task description. (Show Details)

Note:

Template - transclusion node

In the ve.ui.CXTransclusionContextItem class, which extends ve.ui.MWTransclusionContextItem for handling transclusion nodes in Content Translation (CX).

Currently, the setup method in ve.ui.CXTransclusionContextItem checks if the transclusion is missing in the target language using this.model.missingInTargetLanguage(). However, this approach doesn't consider the actual source and target languages (target surface) of the translation.

Instead, in the MWTransclusionNode class, the getDescriptionDom method uses a relative link to describe the transclusion, such as:

<a href="/wiki/Vorlage:Infobox_Ort_in_Polen" rel="noopener" target="blank">:Vorlage:Infobox Ort in Polen</a>

This approach doesn't account for the language-specific context of the Content Translation, leading to incorrect transclusions in the target language.
To resolve this issue, we need to modify ve.ui.CXTransclusionContextItem to properly handle transclusion nodes based on the target surface languages of the translation, ensuring that the correct transclusions are displayed or hidden as appropriate.

hueitan renamed this task from Links to templates/images in ContentTranslation go to wrong wiki to Links to templates in CX go to wrong wiki.Apr 15 2025, 7:20 AM
hueitan updated the task description. (Show Details)
Nikerabbit subscribed.

Initial estimate

Change #1140186 had a related patch set uploaded (by Huei Tan; author: Huei Tan):

[mediawiki/extensions/ContentTranslation@master] POC: Links to templates in CX

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

Change #1140186 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Fix target language for transclusion Context Item

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