r25772 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25771‎ | r25772 | r25773 >
Date:11:45, 11 September 2007
Author:raymond
Status:old
Tags:
Comment:
* Add function Language::getLanguageNameLocal() for the localized name of a language
* Add localized name of a language as title to interwiki links
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/Names.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2210,7 +2210,300 @@
22112211 'watchlisttools-raw',
22122212 'watchlisttools-clear',
22132213 ),
2214 -);
 2214+ 'languagelocal' => array(
 2215+ 'languagename-local-aa',
 2216+ 'languagename-local-ab',
 2217+ 'languagename-local-af',
 2218+ 'languagename-local-ak',
 2219+ 'languagename-local-als',
 2220+ 'languagename-local-am',
 2221+ 'languagename-local-an',
 2222+ 'languagename-local-ang',
 2223+ 'languagename-local-ar',
 2224+ 'languagename-local-arc',
 2225+ 'languagename-local-arn',
 2226+ 'languagename-local-as',
 2227+ 'languagename-local-ast',
 2228+ 'languagename-local-av',
 2229+ 'languagename-local-ay',
 2230+ 'languagename-local-az',
 2231+ 'languagename-local-ba',
 2232+ 'languagename-local-bar',
 2233+ 'languagename-local-bat-smg',
 2234+ 'languagename-local-bcl',
 2235+ 'languagename-local-be',
 2236+ 'languagename-local-be-tarask',
 2237+ 'languagename-local-be-x-old',
 2238+ 'languagename-local-bg',
 2239+ 'languagename-local-bh',
 2240+ 'languagename-local-bi',
 2241+ 'languagename-local-bm',
 2242+ 'languagename-local-bn',
 2243+ 'languagename-local-bo',
 2244+ 'languagename-local-bpy',
 2245+ 'languagename-local-br',
 2246+ 'languagename-local-bs',
 2247+ 'languagename-local-bug',
 2248+ 'languagename-local-bxr',
 2249+ 'languagename-local-ca',
 2250+ 'languagename-local-cbk-zam',
 2251+ 'languagename-local-cdo',
 2252+ 'languagename-local-ce',
 2253+ 'languagename-local-ceb',
 2254+ 'languagename-local-ch',
 2255+ 'languagename-local-cho',
 2256+ 'languagename-local-chr',
 2257+ 'languagename-local-chy',
 2258+ 'languagename-local-co',
 2259+ 'languagename-local-cr',
 2260+ 'languagename-local-crh',
 2261+ 'languagename-local-crh-latn',
 2262+ 'languagename-local-crh-cyrl',
 2263+ 'languagename-local-cs',
 2264+ 'languagename-local-csb',
 2265+ 'languagename-local-cu',
 2266+ 'languagename-local-cv',
 2267+ 'languagename-local-cy',
 2268+ 'languagename-local-da',
 2269+ 'languagename-local-de',
 2270+ 'languagename-local-diq',
 2271+ 'languagename-local-dv',
 2272+ 'languagename-local-dz',
 2273+ 'languagename-local-ee',
 2274+ 'languagename-local-el',
 2275+ 'languagename-local-eml',
 2276+ 'languagename-local-en',
 2277+ 'languagename-local-eo',
 2278+ 'languagename-local-es',
 2279+ 'languagename-local-et',
 2280+ 'languagename-local-eu',
 2281+ 'languagename-local-ext',
 2282+ 'languagename-local-fa',
 2283+ 'languagename-local-ff',
 2284+ 'languagename-local-fi',
 2285+ 'languagename-local-fiu-vro',
 2286+ 'languagename-local-fj',
 2287+ 'languagename-local-fo',
 2288+ 'languagename-local-fr',
 2289+ 'languagename-local-frc',
 2290+ 'languagename-local-frp',
 2291+ 'languagename-local-fur',
 2292+ 'languagename-local-fy',
 2293+ 'languagename-local-ga',
 2294+ 'languagename-local-gd',
 2295+ 'languagename-local-gl',
 2296+ 'languagename-local-glk',
 2297+ 'languagename-local-gn',
 2298+ 'languagename-local-got',
 2299+ 'languagename-local-gsw',
 2300+ 'languagename-local-gu',
 2301+ 'languagename-local-gv',
 2302+ 'languagename-local-ha',
 2303+ 'languagename-local-hak',
 2304+ 'languagename-local-haw',
 2305+ 'languagename-local-he',
 2306+ 'languagename-local-hi',
 2307+ 'languagename-local-hil',
 2308+ 'languagename-local-ho',
 2309+ 'languagename-local-hr',
 2310+ 'languagename-local-hsb',
 2311+ 'languagename-local-ht',
 2312+ 'languagename-local-hu',
 2313+ 'languagename-local-hy',
 2314+ 'languagename-local-hz',
 2315+ 'languagename-local-ia',
 2316+ 'languagename-local-id',
 2317+ 'languagename-local-ie',
 2318+ 'languagename-local-ig',
 2319+ 'languagename-local-ii',
 2320+ 'languagename-local-ik',
 2321+ 'languagename-local-ilo',
 2322+ 'languagename-local-io',
 2323+ 'languagename-local-is',
 2324+ 'languagename-local-it',
 2325+ 'languagename-local-iu',
 2326+ 'languagename-local-ja',
 2327+ 'languagename-local-jbo',
 2328+ 'languagename-local-jv',
 2329+ 'languagename-local-ka',
 2330+ 'languagename-local-kaa',
 2331+ 'languagename-local-kab',
 2332+ 'languagename-local-kg',
 2333+ 'languagename-local-ki',
 2334+ 'languagename-local-kj',
 2335+ 'languagename-local-kk',
 2336+ 'languagename-local-kk-cn',
 2337+ 'languagename-local-kk-kz',
 2338+ 'languagename-local-kk-tr',
 2339+ 'languagename-local-kl',
 2340+ 'languagename-local-km',
 2341+ 'languagename-local-kn',
 2342+ 'languagename-local-ko',
 2343+ 'languagename-local-kr',
 2344+ 'languagename-local-krj',
 2345+ 'languagename-local-ks',
 2346+ 'languagename-local-ksh',
 2347+ 'languagename-local-ku',
 2348+ 'languagename-local-ku-latn',
 2349+ 'languagename-local-ku-arab',
 2350+ 'languagename-local-kv',
 2351+ 'languagename-local-kw',
 2352+ 'languagename-local-ky',
 2353+ 'languagename-local-la',
 2354+ 'languagename-local-lad',
 2355+ 'languagename-local-lbe',
 2356+ 'languagename-local-lb',
 2357+ 'languagename-local-lg',
 2358+ 'languagename-local-li',
 2359+ 'languagename-local-lij',
 2360+ 'languagename-local-lld',
 2361+ 'languagename-local-lmo',
 2362+ 'languagename-local-ln',
 2363+ 'languagename-local-lo',
 2364+ 'languagename-local-lt',
 2365+ 'languagename-local-lv',
 2366+ 'languagename-local-lzz',
 2367+ 'languagename-local-map-bms',
 2368+ 'languagename-local-mg',
 2369+ 'languagename-local-mh',
 2370+ 'languagename-local-mi',
 2371+ 'languagename-local-minnan',
 2372+ 'languagename-local-mk',
 2373+ 'languagename-local-ml',
 2374+ 'languagename-local-mn',
 2375+ 'languagename-local-mo',
 2376+ 'languagename-local-mr',
 2377+ 'languagename-local-ms',
 2378+ 'languagename-local-mt',
 2379+ 'languagename-local-mus',
 2380+ 'languagename-local-my',
 2381+ 'languagename-local-mzn',
 2382+ 'languagename-local-na',
 2383+ 'languagename-local-nah',
 2384+ 'languagename-local-nan',
 2385+ 'languagename-local-nap',
 2386+ 'languagename-local-nb',
 2387+ 'languagename-local-nds',
 2388+ 'languagename-local-nds-nl',
 2389+ 'languagename-local-ne',
 2390+ 'languagename-local-new',
 2391+ 'languagename-local-ng',
 2392+ 'languagename-local-nl',
 2393+ 'languagename-local-nn',
 2394+ 'languagename-local-no',
 2395+ 'languagename-local-non',
 2396+ 'languagename-local-nov',
 2397+ 'languagename-local-nrm',
 2398+ 'languagename-local-nv',
 2399+ 'languagename-local-ny',
 2400+ 'languagename-local-oc',
 2401+ 'languagename-local-om',
 2402+ 'languagename-local-or',
 2403+ 'languagename-local-os',
 2404+ 'languagename-local-pa',
 2405+ 'languagename-local-pag',
 2406+ 'languagename-local-pam',
 2407+ 'languagename-local-pap',
 2408+ 'languagename-local-pdc',
 2409+ 'languagename-local-pi',
 2410+ 'languagename-local-pih',
 2411+ 'languagename-local-pl',
 2412+ 'languagename-local-pms',
 2413+ 'languagename-local-ps',
 2414+ 'languagename-local-pt',
 2415+ 'languagename-local-pt-br',
 2416+ 'languagename-local-qu',
 2417+ 'languagename-local-rm',
 2418+ 'languagename-local-rmy',
 2419+ 'languagename-local-rn',
 2420+ 'languagename-local-ro',
 2421+ 'languagename-local-roa-rup',
 2422+ 'languagename-local-roa-tara',
 2423+ 'languagename-local-ru',
 2424+ 'languagename-local-ru-sib',
 2425+ 'languagename-local-rw',
 2426+ 'languagename-local-sa',
 2427+ 'languagename-local-sah',
 2428+ 'languagename-local-sc',
 2429+ 'languagename-local-scn',
 2430+ 'languagename-local-sco',
 2431+ 'languagename-local-sd',
 2432+ 'languagename-local-se',
 2433+ 'languagename-local-sg',
 2434+ 'languagename-local-sh',
 2435+ 'languagename-local-si',
 2436+ 'languagename-local-simple',
 2437+ 'languagename-local-sk',
 2438+ 'languagename-local-sl',
 2439+ 'languagename-local-sm',
 2440+ 'languagename-local-sn',
 2441+ 'languagename-local-so',
 2442+ 'languagename-local-sq',
 2443+ 'languagename-local-sr',
 2444+ 'languagename-local-sr-ec',
 2445+ 'languagename-local-sr-jc',
 2446+ 'languagename-local-sr-el',
 2447+ 'languagename-local-sr-jl',
 2448+ 'languagename-local-ss',
 2449+ 'languagename-local-st',
 2450+ 'languagename-local-su',
 2451+ 'languagename-local-sv',
 2452+ 'languagename-local-sw',
 2453+ 'languagename-local-ta',
 2454+ 'languagename-local-te',
 2455+ 'languagename-local-tet',
 2456+ 'languagename-local-tg',
 2457+ 'languagename-local-th',
 2458+ 'languagename-local-ti',
 2459+ 'languagename-local-tk',
 2460+ 'languagename-local-tl',
 2461+ 'languagename-local-tn',
 2462+ 'languagename-local-to',
 2463+ 'languagename-local-tokipona',
 2464+ 'languagename-local-tp',
 2465+ 'languagename-local-tpi',
 2466+ 'languagename-local-tr',
 2467+ 'languagename-local-ts',
 2468+ 'languagename-local-tt',
 2469+ 'languagename-local-tum',
 2470+ 'languagename-local-tw',
 2471+ 'languagename-local-ty',
 2472+ 'languagename-local-tyv',
 2473+ 'languagename-local-udm',
 2474+ 'languagename-local-ug',
 2475+ 'languagename-local-uk',
 2476+ 'languagename-local-ur',
 2477+ 'languagename-local-uz',
 2478+ 'languagename-local-ve',
 2479+ 'languagename-local-vec',
 2480+ 'languagename-local-vi',
 2481+ 'languagename-local-vls',
 2482+ 'languagename-local-vo',
 2483+ 'languagename-local-wa',
 2484+ 'languagename-local-war',
 2485+ 'languagename-local-wo',
 2486+ 'languagename-local-wuu',
 2487+ 'languagename-local-xal',
 2488+ 'languagename-local-xh',
 2489+ 'languagename-local-yi',
 2490+ 'languagename-local-yo',
 2491+ 'languagename-local-yue',
 2492+ 'languagename-local-za',
 2493+ 'languagename-local-zea',
 2494+ 'languagename-local-zh',
 2495+ 'languagename-local-zh-cfr',
 2496+ 'languagename-local-zh-classical',
 2497+ 'languagename-local-zh-cn',
 2498+ 'languagename-local-zh-hans',
 2499+ 'languagename-local-zh-hant',
 2500+ 'languagename-local-zh-hk',
 2501+ 'languagename-local-zh-min-nan',
 2502+ 'languagename-local-zh-sg',
 2503+ 'languagename-local-zh-tw',
 2504+ 'languagename-local-zh-yue',
 2505+ 'languagename-local-zu',
 2506+ ),
 2507+ );
