Index: trunk/extensions/Interlanguage/Interlanguage.i18n.php |
— | — | @@ -1,12 +1,12 @@ |
2 | | -<?php
|
3 | | -/**
|
4 | | - * Internationalisation file for Interlanguage extension.
|
5 | | - *
|
6 | | - * @addtogroup Extensions
|
7 | | - */
|
8 | | -
|
9 | | -$messages = array();
|
10 | | -
|
11 | | -$messages['en'] = array(
|
12 | | - 'interlanguage-desc' => 'Grabs interlanguage links from another wiki',
|
13 | | -);
|
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation file for Interlanguage extension. |
| 5 | + * |
| 6 | + * @addtogroup Extensions |
| 7 | + */ |
| 8 | + |
| 9 | +$messages = array(); |
| 10 | + |
| 11 | +$messages['en'] = array( |
| 12 | + 'interlanguage-desc' => 'Grabs interlanguage links from another wiki', |
| 13 | +); |
Property changes on: trunk/extensions/Interlanguage/Interlanguage.i18n.php |
___________________________________________________________________ |
Added: svn:eol-style |
14 | 14 | + native |
Index: trunk/extensions/Interlanguage/Interlanguage.php |
— | — | @@ -1,212 +1,212 @@ |
2 | | -<?php
|
3 | | -# MediaWiki Interlanguage extension v1.1
|
4 | | -#
|
5 | | -# Copyright © 2008 Nikola Smolenski <smolensk@eunet.yu>
|
6 | | -#
|
7 | | -# This program is free software; you can redistribute it and/or modify
|
8 | | -# it under the terms of the GNU General Public License as published by
|
9 | | -# the Free Software Foundation; either version 2 of the License, or
|
10 | | -# (at your option) any later version.
|
11 | | -#
|
12 | | -# This program is distributed in the hope that it will be useful,
|
13 | | -# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 | | -# GNU General Public License for more details.
|
16 | | -#
|
17 | | -# You should have received a copy of the GNU General Public License
|
18 | | -# along with this program; if not, write to the Free Software
|
19 | | -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
20 | | -#
|
21 | | -# For more information see
|
22 | | -# http://www.mediawiki.org/wiki/Extension:Interlanguage
|
23 | | -
|
24 | | -$wgExtensionFunctions[]="wfInterlanguageExtension";
|
25 | | -$wgHooks['LanguageGetMagic'][] = 'wfInterlanguageExtensionMagic';
|
26 | | -$wgExtensionCredits['parserhook'][] = array(
|
27 | | - 'name' => 'Interlanguage',
|
28 | | - 'author' => 'Nikola Smolenski',
|
29 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:Interlanguage',
|
30 | | - 'version' => '1.1',//preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change
|
31 | | - 'description' => 'Grabs interlanguage links from another wiki',
|
32 | | - 'descriptionmsg' => 'interlanguage-desc',
|
33 | | -);
|
34 | | -
|
35 | | -function wfInterlanguageExtension() {
|
36 | | - global $wgParser;
|
37 | | - $wgParser->setFunctionHook( 'interlanguage', 'InterlanguageExtension', SFH_NO_HASH );
|
38 | | -}
|
39 | | -
|
40 | | -function wfInterlanguageExtensionMagic( &$magicWords, $langCode ) {
|
41 | | - $magicWords['interlanguage'] = array(0, 'interlanguage');
|
42 | | - return true;
|
43 | | -}
|
44 | | -
|
45 | | -function InterlanguageExtension( &$parser, $param) {
|
46 | | - global $wgInterlanguageExtensionApiUrl, $wgInterlanguageExtensionSort,
|
47 | | - $wgInterlanguageExtensionPrefix, $wgInterlanguageExtensionInterwiki,
|
48 | | - $wgLanguageCode, $wgTitle, $wgMemc;
|
49 | | -
|
50 | | - if(isset($wgInterlanguageExtensionPrefix)) {
|
51 | | - $param = "$wgInterlanguageExtensionPrefix$param";
|
52 | | - }
|
53 | | -
|
54 | | - $url = $wgInterlanguageExtensionApiUrl . "?action=query&prop=langlinks&" .
|
55 | | - "lllimit=500&format=php&redirects&titles=" . strtr( $param, ' ', '_' );
|
56 | | - $key = wfMemc( 'Interlanguage', md5( $url ) );
|
57 | | - $res = $wgMemc->get( $key );
|
58 | | -
|
59 | | - if ( !$res ) {
|
60 | | - # be sure to set $res back to bool false, we do a strict compare below
|
61 | | - $res = false;
|
62 | | - $a = Http::get( $url );
|
63 | | - $a = @unserialize( $a );
|
64 | | - if(isset($a['query']['pages']) && is_array($a['query']['pages'])) {
|
65 | | - $a = array_shift($a['query']['pages']);
|
66 | | -
|
67 | | - if(isset($a['missing'])) {
|
68 | | - // There is no such article on the central wiki
|
69 | | - $linker = new Linker();
|
70 | | - $res=array( $linker->makeBrokenLink( $wgInterlanguageExtensionInterwiki . strtr($param,'_',' ') ), 'noparse' => true, 'isHTML' => true);
|
71 | | -
|
72 | | - } else {
|
73 | | - if(isset($a['langlinks'])) {
|
74 | | - $a = $a['langlinks'];
|
75 | | - if(is_array($a)) {
|
76 | | - $res = true;
|
77 | | - }
|
78 | | - } else {
|
79 | | - // There are no links in the central wiki article
|
80 | | - $res = '';
|
81 | | - }
|
82 | | - }
|
83 | | - }
|
84 | | - }
|
85 | | -
|
86 | | - if($res === false) {
|
87 | | - // An API error has occured; preserve the links that are in the article
|
88 | | - $dbr = wfGetDB( DB_SLAVE );
|
89 | | - $res = $dbr->select( 'langlinks', array( 'll_lang', 'll_title' ), array( 'll_from' => $wgTitle->mArticleID), __FUNCTION__);
|
90 | | - $a = array();
|
91 | | - while ( $row = $dbr->fetchObject( $res ) ) {
|
92 | | - $a[] = array( 'lang' => $row->ll_lang, '*' => $row->ll_title );
|
93 | | - }
|
94 | | - $dbr->freeResult( $res );
|
95 | | - $res = true;
|
96 | | - }
|
97 | | -
|
98 | | - if($res === true) {
|
99 | | - // Sort links
|
100 | | - switch($wgInterlanguageExtensionSort) {
|
101 | | - case 'code':
|
102 | | - usort($a, 'InterlanguageExtensionCompareCode');
|
103 | | - break;
|
104 | | - case 'alphabetic':
|
105 | | - usort($a, 'InterlanguageExtensionCompareAlphabetic');
|
106 | | - break;
|
107 | | - case 'alphabetic_revised':
|
108 | | - usort($a, 'InterlanguageExtensionCompareAlphabeticRevised');
|
109 | | - break;
|
110 | | - }
|
111 | | -
|
112 | | - // Convert links to wikitext
|
113 | | - $res = '';
|
114 | | - foreach($a as $v) {
|
115 | | - if($v['lang'] != $wgLanguageCode) {
|
116 | | - $res .= "[[".$v['lang'].':'.$v['*']."]]";
|
117 | | - }
|
118 | | - }
|
119 | | - }
|
120 | | - # cache the final result so we can skip all of this
|
121 | | - $wgMemc->set( $key, $res, time() + 3600 );
|
122 | | - return $res;
|
123 | | -}
|
124 | | -
|
125 | | -function InterlanguageExtensionCompareCode($a, $b) {
|
126 | | - return strcmp($a['lang'], $b['lang']);
|
127 | | -}
|
128 | | -
|
129 | | -function InterlanguageExtensionCompareAlphabetic($a, $b) {
|
130 | | - global $wgInterlanguageExtensionSortPrepend;
|
131 | | -//http://meta.wikimedia.org/w/index.php?title=Interwiki_sorting_order&oldid=1156923#By_order_of_alphabet.2C_based_on_local_language
|
132 | | - static $order = array(
|
133 | | - 'aa', 'af', 'ak', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc',
|
134 | | - 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'bm', 'bn',
|
135 | | - 'zh-min-nan', 'map-bms', 'ba', 'be', 'be-x-old', 'bh', 'bcl', 'bi',
|
136 | | - 'bar', 'bo', 'bs', 'br', 'bg', 'bxr', 'ca', 'cv', 'ceb', 'cs', 'ch',
|
137 | | - 'ny', 'sn', 'tum', 'cho', 'co', 'za', 'cy', 'da', 'pdc', 'de', 'dv',
|
138 | | - 'nv', 'dsb', 'dz', 'mh', 'et', 'el', 'eml', 'en', 'myv', 'es', 'eo',
|
139 | | - 'ext', 'eu', 'ee', 'fa', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', 'gv',
|
140 | | - 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'zh-classical', 'hak',
|
141 | | - 'xal', 'ko', 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig',
|
142 | | - 'ilo', 'bpy', 'id', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is',
|
143 | | - 'it', 'he', 'jv', 'kl', 'pam', 'kn', 'kr', 'ka', 'ks', 'csb', 'kk',
|
144 | | - 'kw', 'rw', 'ky', 'rn', 'sw', 'kv', 'kg', 'ht', 'kj', 'ku', 'lad',
|
145 | | - 'lbe', 'lo', 'la', 'lv', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg',
|
146 | | - 'lmo', 'hu', 'mk', 'mg', 'ml', 'mt', 'mi', 'mr', 'mzn', 'ms', 'cdo',
|
147 | | - 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'na', 'fj', 'nl', 'nds-nl',
|
148 | | - 'cr', 'ne', 'new', 'ja', 'nap', 'ce', 'pih', 'no', 'nn', 'nrm',
|
149 | | - 'nov', 'oc', 'or', 'om', 'ng', 'hz', 'ug', 'uz', 'pa', 'pi', 'pag',
|
150 | | - 'pap', 'ps', 'km', 'pms', 'nds', 'pl', 'pt', 'kaa', 'crh', 'ty',
|
151 | | - 'ksh', 'ro', 'rmy', 'rm', 'qu', 'ru', 'sah', 'se', 'sm', 'sa', 'sg',
|
152 | | - 'sc', 'sco', 'stq', 'st', 'tn', 'sq', 'scn', 'si', 'simple', 'sd',
|
153 | | - 'ss', 'sk', 'cu', 'sl', 'szl', 'so', 'sr', 'sh', 'su', 'fi', 'sv',
|
154 | | - 'tl', 'ta', 'kab', 'roa-tara', 'tt', 'te', 'tet', 'th', 'vi', 'ti',
|
155 | | - 'tg', 'tpi', 'to', 'chr', 'chy', 've', 'tr', 'tk', 'tw', 'udm',
|
156 | | - 'bug', 'uk', 'ur', 'vec', 'vo', 'fiu-vro', 'wa', 'vls', 'war', 'wo',
|
157 | | - 'wuu', 'ts', 'ii', 'yi', 'yo', 'zh-yue', 'cbk-zam', 'diq', 'zea',
|
158 | | - 'bat-smg', 'zh'
|
159 | | - );
|
160 | | -
|
161 | | - if(isset($wgInterlanguageExtensionSortPrepend) && is_array($wgInterlanguageExtensionSortPrepend)) {
|
162 | | - $order = array_merge($wgInterlanguageExtensionSortPrepend, $order);
|
163 | | - unset($wgInterlanguageExtensionSortPrepend);
|
164 | | - }
|
165 | | -
|
166 | | - $a=array_search($a['lang'], $order);
|
167 | | - $b=array_search($b['lang'], $order);
|
168 | | -
|
169 | | - return ($a>$b)?1:(($a<$b)?-1:0);
|
170 | | -}
|
171 | | -
|
172 | | -function InterlanguageExtensionCompareAlphabeticRevised($a, $b) {
|
173 | | - global $wgInterlanguageExtensionSortPrepend;
|
174 | | -//From http://meta.wikimedia.org/w/index.php?title=Interwiki_sorting_order&oldid=1156923#By_order_of_alphabet.2C_based_on_local_language_.28by_first_word.29
|
175 | | - static $order = array(
|
176 | | - 'aa', 'af', 'ak', 'als', 'am', 'ang', 'ab',
|
177 | | - 'ar', 'an', 'arc', 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay',
|
178 | | - 'az', 'id', 'ms', 'bm', 'bn', 'zh-min-nan', 'map-bms', 'jv', 'su',
|
179 | | - 'ba', 'be', 'be-x-old', 'bh', 'bcl', 'bi', 'bar', 'bo', 'bs', 'br',
|
180 | | - 'bug', 'bg', 'bxr', 'ca', 'ceb', 'cv', 'cs', 'ch', 'cbk-zam', 'ny',
|
181 | | - 'sn', 'tum', 'cho', 'co', 'za', 'cy', 'da', 'pdc', 'de', 'dv', 'nv',
|
182 | | - 'dsb', 'dz', 'mh', 'et', 'na', 'el', 'eml', 'en', 'myv', 'es', 'eo',
|
183 | | - 'ext', 'eu', 'ee', 'to', 'fa', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga',
|
184 | | - 'gv', 'sm', 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'hak',
|
185 | | - 'ko', 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', 'ilo',
|
186 | | - 'bpy', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is', 'it', 'he',
|
187 | | - 'kl', 'xal', 'kn', 'kr', 'pam', 'ka', 'ks', 'csb', 'kk', 'kw', 'rw',
|
188 | | - 'ky', 'rn', 'sw', 'kv', 'kg', 'ht', 'ku', 'kj', 'lad', 'lbe', 'lo',
|
189 | | - 'la', 'lv', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg', 'lmo', 'hu',
|
190 | | - 'mk', 'mg', 'ml', 'mt', 'zh-classical', 'mi', 'mr', 'mzn', 'cdo',
|
191 | | - 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'fj', 'nl', 'nds-nl', 'cr',
|
192 | | - 'ne', 'new', 'ja', 'nap', 'ce', 'pih', 'no', 'nn', 'nrm', 'nov',
|
193 | | - 'oc', 'or', 'om', 'ng', 'hz', 'uz', 'pa', 'pi', 'pag', 'pap', 'ps',
|
194 | | - 'km', 'pms', 'nds', 'pl', 'pt', 'kaa', 'crh', 'ty', 'ksh', 'ro',
|
195 | | - 'rmy', 'rm', 'qu', 'ru', 'se', 'sa', 'sg', 'sc', 'sah', 'sco',
|
196 | | - 'stq', 'st', 'tn', 'sq', 'scn', 'si', 'simple', 'sd', 'ss', 'sk',
|
197 | | - 'sl', 'cu', 'szl', 'so', 'sr', 'sh', 'fi', 'sv', 'tl', 'ta', 'kab',
|
198 | | - 'roa-tara', 'tt', 'te', 'tet', 'th', 'vi', 'ti', 'tg', 'tpi', 'chr',
|
199 | | - 'chy', 've', 'tr', 'tk', 'tw', 'udm', 'uk', 'ur', 'ug', 'vec', 'vo',
|
200 | | - 'fiu-vro', 'wa', 'vls', 'war', 'wo', 'wuu', 'ts', 'ii', 'yi', 'yo',
|
201 | | - 'zh-yue', 'diq', 'zea', 'bat-smg', 'zh', 'zh-tw', 'zh-cn',
|
202 | | - );
|
203 | | -
|
204 | | - if(isset($wgInterlanguageExtensionSortPrepend) && is_array($wgInterlanguageExtensionSortPrepend)) {
|
205 | | - $order = array_merge($wgInterlanguageExtensionSortPrepend, $order);
|
206 | | - unset($wgInterlanguageExtensionSortPrepend);
|
207 | | - }
|
208 | | -
|
209 | | - $a=array_search($a['lang'], $order);
|
210 | | - $b=array_search($b['lang'], $order);
|
211 | | -
|
212 | | - return ($a>$b)?1:(($a<$b)?-1:0);
|
213 | | -}
|
| 2 | +<?php |
| 3 | +# MediaWiki Interlanguage extension v1.1 |
| 4 | +# |
| 5 | +# Copyright © 2008 Nikola Smolenski <smolensk@eunet.yu> |
| 6 | +# |
| 7 | +# This program is free software; you can redistribute it and/or modify |
| 8 | +# it under the terms of the GNU General Public License as published by |
| 9 | +# the Free Software Foundation; either version 2 of the License, or |
| 10 | +# (at your option) any later version. |
| 11 | +# |
| 12 | +# This program is distributed in the hope that it will be useful, |
| 13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +# GNU General Public License for more details. |
| 16 | +# |
| 17 | +# You should have received a copy of the GNU General Public License |
| 18 | +# along with this program; if not, write to the Free Software |
| 19 | +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 20 | +# |
| 21 | +# For more information see |
| 22 | +# http://www.mediawiki.org/wiki/Extension:Interlanguage |
| 23 | + |
| 24 | +$wgExtensionFunctions[]="wfInterlanguageExtension"; |
| 25 | +$wgHooks['LanguageGetMagic'][] = 'wfInterlanguageExtensionMagic'; |
| 26 | +$wgExtensionCredits['parserhook'][] = array( |
| 27 | + 'name' => 'Interlanguage', |
| 28 | + 'author' => 'Nikola Smolenski', |
| 29 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Interlanguage', |
| 30 | + 'version' => '1.1',//preg_replace('/^.* (\d\d\d\d-\d\d-\d\d) .*$/', '\1', '$LastChangedDate$'), #just the date of the last change |
| 31 | + 'description' => 'Grabs interlanguage links from another wiki', |
| 32 | + 'descriptionmsg' => 'interlanguage-desc', |
| 33 | +); |
| 34 | + |
| 35 | +function wfInterlanguageExtension() { |
| 36 | + global $wgParser; |
| 37 | + $wgParser->setFunctionHook( 'interlanguage', 'InterlanguageExtension', SFH_NO_HASH ); |
| 38 | +} |
| 39 | + |
| 40 | +function wfInterlanguageExtensionMagic( &$magicWords, $langCode ) { |
| 41 | + $magicWords['interlanguage'] = array(0, 'interlanguage'); |
| 42 | + return true; |
| 43 | +} |
| 44 | + |
| 45 | +function InterlanguageExtension( &$parser, $param) { |
| 46 | + global $wgInterlanguageExtensionApiUrl, $wgInterlanguageExtensionSort, |
| 47 | + $wgInterlanguageExtensionPrefix, $wgInterlanguageExtensionInterwiki, |
| 48 | + $wgLanguageCode, $wgTitle, $wgMemc; |
| 49 | + |
| 50 | + if(isset($wgInterlanguageExtensionPrefix)) { |
| 51 | + $param = "$wgInterlanguageExtensionPrefix$param"; |
| 52 | + } |
| 53 | + |
| 54 | + $url = $wgInterlanguageExtensionApiUrl . "?action=query&prop=langlinks&" . |
| 55 | + "lllimit=500&format=php&redirects&titles=" . strtr( $param, ' ', '_' ); |
| 56 | + $key = wfMemc( 'Interlanguage', md5( $url ) ); |
| 57 | + $res = $wgMemc->get( $key ); |
| 58 | + |
| 59 | + if ( !$res ) { |
| 60 | + # be sure to set $res back to bool false, we do a strict compare below |
| 61 | + $res = false; |
| 62 | + $a = Http::get( $url ); |
| 63 | + $a = @unserialize( $a ); |
| 64 | + if(isset($a['query']['pages']) && is_array($a['query']['pages'])) { |
| 65 | + $a = array_shift($a['query']['pages']); |
| 66 | + |
| 67 | + if(isset($a['missing'])) { |
| 68 | + // There is no such article on the central wiki |
| 69 | + $linker = new Linker(); |
| 70 | + $res=array( $linker->makeBrokenLink( $wgInterlanguageExtensionInterwiki . strtr($param,'_',' ') ), 'noparse' => true, 'isHTML' => true); |
| 71 | + |
| 72 | + } else { |
| 73 | + if(isset($a['langlinks'])) { |
| 74 | + $a = $a['langlinks']; |
| 75 | + if(is_array($a)) { |
| 76 | + $res = true; |
| 77 | + } |
| 78 | + } else { |
| 79 | + // There are no links in the central wiki article |
| 80 | + $res = ''; |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + if($res === false) { |
| 87 | + // An API error has occured; preserve the links that are in the article |
| 88 | + $dbr = wfGetDB( DB_SLAVE ); |
| 89 | + $res = $dbr->select( 'langlinks', array( 'll_lang', 'll_title' ), array( 'll_from' => $wgTitle->mArticleID), __FUNCTION__); |
| 90 | + $a = array(); |
| 91 | + while ( $row = $dbr->fetchObject( $res ) ) { |
| 92 | + $a[] = array( 'lang' => $row->ll_lang, '*' => $row->ll_title ); |
| 93 | + } |
| 94 | + $dbr->freeResult( $res ); |
| 95 | + $res = true; |
| 96 | + } |
| 97 | + |
| 98 | + if($res === true) { |
| 99 | + // Sort links |
| 100 | + switch($wgInterlanguageExtensionSort) { |
| 101 | + case 'code': |
| 102 | + usort($a, 'InterlanguageExtensionCompareCode'); |
| 103 | + break; |
| 104 | + case 'alphabetic': |
| 105 | + usort($a, 'InterlanguageExtensionCompareAlphabetic'); |
| 106 | + break; |
| 107 | + case 'alphabetic_revised': |
| 108 | + usort($a, 'InterlanguageExtensionCompareAlphabeticRevised'); |
| 109 | + break; |
| 110 | + } |
| 111 | + |
| 112 | + // Convert links to wikitext |
| 113 | + $res = ''; |
| 114 | + foreach($a as $v) { |
| 115 | + if($v['lang'] != $wgLanguageCode) { |
| 116 | + $res .= "[[".$v['lang'].':'.$v['*']."]]"; |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | + # cache the final result so we can skip all of this |
| 121 | + $wgMemc->set( $key, $res, time() + 3600 ); |
| 122 | + return $res; |
| 123 | +} |
| 124 | + |
| 125 | +function InterlanguageExtensionCompareCode($a, $b) { |
| 126 | + return strcmp($a['lang'], $b['lang']); |
| 127 | +} |
| 128 | + |
| 129 | +function InterlanguageExtensionCompareAlphabetic($a, $b) { |
| 130 | + global $wgInterlanguageExtensionSortPrepend; |
| 131 | +//http://meta.wikimedia.org/w/index.php?title=Interwiki_sorting_order&oldid=1156923#By_order_of_alphabet.2C_based_on_local_language |
| 132 | + static $order = array( |
| 133 | + 'aa', 'af', 'ak', 'als', 'am', 'ang', 'ab', 'ar', 'an', 'arc', |
| 134 | + 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', 'az', 'bm', 'bn', |
| 135 | + 'zh-min-nan', 'map-bms', 'ba', 'be', 'be-x-old', 'bh', 'bcl', 'bi', |
| 136 | + 'bar', 'bo', 'bs', 'br', 'bg', 'bxr', 'ca', 'cv', 'ceb', 'cs', 'ch', |
| 137 | + 'ny', 'sn', 'tum', 'cho', 'co', 'za', 'cy', 'da', 'pdc', 'de', 'dv', |
| 138 | + 'nv', 'dsb', 'dz', 'mh', 'et', 'el', 'eml', 'en', 'myv', 'es', 'eo', |
| 139 | + 'ext', 'eu', 'ee', 'fa', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', 'gv', |
| 140 | + 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'zh-classical', 'hak', |
| 141 | + 'xal', 'ko', 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', |
| 142 | + 'ilo', 'bpy', 'id', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is', |
| 143 | + 'it', 'he', 'jv', 'kl', 'pam', 'kn', 'kr', 'ka', 'ks', 'csb', 'kk', |
| 144 | + 'kw', 'rw', 'ky', 'rn', 'sw', 'kv', 'kg', 'ht', 'kj', 'ku', 'lad', |
| 145 | + 'lbe', 'lo', 'la', 'lv', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg', |
| 146 | + 'lmo', 'hu', 'mk', 'mg', 'ml', 'mt', 'mi', 'mr', 'mzn', 'ms', 'cdo', |
| 147 | + 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'na', 'fj', 'nl', 'nds-nl', |
| 148 | + 'cr', 'ne', 'new', 'ja', 'nap', 'ce', 'pih', 'no', 'nn', 'nrm', |
| 149 | + 'nov', 'oc', 'or', 'om', 'ng', 'hz', 'ug', 'uz', 'pa', 'pi', 'pag', |
| 150 | + 'pap', 'ps', 'km', 'pms', 'nds', 'pl', 'pt', 'kaa', 'crh', 'ty', |
| 151 | + 'ksh', 'ro', 'rmy', 'rm', 'qu', 'ru', 'sah', 'se', 'sm', 'sa', 'sg', |
| 152 | + 'sc', 'sco', 'stq', 'st', 'tn', 'sq', 'scn', 'si', 'simple', 'sd', |
| 153 | + 'ss', 'sk', 'cu', 'sl', 'szl', 'so', 'sr', 'sh', 'su', 'fi', 'sv', |
| 154 | + 'tl', 'ta', 'kab', 'roa-tara', 'tt', 'te', 'tet', 'th', 'vi', 'ti', |
| 155 | + 'tg', 'tpi', 'to', 'chr', 'chy', 've', 'tr', 'tk', 'tw', 'udm', |
| 156 | + 'bug', 'uk', 'ur', 'vec', 'vo', 'fiu-vro', 'wa', 'vls', 'war', 'wo', |
| 157 | + 'wuu', 'ts', 'ii', 'yi', 'yo', 'zh-yue', 'cbk-zam', 'diq', 'zea', |
| 158 | + 'bat-smg', 'zh' |
| 159 | + ); |
| 160 | + |
| 161 | + if(isset($wgInterlanguageExtensionSortPrepend) && is_array($wgInterlanguageExtensionSortPrepend)) { |
| 162 | + $order = array_merge($wgInterlanguageExtensionSortPrepend, $order); |
| 163 | + unset($wgInterlanguageExtensionSortPrepend); |
| 164 | + } |
| 165 | + |
| 166 | + $a=array_search($a['lang'], $order); |
| 167 | + $b=array_search($b['lang'], $order); |
| 168 | + |
| 169 | + return ($a>$b)?1:(($a<$b)?-1:0); |
| 170 | +} |
| 171 | + |
| 172 | +function InterlanguageExtensionCompareAlphabeticRevised($a, $b) { |
| 173 | + global $wgInterlanguageExtensionSortPrepend; |
| 174 | +//From http://meta.wikimedia.org/w/index.php?title=Interwiki_sorting_order&oldid=1156923#By_order_of_alphabet.2C_based_on_local_language_.28by_first_word.29 |
| 175 | + static $order = array( |
| 176 | + 'aa', 'af', 'ak', 'als', 'am', 'ang', 'ab', |
| 177 | + 'ar', 'an', 'arc', 'roa-rup', 'frp', 'as', 'ast', 'gn', 'av', 'ay', |
| 178 | + 'az', 'id', 'ms', 'bm', 'bn', 'zh-min-nan', 'map-bms', 'jv', 'su', |
| 179 | + 'ba', 'be', 'be-x-old', 'bh', 'bcl', 'bi', 'bar', 'bo', 'bs', 'br', |
| 180 | + 'bug', 'bg', 'bxr', 'ca', 'ceb', 'cv', 'cs', 'ch', 'cbk-zam', 'ny', |
| 181 | + 'sn', 'tum', 'cho', 'co', 'za', 'cy', 'da', 'pdc', 'de', 'dv', 'nv', |
| 182 | + 'dsb', 'dz', 'mh', 'et', 'na', 'el', 'eml', 'en', 'myv', 'es', 'eo', |
| 183 | + 'ext', 'eu', 'ee', 'to', 'fa', 'fo', 'fr', 'fy', 'ff', 'fur', 'ga', |
| 184 | + 'gv', 'sm', 'gd', 'gl', 'gan', 'ki', 'glk', 'gu', 'got', 'hak', |
| 185 | + 'ko', 'ha', 'haw', 'hy', 'hi', 'ho', 'hsb', 'hr', 'io', 'ig', 'ilo', |
| 186 | + 'bpy', 'ia', 'ie', 'iu', 'ik', 'os', 'xh', 'zu', 'is', 'it', 'he', |
| 187 | + 'kl', 'xal', 'kn', 'kr', 'pam', 'ka', 'ks', 'csb', 'kk', 'kw', 'rw', |
| 188 | + 'ky', 'rn', 'sw', 'kv', 'kg', 'ht', 'ku', 'kj', 'lad', 'lbe', 'lo', |
| 189 | + 'la', 'lv', 'lb', 'lt', 'lij', 'li', 'ln', 'jbo', 'lg', 'lmo', 'hu', |
| 190 | + 'mk', 'mg', 'ml', 'mt', 'zh-classical', 'mi', 'mr', 'mzn', 'cdo', |
| 191 | + 'mdf', 'mo', 'mn', 'mus', 'my', 'nah', 'fj', 'nl', 'nds-nl', 'cr', |
| 192 | + 'ne', 'new', 'ja', 'nap', 'ce', 'pih', 'no', 'nn', 'nrm', 'nov', |
| 193 | + 'oc', 'or', 'om', 'ng', 'hz', 'uz', 'pa', 'pi', 'pag', 'pap', 'ps', |
| 194 | + 'km', 'pms', 'nds', 'pl', 'pt', 'kaa', 'crh', 'ty', 'ksh', 'ro', |
| 195 | + 'rmy', 'rm', 'qu', 'ru', 'se', 'sa', 'sg', 'sc', 'sah', 'sco', |
| 196 | + 'stq', 'st', 'tn', 'sq', 'scn', 'si', 'simple', 'sd', 'ss', 'sk', |
| 197 | + 'sl', 'cu', 'szl', 'so', 'sr', 'sh', 'fi', 'sv', 'tl', 'ta', 'kab', |
| 198 | + 'roa-tara', 'tt', 'te', 'tet', 'th', 'vi', 'ti', 'tg', 'tpi', 'chr', |
| 199 | + 'chy', 've', 'tr', 'tk', 'tw', 'udm', 'uk', 'ur', 'ug', 'vec', 'vo', |
| 200 | + 'fiu-vro', 'wa', 'vls', 'war', 'wo', 'wuu', 'ts', 'ii', 'yi', 'yo', |
| 201 | + 'zh-yue', 'diq', 'zea', 'bat-smg', 'zh', 'zh-tw', 'zh-cn', |
| 202 | + ); |
| 203 | + |
| 204 | + if(isset($wgInterlanguageExtensionSortPrepend) && is_array($wgInterlanguageExtensionSortPrepend)) { |
| 205 | + $order = array_merge($wgInterlanguageExtensionSortPrepend, $order); |
| 206 | + unset($wgInterlanguageExtensionSortPrepend); |
| 207 | + } |
| 208 | + |
| 209 | + $a=array_search($a['lang'], $order); |
| 210 | + $b=array_search($b['lang'], $order); |
| 211 | + |
| 212 | + return ($a>$b)?1:(($a<$b)?-1:0); |
| 213 | +} |
Property changes on: trunk/extensions/Interlanguage/Interlanguage.php |
___________________________________________________________________ |
Added: svn:eol-style |
214 | 214 | + native |
Property changes on: trunk/extensions/MetavidWiki/skins/external_media_wizard.js |
___________________________________________________________________ |
Added: svn:eol-style |
215 | 215 | + native |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/i18n/README |
___________________________________________________________________ |
Added: svn:eol-style |
216 | 216 | + native |