Page MenuHomePhabricator

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

Description

MediaWiki currently generates for the HTML attribute lang some language codes which are not conform to BCP 47:

I suggest the following replacements:

  • de-formal -> de or de-x-formal
  • en-rtl -> en
  • nl-informal -> nl or nl-x-informal

simple is already converted to en. So here is nothing to do: https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FSpecial%3ASpecialPages%3Fuselang%3Dsimple

Event Timeline

Fomafix created this task.Jul 21 2015, 7:17 AM
Fomafix claimed this task.
Fomafix raised the priority of this task from to Medium.
Fomafix updated the task description. (Show Details)
Fomafix added a subscriber: Fomafix.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 21 2015, 7:17 AM

Change 226040 had a related patch set uploaded (by Gerrit Patch Uploader):
GlobalFunctions.php: Generate BCP 47 conform language codes

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

de-formal and nl-informal can also mapped to de and nl for the HTML attribute lang.

In wikibase there is a workaround for this [T105430], because we need a unique language code for each wiki. Once this is done we should use this to get rid of our workaround.

Jonas set Security to None.
Jonas moved this task from incoming to monitoring on the Wikidata board.
Fomafix reopened this task as Open.Jul 4 2017, 5:55 AM
Fomafix added a subscriber: Phispi.
Fomafix renamed this task from Generate BCP 47 conform language codes to Generate BCP 47 conform language codes for the HTML attribute `lang`.Mar 30 2018, 8:24 PM
Fomafix updated the task description. (Show Details)

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

Change 226040 abandoned by Fomafix:
Substitute language codes that are not conform to BCP 47

Reason:
Superseded by I807dd55d49e9bd19443329231326a5b0d3e6c453 with a bijective mapping.

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

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

Fomafix reopened this task as Open.Oct 5 2018, 11:10 AM

Reopen, because https://gerrit.wikimedia.org/r/442200 was reverted and recommitted for review in https://gerrit.wikimedia.org/r/460038.

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