22152508 /** Comments for each block */
22162509 $wgBlockComments = array(
22172510 'sidebar' => "The sidebar for MonoBook is generated from this message, lines that do not
@@ -2376,8 +2669,9 @@
23772670 'sizeunits' => 'Size units',
23782671 'livepreview' => 'Live preview',
23792672 'lagwarning' => 'Friendlier slave lag warnings',
2380 - 'watchlisteditor' => 'Watchlist editor',
2381 - 'watchlisttools' => 'Watchlist editing tools',
 2673+ 'watchlisteditor' => 'Watchlist editor',
 2674+ 'watchlisttools' => 'Watchlist editing tools',
 2675+ 'languagelocal' => 'Language names in user language',
23822676 );
23832677
23842678 /** Short comments for standalone messages */
Index: trunk/phase3/skins/MonoBook.php
@@ -234,8 +234,9 @@
235235 <div class="pBody">
236236 <ul>
237237 <?php foreach($this->data['language_urls'] as $langlink) { ?>
238 - <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
239 - ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
 238+ <li class="<?php echo htmlspecialchars( $langlink['class'] )?>"><?php
 239+ ?><a title="<?php echo htmlspecialchars( $langlink['title'] )
 240+ ?>" href="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php echo $langlink['text']?></a></li>
240241 <?php } ?>
241242 </ul>
242243 </div>
Index: trunk/phase3/includes/SkinTemplate.php
@@ -416,12 +416,14 @@
417417 foreach( $wgOut->getLanguageLinks() as $l ) {
418418 $tmp = explode( ':', $l, 2 );
419419 $class = 'interwiki-' . $tmp[0];
 420+ $localName = $wgContLang->getLanguageNameLocal( $tmp[0] );
420421 unset($tmp);
421422 $nt = Title::newFromText( $l );
422423 $language_urls[] = array(
423424 'href' => $nt->getFullURL(),
424425 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
425 - 'class' => $class
 426+ 'class' => $class,
 427+ 'title' => $localName
426428 );
427429 }
428430 }
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -2394,4 +2394,9 @@
23952395 'watchlisttools-raw' => 'Listenformat bearbeiten (Import/Export)',
23962396 'watchlisttools-clear' => 'löschen',
23972397
 2398+# Language names in user language
 2399+'languagename-local-de' => 'Deutsch',
 2400+'languagename-local-en' => 'Englisch',
 2401+'languagename-local-fr' => 'Französisch',
 2402+
