MediaWiki:Gadget-langcode2name.js
Jump to navigation
Jump to search
Note: You may have to bypass your browser’s cache to see the changes. In addition, after saving a sitewide CSS file such as MediaWiki:Common.css, it will take 5-10 minutes before the changes take effect, even if you clear your cache.
- Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
- Konqueror and Chrome: click Reload or press F5;
- Opera: clear the cache in Tools → Preferences;
- Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.
- The following documentation is located at MediaWiki:Gadget-langcode2name.js/documentation. [edit]
- This script is not a part of any gadget (edit definitions).
- Useful links: subpage list • links • redirects
Provides tables mapping language code to English name or native name. Beware: not up-to-date.
See also: Special:Gadgets.
// {{deprecated}}
/* <source lang="javascript"> */
(function ()
{
var triplets = [
['aa', 'Afar', 'Afar'],
['ab', 'Abkhaz', 'Аҧсуа'],
['af', 'Afrikaans', 'Afrikaans'],
['ak', 'Akan', 'Akan'],
['als', 'Tosk Albanian', 'Alemannisch'],
['am', 'Amharic', 'አማርኛ'],
['an', 'Aragonese', 'Aragonés'],
['ang', 'Old English', 'Anglo-Saxon'],
['ar', 'Arabic', 'العربية'],
['as', 'Assamese', 'অসমীয়া'],
['ast', 'Asturian', 'Asturianu'],
['av', 'Avar', 'Авар'],
['ay', 'Aymara', 'Aymar'],
['az', 'Azeri', 'Azərbaycan'],
['ba', 'Bashkir', 'Башҡорт'],
['be', 'Belarusian', 'Беларуская'],
['bg', 'Bulgarian', 'Български'],
['bh', 'Bihari', 'भोजपुरी'],
['bi', 'Bislama', 'Bislama'],
['bm', 'Bambara', 'Bamanankan'],
['bn', 'Bengali', 'বাংলা'],
['bo', 'Tibetan', 'བོད་ཡིག'],
['br', 'Breton', 'Brezhoneg'],
['bs', 'Bosnian', 'Bosanski'],
['ca', 'Catalan', 'Català'],
['ch', 'Chamorro', 'Chamoru'],
['chr', 'Cherokee', 'ᏣᎳᎩ'],
['co', 'Corsican', 'Corsu'],
['cr', 'Cree', 'Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ'],
['cs', 'Czech', 'Česky'],
['csb', 'Kashubian', 'Kaszëbsczi'],
['cy', 'Welsh', 'Cymraeg'],
['da', 'Danish', 'Dansk'],
['de', 'German', 'Deutsch'],
['dv', 'Divehi', 'ދިވެހިބަސް'],
['dz', 'Dzongkha', 'ཇོང་ཁ'],
['el', 'Greek', 'Ελληνικά'],
['en', 'English', 'English'],
['eo', 'Esperanto', 'Esperanto'],
['es', 'Spanish', 'Español'],
['et', 'Estonian', 'Eesti'],
['eu', 'Basque', 'Euskara'],
['fa', 'Persian', 'فارسی'],
['fi', 'Finnish', 'Suomi'],
['fj', 'Fijian', 'Na Vosa Vakaviti'],
['fo', 'Faroese', 'Føroyskt'],
['fr', 'French', 'Français'],
['fy', 'West Frisian', 'Frysk'],
['ga', 'Irish', 'Gaeilge'],
['gd', 'Scottish Gaelic', 'Gàidhlig'],
['gl', 'Galician', 'Galego'],
['gn', 'Guaraní', "Avañe'ẽ"],
['gu', 'Gujarati', 'ગુજરાતી'],
['gv', 'Manx', 'Gaelg'],
['ha', 'Hausa', 'هَوُسَ'],
['he', 'Hebrew', 'עברית'],
['hi', 'Hindi', 'हिन्दी'],
['hr', 'Croatian', 'Hrvatski'],
['hsb', 'Upper Sorbian', 'Hornjoserbsce'],
['ht', 'Haitian Creole', 'Kreyòl ayisyen'],
['hu', 'Hungarian', 'Magyar'],
['hy', 'Armenian', 'Հայերեն'],
['ia', 'Interlingua', 'Interlingua'],
['id', 'Indonesian', 'Bahasa Indonesia'],
['ie', 'Interlingue', 'Interlingue'],
['ik', 'Inupiak', 'Iñupiak'],
['io', 'Ido', 'Ido'],
['is', 'Icelandic', 'Íslenska'],
['it', 'Italian', 'Italiano'],
['iu', 'Inuktitut', 'ᐃᓄᒃᑎᑐᑦ/inuktitut'],
['ja', 'Japanese', '日本語'],
['jbo', 'Lojban', 'Lojban'],
['jv', 'Javanese', 'Basa Jawa'],
['ka', 'Georgian', 'ქართული'],
['kk', 'Kazakh', 'Қазақша'],
['kl', 'Greenlandic', 'Kalaallisut'],
['km', 'Khmer', 'ភាសាខ្មែរ'],
['kn', 'Kannada', 'ಕನ್ನಡ'],
['ko', 'Korean', '한국어'],
['ks', 'Kashmiri', 'कश्मीरी - (كشميري)'],
['ku', 'Kurdish', 'Kurdî / كوردی'],
['kw', 'Cornish', 'Kernewek'],
['ky', 'Kirghiz', 'Кыргызча'],
['la', 'Latin', 'Latina'],
['lb', 'Luxembourgish', 'Lëtzebuergesch'],
['li', 'Limburgish', 'Limburgs'],
['ln', 'Lingala', 'Lingála'],
['lo', 'Lao', 'ລາວ'],
['lt', 'Lithuanian', 'Lietuvių'],
['lv', 'Latvian', 'Latviešu'],
['mg', 'Malagasy', 'Malagasy'],
['mh', 'Marshallese', 'Ebon'],
['mi', 'Maori', 'Māori'],
['mk', 'Macedonian', 'Македонски'],
['ml', 'Malayalam', 'മലയാളം'],
['mn', 'Mongolian', 'Монгол'],
['mo', 'Moldavian', 'Молдовеняскэ'],
['mr', 'Marathi', 'मराठी'],
['ms', 'Malay', 'Bahasa Melayu'],
['mt', 'Maltese', 'Malti'],
['my', 'Burmese', 'Myanmasa'],
['na', 'Nauruan', 'Ekakairũ Naoero'],
['nah', 'Nahuatl', 'Nahuatl'],
['nds', 'Low Saxon', 'Plattdüütsch'],
['ne', 'Nepali', 'नेपाली'],
['nl', 'Dutch', 'Nederlands'],
['nn', 'Norwegian Nynorsk', 'Norsk (nynorsk)'],
['no', 'Norwegian', 'Norsk (bokmål)'],
['oc', 'Occitan', 'Occitan'],
['om', 'Oromo', 'Oromoo'],
['or', 'Odia', 'ଓଡ଼ିଆ'],
['pa', 'Punjabi', 'ਪੰਜਾਬੀ'],
['pi', 'Pali', 'पािऴ'],
['pl', 'Polish', 'Polski'],
['ps', 'Pashto', 'پښتو'],
['pt', 'Portuguese', 'Português'],
['qu', 'Quechua', 'Runa Simi'],
['rm', 'Romansch', 'Rumantsch'],
['rn', 'Kirundi', 'Kirundi'],
['ro', 'Romanian', 'Română'],
['roa-rup', 'Aromanian', 'Armãneashce'],
['ru', 'Russian', 'Русский'],
['rw', 'Rwandi', 'Kinyarwanda'],
['sa', 'Sanskrit', 'संस्कृत'],
['sc', 'Sardinian', 'Sardu'],
['scn', 'Sicilian', 'Sicilianu'],
['sd', 'Sindhi', 'سنڌي'],
['sg', 'Sangro', 'Sängö'],
['sh', 'Serbo-Croatian', 'Srpskohrvatski / Српскохрватски'],
['si', 'Sinhalese', 'සිංහල'],
['simple', 'Simple English', 'Simple English'],
['sk', 'Slovak', 'Slovenčina'],
['sl', 'Slovene', 'Slovenščina'],
['sm', 'Samoan', 'Gagana Samoa'],
['sn', 'Shona', 'chiShona'],
['so', 'Somali', 'Soomaaliga'],
['sq', 'Albanian', 'Shqip'],
['sr', 'Serbian', 'Српски / Srpski'],
['ss', 'Siswati', 'SiSwati'],
['st', 'Southern Sotho', 'Sesotho'],
['su', 'Sundanese', 'Basa Sunda'],
['sv', 'Swedish', 'Svenska'],
['sw', 'Swahili', 'Kiswahili'],
['ta', 'Tamil', 'தமிழ்'],
['te', 'Telugu', 'తెలుగు'],
['tg', 'Tajik', 'Тоҷикӣ/tojikī'],
['th', 'Thai', 'ไทย'],
['ti', 'Tigrinya', 'ትግርኛ'],
['tk', 'Turkmen', 'Türkmen'],
['tl', 'Tagalog', 'Tagalog'],
['tn', 'Tswana', 'Setswana'],
['to', 'Tongan', 'faka-Tonga'],
['tokipona', 'Toki Pona', 'Toki Pona'],
['tpi', 'Tok Pisin', 'Tok Pisin'],
['tr', 'Turkish', 'Türkçe'],
['ts', 'Tsonga', 'Xitsonga'],
['tt', 'Tatar', 'Tatarça/Татарча'],
['tw', 'Twi', 'Twi'],
['ug', 'Uighur', 'Uyghurche / ئۇيغۇرچە'],
['uk', 'Ukrainian', 'Українська'],
['ur', 'Urdu', 'اردو'],
['uz', 'Uzbek', "O'zbek"],
['vi', 'Vietnamese', 'Tiếng Việt'],
['vo', 'Volapük', 'Volapük'],
['wa', 'Walloon', 'Walon'],
['wo', 'Wolof', 'Wolof'],
['xh', 'Xhosa', 'isiXhosa'],
['yi', 'Yiddish', 'ייִדיש'],
['yo', 'Yoruba', 'Yorùbá'],
['za', 'Zhuang', '(Cuengh)'],
['zh', 'Mandarin', '中文'],
['zh-min-nan', 'Min Nan', 'Bân-lâm-gú'],
['zu', 'Zulu', 'isiZulu']
];
var code2nametable = new Object();
var code2FLnametable = new Object();
var name2codetable = new Object();
var FLname2codetable = new Object();
for(var i = 0; i < triplets.length; ++i)
{
code2nametable[triplets[i][0]] = triplets[i][1];
code2FLnametable[triplets[i][0]] = triplets[i][2];
name2codetable[triplets[i][1]] = triplets[i][0];
FLname2codetable[triplets[i][2]] = triplets[i][0];
}
langcode2name = function(code) { return code2nametable[code]; };
langcode2FLname = function(code) { return code2FLnametable[code]; };
langname2code = function(name) { return name2codetable[name]; };
FLname2code = function(FLname) { return FLname2codetable[FLname]; };
})();
if( document.callbacks_langcode ){
for(var callback in document.callbacks_langcode){
document.callbacks_langcode[callback]();
}
}
/* </source> */