Umherirrender has uploaded a new change for review.

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

Change subject: Provide language names on action=parse&prop=langlinks
......................................................................

Provide language names on action=parse&prop=langlinks

This can helps the client to build a language html.

Bug: 58627
Change-Id: Iaa475cbe7b0268ee86e40ec0fa42bbe51bba02c9
---
M RELEASE-NOTES-1.23
M includes/api/ApiParse.php
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/112332/1

diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 660869c..4fc198a 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -163,6 +163,7 @@
 * Added siprop=restrictions to API action=query&meta=siteinfo for querying
   possible page restriction (protection) levels and types.
 * Added prop 'limitreportdata' and 'limitreporthtml' to action=parse.
+* (bug 58627) Provide language names on action=parse&prop=langlinks.
 
 === Languages updated in 1.23 ===
 
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index 495071a..f5c072a 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -487,6 +487,10 @@
                        $entry['lang'] = $bits[0];
                        if ( $title ) {
                                $entry['url'] = wfExpandUrl( 
$title->getFullURL(), PROTO_CURRENT );
+                               // localised language name in user language 
(maybe set by uselang=)
+                               $entry['langname'] = 
Language::fetchLanguageName( $title->getInterwiki(), 
$this->getLanguage()->getCode() );
+                               // native language name
+                               $entry['autonym'] = 
Language::fetchLanguageName( $title->getInterwiki() );
                        }
                        ApiResult::setContent( $entry, $bits[1] );
                        $result[] = $entry;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa475cbe7b0268ee86e40ec0fa42bbe51bba02c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

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

Reply via email to