23982403 );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2990,4 +2990,296 @@
29912991 'watchlisttools-raw' => 'Edit raw watchlist',
29922992 'watchlisttools-clear' => 'Clear watchlist',
29932993
 2994+# Language names in user language
 2995+'languagename-local-aa' => 'Afar',
 2996+'languagename-local-ab' => 'Abkhaz',
 2997+'languagename-local-af' => 'Afrikaans',
 2998+'languagename-local-ak' => 'Akan',
 2999+'languagename-local-als' => 'Alemannic',
 3000+'languagename-local-am' => 'Amharic',
 3001+'languagename-local-an' => 'Aragonese',
 3002+'languagename-local-ang' => 'Old English',
 3003+'languagename-local-ar' => 'Arabic',
 3004+'languagename-local-arc' => 'Aramaic',
 3005+'languagename-local-arn' => 'Mapuche',
 3006+'languagename-local-as' => 'Assamese',
 3007+'languagename-local-ast' => 'Asturian',
 3008+'languagename-local-av' => 'Avar',
 3009+'languagename-local-ay' => 'Aymara',
 3010+'languagename-local-az' => 'Azerbaijani',
 3011+'languagename-local-ba' => 'Bashkir',
 3012+'languagename-local-bar' => 'Bavarian',
 3013+'languagename-local-bat-smg' => 'Samogitian',
 3014+'languagename-local-bcl' => 'BBikol',
 3015+'languagename-local-be' => 'Belarusian normative',
 3016+'languagename-local-be-tarask' => 'Belarusian in Taraskievica orthography',
 3017+'languagename-local-be-x-old' => 'Belarusian in Taraskievica orthography',
 3018+'languagename-local-bg' => 'Bulgarian',
 3019+'languagename-local-bh' => 'Bihara',
 3020+'languagename-local-bi' => 'Bislama',
 3021+'languagename-local-bm' => 'Bambara',
 3022+'languagename-local-bn' => 'Bengali',
 3023+'languagename-local-bo' => 'Tibetan',
 3024+'languagename-local-bpy' => 'Bishnupriya Manipuri',
 3025+'languagename-local-br' => 'Breton',
 3026+'languagename-local-bs' => 'Bosnian',
 3027+'languagename-local-bug' => 'Buginese',
 3028+'languagename-local-bxr' => 'Buryat',
 3029+'languagename-local-ca' => 'Catalan',
 3030+'languagename-local-cbk-zam' => 'Zamboanga Chavacano',
 3031+'languagename-local-cdo' => 'Min Dong',
 3032+'languagename-local-ce' => 'Chechen',
 3033+'languagename-local-ceb' => 'Cebuano',
 3034+'languagename-local-ch' => 'Chamorro',
 3035+'languagename-local-cho' => 'Choctaw',
 3036+'languagename-local-chr' => 'Cherokee',
 3037+'languagename-local-chy' => 'Cheyenne',
 3038+'languagename-local-co' => 'Corsican',
 3039+'languagename-local-cr' => 'Cree',
 3040+'languagename-local-crh' => 'Crimean Tatar',
 3041+'languagename-local-crh-latn' => 'Crimean Tatar (Latin)',
 3042+'languagename-local-crh-cyrl' => 'Crimean Tatar (Cyrillic)',
 3043+'languagename-local-cs' => 'Czech',
 3044+'languagename-local-csb' => 'Cassubian',
 3045+'languagename-local-cu' => 'Old Church Slavonic',
 3046+'languagename-local-cv' => 'Chuvash',
 3047+'languagename-local-cy' => 'Welsh',
 3048+'languagename-local-da' => 'Danish',
 3049+'languagename-local-de' => 'German',
 3050+'languagename-local-diq' => 'Zazaki',
 3051+'languagename-local-dv' => 'Dhivehi',
 3052+'languagename-local-dz' => 'Bhutani',
 3053+'languagename-local-ee' => 'Ewe',
 3054+'languagename-local-el' => 'Greek',
 3055+'languagename-local-eml' => 'Emilian-Romagnol / Sammarinese',
 3056+'languagename-local-en' => 'English',
 3057+'languagename-local-eo' => 'Esperanto',
 3058+'languagename-local-es' => 'Spanish',
 3059+'languagename-local-et' => 'Estonian',
 3060+'languagename-local-eu' => 'Basque',
 3061+'languagename-local-ext' => 'Extremaduran',
 3062+'languagename-local-fa' => 'Persian',
 3063+'languagename-local-ff' => 'Fulah',
 3064+'languagename-local-fi' => 'Finnish',
 3065+'languagename-local-fiu-vro' => 'Võro',
 3066+'languagename-local-fj' => 'Fijian',
 3067+'languagename-local-fo' => 'Faroese',
 3068+'languagename-local-fr' => 'French',
 3069+'languagename-local-frc' => 'Cajun French',
 3070+'languagename-local-frp' => 'Franco-Provençal/Arpitan',
 3071+'languagename-local-fur' => 'Friulian',
 3072+'languagename-local-fy' => 'Frisian',
 3073+'languagename-local-ga' => 'Irish',
 3074+'languagename-local-gd' => 'Scots Gaelic',
 3075+'languagename-local-gl' => 'Galician',
 3076+'languagename-local-glk' => 'Gilaki',
 3077+'languagename-local-gn' => 'Guarani',
 3078+'languagename-local-got' => 'Gothic',
 3079+'languagename-local-gsw' => 'Alemannic',
 3080+'languagename-local-gu' => 'Gujarati',
 3081+'languagename-local-gv' => 'Manx',
 3082+'languagename-local-ha' => 'Hausa',
 3083+'languagename-local-hak' => 'Hakka',
 3084+'languagename-local-haw' => 'Hawaiian',
 3085+'languagename-local-he' => 'Hebrew',
 3086+'languagename-local-hi' => 'Hindi',
 3087+'languagename-local-hil' => 'Hiligaynon',
 3088+'languagename-local-ho' => 'Hiri Motu',
 3089+'languagename-local-hr' => 'Croatian',
 3090+'languagename-local-hsb' => 'Upper Sorbian',
 3091+'languagename-local-ht' => 'Haitian',
 3092+'languagename-local-hu' => 'Hungarian',
 3093+'languagename-local-hy' => 'Armenian',
 3094+'languagename-local-hz' => 'Herero',
 3095+'languagename-local-ia' => 'Interlingua (IALA)',
 3096+'languagename-local-id' => 'Indonesian',
 3097+'languagename-local-ie' => 'Interlingue (Occidental)',
 3098+'languagename-local-ig' => 'Igbo',
 3099+'languagename-local-ii' => 'Sichuan Yi',
 3100+'languagename-local-ik' => 'Inupiak',
 3101+'languagename-local-ilo' => 'Ilokano',
 3102+'languagename-local-io' => 'Ido',
 3103+'languagename-local-is' => 'Icelandic',
 3104+'languagename-local-it' => 'Italian',
 3105+'languagename-local-iu' => 'Inuktitut',
 3106+'languagename-local-ja' => 'Japanese',
 3107+'languagename-local-jbo' => 'Lojban',
 3108+'languagename-local-jv' => 'Javanese',
 3109+'languagename-local-ka' => 'Georgian',
 3110+'languagename-local-kaa' => 'Karakalpak',
 3111+'languagename-local-kab' => 'Kabyle',
 3112+'languagename-local-kg' => 'Kongo',
 3113+'languagename-local-ki' => 'Kikuyu',
 3114+'languagename-local-kj' => 'Kuanyama',
 3115+'languagename-local-kk' => 'Kazakh',
 3116+'languagename-local-kk-cn' => 'Kazakh Arabic',
 3117+'languagename-local-kk-kz' => 'Kazakh Cyrillic',
 3118+'languagename-local-kk-tr' => 'Kazakh Latin',
 3119+'languagename-local-kl' => 'Greenlandic',
 3120+'languagename-local-km' => 'Cambodian',
 3121+'languagename-local-kn' => 'Kannada',
 3122+'languagename-local-ko' => 'Korean',
 3123+'languagename-local-kr' => 'Kanuri',
 3124+'languagename-local-krj' => 'Kinaray-a',
 3125+'languagename-local-ks' => 'Kashmiri',
 3126+'languagename-local-ksh' => 'Ripuarian ',
 3127+'languagename-local-ku' => 'Kurdish',
 3128+'languagename-local-ku-latn' => 'Kurdish Latin script',
 3129+'languagename-local-ku-arab' => 'Kurdish Arabic script',
 3130+'languagename-local-kv' => 'Komi',
 3131+'languagename-local-kw' => 'Cornish',
 3132+'languagename-local-ky' => 'Kirghiz',
 3133+'languagename-local-la' => 'Latin',
 3134+'languagename-local-lad' => 'Ladino',
 3135+'languagename-local-lbe' => 'Lak',
 3136+'languagename-local-lb' => 'Luxemburguish',
 3137+'languagename-local-lg' => 'Ganda',
 3138+'languagename-local-li' => 'Limburgian',
 3139+'languagename-local-lij' => 'Ligurian',
 3140+'languagename-local-lld' => 'Ladin',
 3141+'languagename-local-lmo' => 'Lombard',
 3142+'languagename-local-ln' => 'Lingala',
 3143+'languagename-local-lo' => 'Laotian',
 3144+'languagename-local-lt' => 'Lithuanian',
 3145+'languagename-local-lv' => 'Latvian',
 3146+'languagename-local-lzz' => 'Laz',
 3147+'languagename-local-map-bms' => 'Banyumasan ',
 3148+'languagename-local-mg' => 'Malagasy',
 3149+'languagename-local-mh' => 'Marshallese',
 3150+'languagename-local-mi' => 'Maori',
 3151+'languagename-local-minnan' => 'Min-nan',
 3152+'languagename-local-mk' => 'Macedonian',
 3153+'languagename-local-ml' => 'Malayalam',
 3154+'languagename-local-mn' => 'Mongoloian',
 3155+'languagename-local-mo' => 'Moldovan',
 3156+'languagename-local-mr' => 'Marathi',
 3157+'languagename-local-ms' => 'Malay',
 3158+'languagename-local-mt' => 'Maltese',
 3159+'languagename-local-mus' => 'Creek',
 3160+'languagename-local-my' => 'Burmese',
 3161+'languagename-local-mzn' => 'Mazandarin',
 3162+'languagename-local-na' => 'Nauruan',
 3163+'languagename-local-nah' => 'Nahuatl',
 3164+'languagename-local-nan' => 'Min-nan',
 3165+'languagename-local-nap' => 'Neapolitan',
 3166+'languagename-local-nb' => 'Norwegian (Bokmal)',
 3167+'languagename-local-nds' => 'Low German',
 3168+'languagename-local-nds-nl' => 'Dutch Low Saxon',
 3169+'languagename-local-ne' => 'Nepali',
 3170+'languagename-local-new' => 'Newar / Nepal Bhasa',
 3171+'languagename-local-ng' => 'Ndonga',
 3172+'languagename-local-nl' => 'Dutch',
 3173+'languagename-local-nn' => 'Norwegian (Nynorsk)',
 3174+'languagename-local-no' => 'Norwegian',
 3175+'languagename-local-non' => 'Old Norse',
 3176+'languagename-local-nov' => 'Novial',
 3177+'languagename-local-nrm' => 'Norman',
 3178+'languagename-local-nv' => 'Navajo',
 3179+'languagename-local-ny' => 'Chichewa',
 3180+'languagename-local-oc' => 'Occitan',
 3181+'languagename-local-om' => 'Oromo',
 3182+'languagename-local-or' => 'Oriya',
 3183+'languagename-local-os' => 'Ossetic',
 3184+'languagename-local-pa' => 'Punjabi',
 3185+'languagename-local-pag' => 'Pangasinan',
 3186+'languagename-local-pam' => 'Pampanga',
 3187+'languagename-local-pap' => 'Papiamentu',
 3188+'languagename-local-pdc' => 'Pennsylvania German',
 3189+'languagename-local-pi' => 'Pali',
 3190+'languagename-local-pih' => 'Norfuk',
 3191+'languagename-local-pl' => 'Polish',
 3192+'languagename-local-pms' => 'Piedmontese',
 3193+'languagename-local-ps' => 'Pashto',
 3194+'languagename-local-pt' => 'Portuguese',
 3195+'languagename-local-pt-br' => 'Brazilian Portuguese',
 3196+'languagename-local-qu' => 'Quechua',
 3197+'languagename-local-rm' => 'Raeto-Romance',
 3198+'languagename-local-rmy' => 'Vlax Romany',
 3199+'languagename-local-rn' => 'Kirundi',
 3200+'languagename-local-ro' => 'Romanian',
 3201+'languagename-local-roa-rup' => 'Aromanian',
 3202+'languagename-local-roa-tara' => 'Tarantino',
 3203+'languagename-local-ru' => 'Russian',
 3204+'languagename-local-ru-sib' => 'Siberian/North Russian',
 3205+'languagename-local-rw' => 'Kinyarwanda',
 3206+'languagename-local-sa' => 'Sanskrit',
 3207+'languagename-local-sah' => 'Sakha',
 3208+'languagename-local-sc' => 'Sardinian',
 3209+'languagename-local-scn' => 'Sicilian',
 3210+'languagename-local-sco' => 'Scots',
 3211+'languagename-local-sd' => 'Sindhi',
 3212+'languagename-local-se' => 'Northern Sami',
 3213+'languagename-local-sg' => 'Sango',
 3214+'languagename-local-sh' => 'Serbocroatian',
 3215+'languagename-local-si' => 'Sinhalese',
 3216+'languagename-local-simple' => 'Simple English',
 3217+'languagename-local-sk' => 'Slovak',
 3218+'languagename-local-sl' => 'Slovenian',
 3219+'languagename-local-sm' => 'Samoan',
 3220+'languagename-local-sn' => 'Shona',
 3221+'languagename-local-so' => 'Somali',
 3222+'languagename-local-sq' => 'Albanian',
 3223+'languagename-local-sr' => 'Serbian',
 3224+'languagename-local-sr-ec' => 'Serbian cyrillic ekavian',
 3225+'languagename-local-sr-jc' => 'Serbian cyrillic iyekvian',
 3226+'languagename-local-sr-el' => 'Serbian latin ekavian',
 3227+'languagename-local-sr-jl' => 'Serbian latin iyekavian',
 3228+'languagename-local-ss' => 'Swati',
 3229+'languagename-local-st' => 'Southern Sotho',
 3230+'languagename-local-su' => 'Sundanese',
 3231+'languagename-local-sv' => 'Swedish',
 3232+'languagename-local-sw' => 'Swahili',
 3233+'languagename-local-ta' => 'Tamil',
 3234+'languagename-local-te' => 'Telugu',
 3235+'languagename-local-tet' => 'Tetun',
 3236+'languagename-local-tg' => 'Tajik',
 3237+'languagename-local-th' => 'Thai',
 3238+'languagename-local-ti' => 'Tigrinya',
 3239+'languagename-local-tk' => 'Turkmen',
 3240+'languagename-local-tl' => 'Tagalog',
 3241+'languagename-local-tn' => 'Setswana',
 3242+'languagename-local-to' => 'Tonga',
 3243+'languagename-local-tokipona' => 'Toki Pona',
 3244+'languagename-local-tp' => 'Toki Pona',
 3245+'languagename-local-tpi' => 'Tok Pisin',
 3246+'languagename-local-tr' => ' Turkish',
 3247+'languagename-local-ts' => 'Tsonga',
 3248+'languagename-local-tt' => 'Tatar',
 3249+'languagename-local-tum' => 'Tumbuka',
 3250+'languagename-local-tw' => 'Twi',
 3251+'languagename-local-ty' => 'Tahitian',
 3252+'languagename-local-tyv' => 'Tyvan',
 3253+'languagename-local-udm' => 'Udmurt',
 3254+'languagename-local-ug' => 'Uyghur',
 3255+'languagename-local-uk' => 'Ukrainian',
 3256+'languagename-local-ur' => 'Urdu',
 3257+'languagename-local-uz' => 'Uzbek',
 3258+'languagename-local-ve' => 'Venda',
 3259+'languagename-local-vec' => 'Venetian',
 3260+'languagename-local-vi' => 'Vietnamese',
 3261+'languagename-local-vls' => 'West Flemish',
 3262+'languagename-local-vo' => 'Volapük',
 3263+'languagename-local-wa' => 'Walloon',
 3264+'languagename-local-war' => 'Waray-Waray',
 3265+'languagename-local-wo' => 'Wolof',
 3266+'languagename-local-wuu' => 'Wu',
 3267+'languagename-local-xal' => 'Kalmyk',
 3268+'languagename-local-xh' => 'Xhosan',
 3269+'languagename-local-yi' => 'Yiddish',
 3270+'languagename-local-yo' => 'Yoruba',
 3271+'languagename-local-yue' => 'Cantonese',
 3272+'languagename-local-za' => 'Zhuang',
 3273+'languagename-local-zea' => 'Zealandic',
 3274+'languagename-local-zh' => 'Chinese',
 3275+'languagename-local-zh-cfr' => 'Min-nan',
 3276+'languagename-local-zh-classical' => 'Classical Chinese/Literary Chinese',
 3277+'languagename-local-zh-cn' => 'Chinese (PRC)',
 3278+'languagename-local-zh-hans' => 'Chinese written using the Simplified Chinese script',
 3279+'languagename-local-zh-hant' => 'Chinese written using the Traditional Chinese script',
 3280+'languagename-local-zh-hk' => 'Chinese (Hong Kong)',
 3281+'languagename-local-zh-min-nan' => 'Min-nan',
 3282+'languagename-local-zh-sg' => 'Chinese (Singapore)',
 3283+'languagename-local-zh-tw' => 'Chinese (Taiwan)',
 3284+'languagename-local-zh-yue' => 'Cantonese',
 3285+'languagename-local-zu' => 'aZulu',
