Page MenuHomePhabricator

CX2 adds unnecessary id attributes to tables, table cells
Open, NormalPublic

Description

CX2 should not add unnecessary id attributes to various elements, as it currently does by adding numeric id values to tables, table lines, table cells...

Example on frwiki "Liste des motos BMX": original translation

{| class="toccolours" id="17" width="100%" cellspacing="1" cellpadding="1" 
| rowspan="2" id="20" width="1%" bgcolor="#DCDCDC" align="center" |'''Cylindrée'''
| rowspan="2" id="22" width="1%" bgcolor="#DCDCDC" align="center" |'''Type'''
| colspan="7" id="24" bgcolor="#DCDCDC" align="center" |Années [[1920er|1920]]
| colspan="10" id="27" bgcolor="#DCDCDC" align="center" |[[1930er]]
| colspan="6" id="30" bgcolor="#DCDCDC" align="center" |[[1940er]]
|- id="33" bgcolor="#F0F0F0" align="center"
| id="34" width="2%" |3
| id="36" width="2%" |4
| id="38" width="2%" |5
| id="40" width="2%" |6
| id="42" width="2%" |7

Event Timeline

NicoV created this task.Jan 9 2019, 12:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 9 2019, 12:22 PM
Pginer-WMF added a subscriber: Pginer-WMF.

We may want to investigate if this is a specific issue of ContentTranslation, VisualEditor, or Parsoid

Change 485606 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Before publishing, remove id attributes from table cells

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

santhosh triaged this task as Normal priority.Jan 21 2019, 9:31 AM

It seems that “id” is the only attribute that should not be in the example of the ticket, since the rest contribute to the aspect of the table. If these ids are coming from CX-cxserver, we can remove those at the pre-publish cleaning code.

Change 485606 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Before publishing, remove id attributes from table cells

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

Etonkovidova closed this task as Resolved.Jan 23 2019, 12:00 AM
Etonkovidova added a subscriber: Etonkovidova.

Checked iin cx2-testing - the explicit references to id have been removed, so the same table from Liste des motos BMW will look as the following:

{| class="toccolours" cellpadding="1" cellspacing="1" id="17" width="100%" 
| rowspan="2" align="center" bgcolor="#DCDCDC" width="1%" |'''Cylindrée'''
| rowspan="2" align="center" bgcolor="#DCDCDC" width="1%" |'''Tipo'''
| colspan="7" align="center" bgcolor="#DCDCDC" |Años 1920
| colspan="10" align="center" bgcolor="#DCDCDC" |Años 1930
| colspan="6" align="center" bgcolor="#DCDCDC" |Años 1940
|- align="center" bgcolor="#F0F0F0"
| width="2%" |23
| width="2%" |24
| width="2%" |25
| width="2%" |26
| width="2%" |27
NicoV added a comment.EditedMar 4 2019, 10:29 AM

@Etonkovidova
It doesn't seem to be fixed at all : see for example San Antonio Commanders with id in various places (tables, div inside tables) created today

NicoV reopened this task as Open.Mar 4 2019, 10:30 AM
Petar.petkovic renamed this task from CX2: Adds unnecessary id attributes to tables, table cells to CX2 adds unnecessary id attributes to tables, table cells.Mar 5 2019, 9:05 PM

Other examples : Air Olaf (March 12th), Arvika (March 14th), Beechwood (manoir Vanderlip) (March 20th)...

Change 500853 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Remove id attributes from table markup, divs

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

Change 500853 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Remove id attributes from table markup, divs

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

Re-checked the reported translations -

  1. en: San Antonio Commanders has the following template:
==Staff==
{{San Antonio Commanders staff}}

The initial translation fr: San Antonio Commanders had the template translated as a table and had unnecessary id="98" and id="99"

== Personnel ==
{| class="toccolours" id="95" style="text-align: left;"
! colspan="7" id="98" style="background: #681A32; color: #FFFFFF; -moz-box-shadow: inset 2px 2px 0 #D12030, inset -2px -2px 0 #D12030; -webkit-box-shadow: inset 2px 2px 0 #D12030, inset -2px -2px 0 #D12030; box-shadow: inset 2px 2px 0 #D12030, inset -2px -2px 0 #D12030;;"
 |<div id="99" style="text-align:center; position:relative; white-space:nowrap; color:#FFFFFF;"> État-major des commandants de San Antonio </div>

Re-checking in wmf.5 - id are gone, but the template still being translated as a table when translated - was published as Utilisateur:Zilant17/published/san antonio

1== Personnel ==
2{| class="toccolours" style="text-align: left;"
3! colspan="7" style="background: #681A32; color: #FFFFFF; -moz-box-shadow: inset 2px 2px 0 #D12030, inset -2px -2px 0 #D12030; -webkit-box-shadow: inset 2px 2px 0 #D12030, inset -2px -2px 0 #D12030; box-shadow: inset 2px 2px 0 #D12030, inset -2px -2px 0 #D12030;;" |<div style="text-align:center; position:relative; white-space:nowrap; color:#FFFFFF;"> État-major des commandants de San Antonio </div>
4|-
5| colspan="7" style="text-align:right;" |
6|-
7| style="vertical-align:top;" |
8| style="font-size: 95%;vertical-align:top;" |
9; Front office
10
11* Directeur général - [[Daryl Johnston]]
12* Directeur du personnel des joueurs - Robert Morris
13* Directeur des opérations de football - [[John Peterson (American football)|John Peterson]]
14
15; L'entraîneur-chef
16
17* Entraîneur-chef - [[Mike Riley]]
18
19; Entraîneurs offensifs
20
21* Coordonnateur offensif / Quarterbacks - Matt Troxel
22* Les demis - [[Lyle Moevao]]
23* Récepteurs Wide - Keith Williams
24* Tight ends - Josh Oglesby
25* Coordonnateur du jeu ligne / course offensive - [[Jonathan Himebauch]]
26| width="35" |
27| style="vertical-align:top;" |
28| style="font-size: 95%;vertical-align:top;" |
29; Entraîneurs défensifs
30
31* Coordonnateur défensif / secondeurs internes - [[Jim Grobe]]
32* Ligne défensive / Équipes spéciales - [[Jeff McInerney]]
33* Secondeurs extérieurs - [[James Rodgers (gridiron football)|James Rodgers]]
34* Arrière défensif - [[Bill Bradley (American football)|Bill Bradley]]
35* Adjoints défenseurs - Kenny Watson
36|-
37| colspan="7" style="text-align:center;border:2px solid #D12030" |<div class="hlist" style="font-size:smaller; color:{{{FC}}}">
38; Conférence orientale
39: [[Template:Atlanta Legends staff|<span style="color:{{{FC}}}">ATL</span>]]
40: [[Template:Birmingham Iron staff|<span style="color:{{{FC}}}">BIR</span>]]
41: [[Template:Memphis Express staff|<span style="color:{{{FC}}}">MEM</span>]]
42: [[Template:Orlando Apollos staff|<span style="color:{{{FC}}}">ORL</span>]]
43
44; Conférence Ouest
45: [[Template:Arizona Hotshots staff|<span style="color:{{{FC}}}">ARI</span>]]
46: [[Template:Salt Lake Stallions staff|<span style="color:{{{FC}}}">SL</span>]]
47: [[Template:San Antonio Commanders staff|<span style="color:{{{FC}}}">SA</span>]]
48: [[Template:San Diego Fleet staff|<span style="color:{{{FC}}}">Dakota du Sud</span>]]
49</div>
50|}

  1. Rechecking in wmf.5 en:Airolaf. The original article has the following template
{{Weather box
|metric first=yes
|single line=yes
|location = Airolaf
|Jan high C = 24.1
|Feb high C = 24.4
|Mar high C = 25.1
|Apr high C = 26.2
|May high C = 27.4
|Jun high C = 29.8
|Jul high C = 30.9
|Aug high C = 30.5
|Sep high C = 29.2
|Oct high C = 26.7
|Nov high C = 25.3
|Dec high C = 24.0

|Jan mean C = 14.5
|Feb mean C = 15.2
|Mar mean C = 17.0
|Apr mean C = 19.1
|May mean C = 21.7
|Jun mean C = 23.5
|Jul mean C = 24.3 
|Aug mean C = 23.2
|Sep mean C = 20.6
|Oct mean C = 17.1
|Nov mean C = 14.9
|Dec mean C = 14.5

|Jan low F = 48.7
|Feb low F = 50.5
|Mar low F = 52.8
|Apr low F = 55.7
|May low F = 58.6
|Jun low F = 62.7
|Jul low F = 66.0
|Aug low F = 65.1
|Sep low F = 62.0
|Oct low F = 56.1
|Nov low F = 51.6
|Dec low F = 48.9
|precipitation colour = green
|Jan precipitation mm = 34
|Feb precipitation mm = 37
|Mar precipitation mm = 33
|Apr precipitation mm = 45
|May precipitation mm = 24
|Jun precipitation mm = 13
|Jul precipitation mm = 49
|Aug precipitation mm = 70
|Sep precipitation mm = 56
|Oct precipitation mm = 16
|Nov precipitation mm = 32
|Dec precipitation mm = 22
|source 1 = ''Climate-Data.org''<ref name="Climate-Data.org">{{cite web|title=Climate: Airolaf - Climate graph, Temperature graph, Climate table|url=http://en.climate-data.org/location/795473/|work=Climate-Data.org|accessdate=14 November 2014}}</ref>
}}

When it was first translated before the fix - it became a table with many id:


{| class="wikitable collapsible" id="93" style="width:100%; text-align:center; line-height: 1.2em; margin:auto;"
! colspan="14" id="96" | Données climatiques pour Airolaf 
|- style="background: #F1F1F1; color:#000000;"
! id="99" scope="row" | Mois 
! id="101" scope="col" | jan. 
! id="103" scope="col" | fév. 
! id="105" scope="col" | mars 
! id="107" scope="col" | avril 
! id="109" scope="col" | mai 
! id="111" scope="col" | juin 
! id="113" scope="col" | juil. 
! id="115" scope="col" | août 
! id="117" scope="col" | sep. 
! id="119" scope="col" | oct. 
! id="121" scope="col" | nov. 
! id="123" scope="col" | déc. 
! id="125" scope="col" style="border-left-width:medium" | année 
|- style="text-align: center;"
! id="128" scope="row" style="height: 16px;" | Moyenne haute ° C (° F) 
| style="background: #FFFFAA; color:#000000;" | 22,0 <br />(71,6) 
| style="background: #FFFFAA; color:#000000;" | 22,7 <br />(72,9) 
| style="background: #FFFF88; color:#000000;" | 24,6 <br />(76.3) 
| style="background: #FFFF88; color:#000000;" | 26.3 <br />(79,3) 
| style="background: #FFCC33; color:#000000;" | 29.4 <br />(84,9) 
| style="background: #FFBB33; color:#000000;" | 31,9 <br />(89,4) 
| style="background: #FFBB33; color:#000000;" | 31,4 <br />(88,5) 
| style="background: #FFBB33; color:#000000;" | 30,5 <br />(86,9) 
| style="background: #FFCC33; color:#000000;" | 29,5 <br />(85,1) 
| style="background: #FFFF88; color:#000000;" | 26,7 <br />(80,1) 
| style="background: #FFFF88; color:#000000;" | 24.1 <br />(75,4) 
| style="background: #FFFFAA; color:#000000;" | 22.4 <br />(72,3) 
| style="background: #FFFF88; color:#000000; border-left-width:medium" | 26.8 <br />(80,2) 
|- style="text-align: center;"
! id="157" scope="row" style="height: 16px;" | Moyenne basse ° C (° F) 
| style="background: #F1F1F1; color:#000000;" | 9.3 <br />(48,7) 
| style="background: #F1F1F1; color:#000000;" | 10.3 <br />(50,5) 
| style="background: #F1F1F1; color:#000000;" | 11.6 <br />(52,8) 
| style="background: #FFEEBB; color:#000000;" | 13.2 <br />(55,7) 
| style="background: #FFEEBB; color:#000000;" | 14.8 <br />(58,6) 
| style="background: #FFFFCC; color:#000000;" | 17.1 <br />(62,7) 
| style="background: #FFFFBB; color:#000000;" | 18,9 <br />(66,0) 
| style="background: #FFFFBB; color:#000000;" | 18.4 <br />(65,1) 
| style="background: #FFFFCC; color:#000000;" | 16,7 <br />(62,0) 
| style="background: #FFEEBB; color:#000000;" | 13.4 <br />(56,1) 
| style="background: #F1F1F1; color:#000000;" | 10.9 <br />(51,6) 
| style="background: #F1F1F1; color:#000000;" | 9.4 <br />(48,9) 
| style="background: #FFEEBB; color:#000000; border-left-width:medium" | 13.7 <br />(56,6) 
|- style="text-align: center;"
! id="186" scope="row" style="height: 16px;" | Précipitations [[Precipitation|moyennes]] mm (pouces) 
| style="background: #CCFFCC; color:#000000;" | 34 <br />(1.3) 
| style="background: #C2FFC2; color:#000000;" | 37 <br />(1.5) 
| style="background: #CDFFCD; color:#000000;" | 33 <br />(1.3) 
| style="background: #B9FFB9; color:#000000;" | 45 <br />(1.8) 
| style="background: #DBFFDB; color:#000000;" | 24 <br />(0.9) 
| style="background: #EAFFEA; color:#000000;" | 13 <br />(0.5) 
| style="background: #B5FFB5; color:#000000;" | 49 <br />(1.9) 
| style="background: #96FF96; color:#000000;" | 70 <br />(2.8) 
| style="background: #A8FFA8; color:#000000;" | 56 <br />(2.2) 
| style="background: #E7FFE7; color:#000000;" | 16 <br />(0.6) 
| style="background: #CDFFCD; color:#000000;" | 32 <br />(1.3) 
| style="background: #DEFFDE; color:#000000;" | 22 <br />(0.9) 
| style="background: #C8FFC8; color:#000000; border-left-width:medium" | 431 <br />(17) 
|-
| colspan="14" style="text-align:center;font-size:95%;" | Source: ''Climate-Data.org'' <ref name="Climate-Data.org"><cite class="citation web">[http://en.climate-data.org/location/795473/ "Climate: Airolaf - Climate graph, Temperature graph, Climate table"]. ''Climate-Data.org''<span class="reference-accessdate">. Retrieved <span class="nowrap">14 November</span> 2014</span>.</cite></ref> 
|}

Now, when translated - Utilisateur:Zilant17/published/T213273- the template would be translated as a partially matched template, not as a table.
{{Climat}}

Etonkovidova closed this task as Resolved.May 19 2019, 4:58 PM

Checked couple of most recent translations with tables - Liste des aéroports les plus fréquentés aux Pays-Bas Sauter à la navigationSauter à la recherche, Jalisse, Nancy Galbraith - the id are not added to tables.

Resolving the task again.

NicoV reopened this task as Open.Jul 10 2019, 12:08 PM

Reopening the task as it still doesn't work all the time: there are still id attributes in table titles.

See https://fr.wikipedia.org/w/index.php?title=Cabinet_de_Travail_%28Joko_Widodo%29&type=revision&diff=160792188&oldid=160617170