Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -83,6 +83,9 @@ |
84 | 84 | case 'rightsinfo': |
85 | 85 | $fit = $this->appendRightsInfo( $p ); |
86 | 86 | break; |
| 87 | + case 'languages': |
| 88 | + $fit = $this->appendLanguages( $p ); |
| 89 | + break; |
87 | 90 | default : |
88 | 91 | ApiBase :: dieDebug( __METHOD__, "Unknown prop=$p" ); |
89 | 92 | } |
— | — | @@ -389,7 +392,19 @@ |
390 | 393 | return $this->getResult()->addValue( 'query', $property, $data ); |
391 | 394 | } |
392 | 395 | |
| 396 | + public function appendLanguages( $property ) { |
| 397 | + global $wgLanguageNames; |
| 398 | + $data = array(); |
| 399 | + foreach( $wgLanguageNames as $code => $name ) { |
| 400 | + $lang = array( 'code' => $code ); |
| 401 | + ApiResult::setContent( $lang, $name ); |
| 402 | + $data[] = $lang; |
| 403 | + } |
| 404 | + $this->getResult()->setIndexedTagName( $data, 'lang' ); |
| 405 | + return $this->getResult()->addValue( 'query', $property, $data ); |
| 406 | + } |
393 | 407 | |
| 408 | + |
394 | 409 | public function getAllowedParams() { |
395 | 410 | return array( |
396 | 411 | 'prop' => array( |
— | — | @@ -408,6 +423,7 @@ |
409 | 424 | 'extensions', |
410 | 425 | 'fileextensions', |
411 | 426 | 'rightsinfo', |
| 427 | + 'languages', |
412 | 428 | ) |
413 | 429 | ), |
414 | 430 | 'filteriw' => array( |
— | — | @@ -436,6 +452,7 @@ |
437 | 453 | ' extensions - Returns extensions installed on the wiki', |
438 | 454 | ' fileextensions - Returns list of file extensions allowed to be uploaded', |
439 | 455 | ' rightsinfo - Returns wiki rights (license) information if available', |
| 456 | + ' languages - Returns a list of languages MediaWiki supports', |
440 | 457 | ), |
441 | 458 | 'filteriw' => 'Return only local or only nonlocal entries of the interwiki map', |
442 | 459 | 'showalldb' => 'List all database servers, not just the one lagging the most', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -204,6 +204,7 @@ |
205 | 205 | * Make action=block respect $wgEnableUserEmail and $wgSysopEmailBans |
206 | 206 | * Made deleting file description pages without files possible |
207 | 207 | * (bug 18773) Add content flag to siprop=namespaces output |
| 208 | +* (bug 18785) Add siprop=languages to meta=siteinfo |
208 | 209 | |
209 | 210 | === Languages updated in 1.16 === |
210 | 211 | |