From: Roan Kattouw Date: Sun, 20 Jan 2008 14:20:50 +0000 (+0000) Subject: (bug 12704) Adding amlang parameter to meta=allmessages X-Git-Tag: 1.31.0-rc.0~49884 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=60283a5f0aff387c15f99f17d494a0dc51ef4e20;p=lhc%2Fweb%2Fwiklou.git (bug 12704) Adding amlang parameter to meta=allmessages --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e1027ee26b..d57fd4adbd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -447,6 +447,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * Added support for image thumbnailing to prop=imageinfo * action={login,block,delete,move,protect,rollback,unblock,undelete} now must be POSTed * prop=imageinfo interface changed: iihistory replaced by iilimit, iistart and iiend parameters +* Added amlang parameter to meta=allmessages === Languages updated in 1.12 === diff --git a/includes/api/ApiQueryAllmessages.php b/includes/api/ApiQueryAllmessages.php index da48f690eb..00957873af 100644 --- a/includes/api/ApiQueryAllmessages.php +++ b/includes/api/ApiQueryAllmessages.php @@ -42,6 +42,13 @@ class ApiQueryAllmessages extends ApiQueryBase { public function execute() { global $wgMessageCache; $params = $this->extractRequestParams(); + + if(!is_null($params['lang'])) + { + global $wgLang; + $wgLang = Language::factory($params['lang']); + } + //Determine which messages should we print $messages_target = array(); @@ -93,6 +100,7 @@ class ApiQueryAllmessages extends ApiQueryBase { ApiBase :: PARAM_DFLT => '*', ), 'filter' => array(), + 'lang' => null, ); } @@ -100,6 +108,7 @@ class ApiQueryAllmessages extends ApiQueryBase { return array ( 'messages' => 'Which messages to output. "*" means all messages', 'filter' => 'Return only messages that contains specified string', + 'lang' => 'Language code', ); } @@ -110,7 +119,7 @@ class ApiQueryAllmessages extends ApiQueryBase { protected function getExamples() { return array( 'api.php?action=query&meta=allmessages&amfilter=ipb-', - 'api.php?action=query&meta=allmessages&ammessages=august|mainpage', + 'api.php?action=query&meta=allmessages&ammessages=august|mainpage&amlang=de', ); }