ApiQueryInfo.php: Add code and direction of the page content language
authorFomafix <fomafix@googlemail.com>
Wed, 4 Nov 2015 16:50:48 +0000 (16:50 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Wed, 4 Nov 2015 16:50:48 +0000 (16:50 +0000)
commita4d579f446e6a8ca76eb7083692043bc9e3cce4b
treec167b0f92e35ff5d8b869c08885a197adce9b22f
parent7faa829218b1b91296865f36b9ff710e3870b7eb
ApiQueryInfo.php: Add code and direction of the page content language

This change introduces two new keys in the response:
* "pagelanguagehtmlcode" for the BCP 47 conform language code
* "pagelanguagedir" for the direction of the language

Example:
 "pagelanguagehtmlcode": "en-GB"
 "pagelanguagedir": "ltr"

The existing key "pagelanguage" contains the internal language code format:
 "pagelanguage": "en-gb"

This duplication avoids reimplementing wfBCP47() and a mapping from
all language codes to the direction of the languages in JavaScript.

Bug: T117392
Change-Id: I26d033e33bfa60c8ff72ba70bb564cba4303a8b6
includes/api/ApiQueryInfo.php