Page MenuHomePhabricator

Send BCP 47 language codes in Accept-Language header
Closed, ResolvedPublic

Description

Services are being updated to accept BCP 47 language codes, instead of the current language codes (e.g. uz-Cyrl instead of uz-cyrl, sr-Latn instead of sr-el).

For most language variants the difference is simply uppercase vs lowercase letters (the server treats the codes case-insensitively), with the exception of Serbian (sr-ec, sr-el -> sr-Cyrl, sr-Latn).

The API request for getting the full list of language variants gives us BCP 47 codes for each language, which we can bundle along with our other static data.
https://www.mediawiki.org/w/api.php?action=query&format=json&meta=siteinfo&formatversion=2&siprop=languages%7Clanguagevariants&siinlanguagecode=en

Event Timeline

Notes for QA:

  • Navigate to the [[Earth]] article on enwiki.
  • Change the language of the article to "Uzbek (latin)", and make sure that the text of the article looks like Latin script.
  • Change the language of the article to "Uzbek (cyrilliic)" and make sure the text now looks like cyrillic script.