For languages with variants, we're already returning the list of variant
codes in meta=siteinfo&siprop=general. Clients may have use for the
variant's human-readable name too, and we can easily add it to the
datastructure.
Change-Id: I6c7ebf43a699a0b2346cb0fdeef6487217992f5c
if ( $wgContLang->hasVariants() ) {
$variants = array();
foreach ( $wgContLang->getVariants() as $code ) {
- $variants[] = array( 'code' => $code );
+ $variants[] = array(
+ 'code' => $code,
+ 'name' => $wgContLang->getVariantname( $code ),
+ );
}
$data['variants'] = $variants;
$this->getResult()->setIndexedTagName( $data['variants'], 'lang' );