Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -45,6 +45,7 @@ |
46 | 46 | * siprop=interwikimap and siprop=languages can use silanguagecode to have |
47 | 47 | a best effort language name translation. Use CLDR extension for best result. |
48 | 48 | * (bug 30230) action=expandtemplates should not silently override invalid title inputs |
| 49 | +* (bug 18634) Create API to fetch MediaWiki's language fallback tree structure |
49 | 50 | |
50 | 51 | === Languages updated in 1.19 === |
51 | 52 | |
Index: trunk/phase3/CREDITS |
— | — | @@ -122,6 +122,7 @@ |
123 | 123 | * Matthew Britton |
124 | 124 | * mati |
125 | 125 | * Max Sikström |
| 126 | +* merl |
126 | 127 | * Michael Dale |
127 | 128 | * Michael De La Rue |
128 | 129 | * Michael M. |
Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -138,6 +138,16 @@ |
139 | 139 | } |
140 | 140 | $data['rights'] = $GLOBALS['wgRightsText']; |
141 | 141 | $data['lang'] = $GLOBALS['wgLanguageCode']; |
| 142 | + |
| 143 | + $fallbackLang = $wgContLang->getFallbackLanguageCode(); |
| 144 | + $fallbackLangArray = array(); |
| 145 | + while( $fallbackLang ) { |
| 146 | + $fallbackLangArray[] = array( 'code' => $fallbackLang ); |
| 147 | + $fallbackLang = Language::getFallbackFor( $fallbackLang ); |
| 148 | + } |
| 149 | + $data['fallback'] = $fallbackLangArray; |
| 150 | + $this->getResult()->setIndexedTagName( $data['fallback'], 'lang' ); |
| 151 | + |
142 | 152 | if ( $wgContLang->isRTL() ) { |
143 | 153 | $data['rtl'] = ''; |
144 | 154 | } |