Page MenuHomePhabricator

language and direction are not set at the wikimedia.org portal
Closed, ResolvedPublic

Description

The <html> element on wikipedia.org is set to lang="mul" and doesn't have a dir attribute. In a certain technical way this is right because there are multiple languages there, but it's not actually correct and must not be done.

The language of most of the page is specifically known and it is the same—that's the language that shows the names and the descriptions of Wikimedia projects, the language of the words "The Free Encyclopedia" at the top, etc. This language's code should be set in the lang attribute of the <html> element and the dir attribute must be set to that language's direction.

The names of the languages of the large and the suggested languages around the globe must be in elements with their own lang and dir elements. If the legal text at the bottom is intentionally left in English for legal reasons, this is reasonable, but then it must be explicitly set to lang="en" dir="ltr".

Not doing this causes real problems. For example the footer-description is shown in Hebrew with incorrect punctuation and direction.

Event Timeline

Amire80 created this task.Dec 31 2016, 6:40 AM
Restricted Application added projects: I18n, Discovery. · View Herald TranscriptDec 31 2016, 6:40 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Amire80 updated the task description. (Show Details)Dec 31 2016, 6:50 AM
debt triaged this task as Normal priority.Jan 6 2017, 6:59 PM
debt added a project: Discovery-Portal-Sprint.
debt added subscribers: Jdrewniak, debt.
Jdrewniak raised the priority of this task from Normal to High.Jan 10 2017, 11:55 PM

Change 336634 had a related patch set uploaded (by Jdrewniak):
Adding RTL support to JS translations

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

Change 336634 merged by jenkins-bot:
Adding RTL support to JS translations

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

debt closed this task as Resolved.Mar 3 2017, 3:59 PM
debt claimed this task.
debt moved this task from In Progress to Done on the Discovery-Portal-Sprint board.

Resolving this - as it was pushed to production on Feb 8, 2017 and can be seen in action in this screenshot:

Amire80 reopened this task as Open.Mar 3 2017, 4:12 PM

Reopening.

Thanks for adding the direction attribute.

However, this is not enough, because lang="mul" is not quite correct. It is not too hard to set the correct lang attribute for each of the languages. It is important not only for internal semantic correctness. It also helps browsers set correct fonts. Doing it comprehensively will also help resolving T122053, because you can set the correct dir parameter for each languages along with fixing this issue.

debt removed a project: Patch-For-Review.

Change 341728 had a related patch set uploaded (by JGirault):
[wikimedia/portals] Fix <html> "lang" attribute incorrectly set

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

Change 341728 merged by jenkins-bot:
[wikimedia/portals] Fix <html> "lang" attribute incorrectly set

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

debt closed this task as Resolved.Mar 15 2017, 7:32 PM