Gerrit Patch Uploader has uploaded a new change for review.

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

Change subject: ApiQueryInfo.php: Add code and direction of the page content 
language
......................................................................

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
the language code to the direction of the language in JavaScript.

Bug: T117392
Change-Id: I26d033e33bfa60c8ff72ba70bb564cba4303a8b6
---
M includes/api/ApiQueryInfo.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/250760/1

diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 7967826..9fcbb1e 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -388,6 +388,8 @@
 
                $pageInfo['contentmodel'] = $title->getContentModel();
                $pageInfo['pagelanguage'] = 
$title->getPageLanguage()->getCode();
+               $pageInfo['pagelanguagehtmlcode'] = 
$title->getPageLanguage()->getHtmlCode();
+               $pageInfo['pagelanguagedir'] = 
$title->getPageLanguage()->getDir();
 
                if ( $titleExists ) {
                        $pageInfo['touched'] = wfTimestamp( TS_ISO_8601, 
$this->pageTouched[$pageid] );

-- 
To view, visit https://gerrit.wikimedia.org/r/250760
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26d033e33bfa60c8ff72ba70bb564cba4303a8b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to