Page MenuHomePhabricator

lang attribute of page title is empty
Closed, ResolvedPublic

Description

Currently the lang attribute of the main page heading is empty. It should be either correct or not there at all.

<h1 id="firstHeading" class="firstHeading" lang="">...</h1>

Event Timeline

Michael created this task.Mar 27 2019, 10:22 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 27 2019, 10:22 AM

Weird – I can see this on the wikidata-shex test system, but locally the language code is there.

That <h1> comes from MediaWiki itself, we are only handling its content. So this seems to be a configuration issue?

This is also broken on wikidata.org :/ ==> Adding campsite.

Michael edited projects, added Vector; removed Shape Expressions.Mar 28 2019, 10:54 AM

Turns out even en.wikipedia.org is affected as this is a problem in the vector template. Patch coming.

Change 499743 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/skins/Vector@master] Fix invalid lang attribute on first heading

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

Change 499743 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Fix invalid lang attribute on first heading

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

@Fomafix proposed a different approach in b66510cbd29a

Also empty on fr.wikipedia.org.

Change 500158 had a related patch set uploaded (by Krinkle; owner: Michael Große):
[mediawiki/skins/Vector@wmf/1.33.0-wmf.23] Fix invalid lang attribute on first heading

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

Krinkle closed this task as Resolved.Mar 30 2019, 3:02 AM
Krinkle claimed this task.
Krinkle edited projects, added Regression; removed Patch-For-Review.

This was a regression from https://gerrit.wikimedia.org/r/493093 due to a typo in the variable name. Now fixed, and backported.

Change 500158 merged by jenkins-bot:
[mediawiki/skins/Vector@wmf/1.33.0-wmf.23] Fix invalid lang attribute on first heading

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

Mentioned in SAL (#wikimedia-operations) [2019-03-30T03:16:23Z] <krinkle@deploy1001> Synchronized php-1.33.0-wmf.23/skins/Vector/includes/templates/index.mustache: I0d6e036b65da0 / T219359 / i18n regression (duration: 00m 54s)

PerfektesChaos reopened this task as Open.Mar 30 2019, 11:28 AM

Reopening.

The additional claim lang="..." should be entirely removed from the heading element.

It is confusing and pointless.

It is superfluous to provide explicitly a language attribution when it is better inherited from <body> or<html>.

Look at this example (viewing Tower Bridge in French Wikipedia by Portuguese UI):

<h1 id="firstHeading" class="firstHeading" lang="fr">Diferenças entre edições de "Tower Bridge"</h1>

The claim is entirely nonsense. Diferenças entre edições is Portuguese, Tower Bridge is English, and nothing is French as claimed.

It is more consistent to inherit from ancestor even if not correct in this place, than explicitly stating wrong information.

  • UI parts and special page names follow user language.
  • Content areas follow page language, falling back to site language.
  • Text fragments might be neither the one nor the other, as shown.
Fomafix closed this task as Resolved.Mar 30 2019, 4:10 PM

@PerfektesChaos I support you comments, but this task is the wrong place. This task is just for restoring the previous behavior after making a typo in the refactoring. This is solved and therefor this task is solved.

To solve your comments I already created https://gerrit.wikimedia.org/r/419405 and dependencies. This change needs to rebased, updated, refactored to a different class and tested with all supported browser.