29943286 );
Index: trunk/phase3/languages/Language.php
@@ -21,7 +21,7 @@
2222 #
2323
2424 # Read language names
25 -global $wgLanguageNames;
 25+global $wgLanguageNames, $wgLanguageNamesLocal;
2626 require_once( dirname(__FILE__) . '/Names.php' ) ;
2727
2828 global $wgInputEncoding, $wgOutputEncoding;
@@ -380,6 +380,16 @@
381381 return $wgLanguageNames[$code];
382382 }
383383
 384+ /**
 385+ * Get the localized name of a language
 386+ * @param string language code
 387+ * @return string localized name
 388+ */
 389+ function getLanguageNameLocal( $code ) {
 390+ global $wgLanguageNamesLocal, $wgLanguageNames;
 391+ return isset ( $wgLanguageNamesLocal[$code]['languageLocalName'] ) ? $wgLanguageNamesLocal[$code]['languageLocalName'] : '';
 392+ }
 393+
384394 function getMonthName( $key ) {
385395 return $this->getMessageFromDB( self::$mMonthMsgs[$key-1] );
386396 }
Index: trunk/phase3/languages/Names.php
@@ -301,3 +301,10 @@
302302 'zu' => 'isiZulu' # Zulu
303303 );
304304
 305+ /* private */ $wgLanguageNamesLocal = array();
 306+foreach( $wgLanguageNames as $codes => $code ) {
 307+ $message = wfMsg( "languagename-local-$codes" );
 308+ if( $message && !( wfEmptyMsg( "languagename-local-$codes", $message ) ) ) {
 309+ $wgLanguageNamesLocal[$codes]['languageLocalName'] = $message ;
 310+ }
 311+};
Index: trunk/phase3/RELEASE-NOTES
@@ -25,6 +25,9 @@
2626
2727 === New features in 1.12 ===
2828 * Add a warning for non-descriptive filenames at Special:Upload
 29+* Add function Language::getLanguageNameLocal() for the localized name of a
 30+ language
 31+* Add localized name of a language as title to interwiki links
2932
3033 === Bug fixes in 1.12 ===
3134

Follow-up revisions

RevisionCommit summaryAuthorDate
r25781Reverting r25772 for now....brion15:22, 11 September 2007
r25804Merged revisions 25752-25803 via svnmerge from...david02:25, 12 September 2007

Status & tagging log