Page MenuHomePhabricator

Use BCP 47 conform language codes for the HTML attribute lang
Closed, ResolvedPublic

Description

The value of the HTML attribute lang must be a valid BCP 47 language tag.

The HTML validation fails because of invalid language codes: https://validator.w3.org/nu/?doc=https://www.wikidata.org/wiki/Q5296

Event Timeline

Fomafix created this task.Dec 8 2015, 5:57 PM
Fomafix raised the priority of this task from to Low.
Fomafix updated the task description. (Show Details)
Fomafix added a subscriber: Fomafix.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 8 2015, 5:57 PM
Lydia_Pintscher closed this task as Declined.Feb 7 2018, 4:09 PM
Lydia_Pintscher added a subscriber: Lydia_Pintscher.

Realistically it seems we're not getting to it since it hasn't been touched in two years. Sorry :( Feel free to reopen with a patch.

Fomafix reopened this task as Open.Feb 7 2018, 4:32 PM
Fomafix updated the task description. (Show Details)

Reopened. The HTML fails the HTML validation because of invalid lang attributes. This is not an invalid bug.

Fomafix updated the task description. (Show Details)Feb 7 2018, 4:38 PM

T106367 is a related task for other lang attributes in MediaWiki core.

cscott added a subscriber: cscott.Jun 29 2018, 4:50 PM

There's a patch for proper BCP-47 validity conversion in core: I807dd55d49e9bd19443329231326a5b0d3e6c453

Change 442200 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Ensure LanguageCode::bcp47() returns a valid BCP-47 language code

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

Change 442200 merged by jenkins-bot:
[mediawiki/core@master] Ensure LanguageCode::bcp47() returns a valid BCP 47 language code

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

Jdforrester-WMF closed this task as Resolved.Jul 14 2018, 1:26 AM
Jdforrester-WMF assigned this task to cscott.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Now fixed in Beta Cluster Wikidata: https://validator.w3.org/nu/?doc=https%3A%2F%2Fwikidata.beta.wmflabs.org%2Fwiki%2FQ470764

Remaining error is for the wikibase-aliasesview-list UL's dir being set to ''; not sure if that's filed?

Fomafix reopened this task as Open.Jul 20 2018, 10:35 AM

Reopened. Validation of https://www.wikidata.org/wiki/Q5296 (https://validator.w3.org/nu/?doc=https://www.wikidata.org/wiki/Q5296) still fails because for the lang and the hreflang attributes LanguageCode::bcp47 is not applied.

Change 447054 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/extensions/Wikibase@master] Apply Language::bcp47 for lang and hreflang attributes

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

Change 460038 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Ensure LanguageCode::bcp47() returns a valid BCP 47 language code

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

Change 447054 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Apply LanguageCode::bcp47 for lang and hreflang attributes

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

Change 460038 merged by jenkins-bot:
[mediawiki/core@master] Ensure LanguageCode::bcp47() returns a valid BCP 47 language code

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