From 602b89caf544a999251ec4bbe27c0fc11ec2b1b8 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 22 May 2013 17:10:25 +0200 Subject: [PATCH] Add page language to prop=info This can be useful to determine the language of a page, for example javascript has english as page language. MediaWiki pages has it page language corresponding to the lang code in the sub page. Change-Id: Idd0412574b314ecf52d92243a3f8a08755474663 --- RELEASE-NOTES-1.22 | 2 +- includes/api/ApiQueryInfo.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 04861fc8d0..361ab25e93 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -129,7 +129,7 @@ production. stored in the database. * (bug 47219) Allow specifying change type of Wikipedia feed items * prop=imageinfo now allows setting iiurlheight without setting iiurlwidth -* prop=info now adds the content model of the title. +* prop=info now adds the content model and page language of the title. * New upload log entries will now contain information on the relavent image (sha1 and timestamp). diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 787057d128..5f8c49784a 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -353,6 +353,7 @@ class ApiQueryInfo extends ApiQueryBase { $dbkey = $title->getDBkey(); $pageInfo['contentmodel'] = $title->getContentModel(); + $pageInfo['pagelanguage'] = $title->getPageLanguage()->getCode(); if ( $titleExists ) { global $wgDisableCounters; -- 2.20.1