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 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.

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 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

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