Page MenuHomePhabricator

Do not try to adapt the transclusion fragements
Closed, ResolvedPublic

Description

Suppose there is a transclusion element like <span about="5"data-mw={}... and next to that a <figure-inline about="5">..., right now cxserver tries to adapt the figure-inline using MWImage module. This is unnecessary and waste of time. Adapting the original transclusion is enough.

Checking for the existance of about attribute and missing data-mw attribute will be enough for skipping such a tag from adaptation process.

Also, if this figure-inline is inside the span tag, then also, we don't need to adapt. This will require correctly understanding the context of figure in the Doc.prototype.adapt method

Event Timeline

Pginer-WMF triaged this task as Medium priority.Jul 20 2018, 8:29 AM
Pginer-WMF moved this task from Backlog to Page contents issues on the CX-cxserver board.

Change 464796 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Do not adapt the translation units under a transclusion context

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

Timing analysis for translate api for infobox of en:Vantaa

Before the patchAfter the patch
image.png (309×1 px, 20 KB)
image.png (309×1 px, 20 KB)

33s to 3s!. No machine translation requests generated.

Change 464796 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Do not adapt the translation units under a transclusion context

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

Mentioned in SAL (#wikimedia-operations) [2018-10-22T04:37:35Z] <kartik@deploy1001> Finished deploy [cxserver/deploy@904151f]: Update cxserver to eee8974 (T207070, T203077, T199529) (duration: 05m 42s)