Page MenuHomePhabricator

Mobile site shows icons with wrong size when accessed in Google translate
Closed, ResolvedPublic

Description

Try accessing an english wikipedia page in Google translate

https://translate.google.com/translate?hl=id&sl=en&tl=id&u=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FProxima_Centauri&sandbox=1

The top edit actions is shown as below

image.png (200×1 px, 22 KB)

Event Timeline

Google translate modifies the DOM as below:

image.png (238×1 px, 70 KB)

and it is conflicting with the defined styles for these items in page actions bar.

There are two solutions I can think of:

  1. Quick and less clean solution: Add notranslate class or translate=no attribute to the ul.page-actions element. So the DOM for this bar is untouched by Google translate
  2. Slow and clean solution: Rewrite the style for the items in the page actions bar so that is guards against the above kind of page modifications. The icon has background-size=100% and it is relative to the text displayed. The way the text is hidden text-indent: -999px is a bit fragile with environments like Google Translate.

Change 496135 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/skins/MinervaNeue@master] Ensure page-actions icons are display:block

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

Change 496135 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Ensure page-actions icons are display:block

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

Change 496364 had a related patch set uploaded (by KartikMistry; owner: Jdrewniak):
[mediawiki/skins/MinervaNeue@wmf/1.33.0-wmf.21] Ensure page-actions icons are display:block

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

Change 496364 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@wmf/1.33.0-wmf.21] Ensure page-actions icons are display:block

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

Mentioned in SAL (#wikimedia-operations) [2019-03-14T11:45:44Z] <kartik@deploy1001> Synchronized php-1.33.0-wmf.21/skins/MinervaNeue: SWAT: [[gerrit:496364|Ensure page-actions icons are display:block (T218182) (duration: 00m 57s)