Debian package: Declare compliance with Debian Policy 4.3.0
[conkeror.git] / modules / page-modes / wikipedia.js
blob0dbe28f1791ec3a5625f4480aaa74c924828951b
1 /**
2  * (C) Copyright 2009 Deniz Dogan
3  * (C) Copyright 2009-2010 John J. Foerch
4  *
5  * Use, modification, and distribution are subject to the terms specified in the
6  * COPYING file.
7  *
8  * Main features:
9  * - "Did you mean", automatic following of spelling suggestions by MediaWiki.
10  * - Changes the behavior of previous-heading and next-heading to better suit
11  *   MediaWiki pages.
12  * - Quick moving between different language versions of the same article using
13  *   `wikipedia-other-language' (C-c C-o by default).
14  * - Probably more to come.
15  **/
17 /*** VARIABLES ***/
19 define_variable("wikipedia_didyoumean_follow_first_hit", false,
20     "When true, follows the first hit in the result list"+
21     "unless a \"did you mean\" in shown.");
23 define_variable("wikipedia_enable_didyoumean", false,
24     "When true, enables \"did you mean\".");
26 define_variable('wikipedia_webjumps_format', 'wikipedia-%s',
27     "This variable controls the names of the webjumps defined "+
28     "by the wikipedia-webjumps module.  It is a simple string "+
29     "format spec.  The format code `%s' will be replaced by the "+
30     "language code for the webjump.");
32 /**
33  * Given the buffer, searches the document for a "did you mean" suggestion box,
34  * which suggests some word that the user might have meant. If such a suggestion
35  * is found, it immediately follows it. If the new page didn't exist either, and
36  * just so happens to have another suggestion, follows that, and so on, until no
37  * more suggestions are found.
38  *
39  * If the user variable "wikipedia_didyoumean_follow_first_hit" is set to
40  * anything which is "true" in a JavaScript condition, when no more suggestions
41  * are found, follows the first match in the search results, if there are any.
42  *
43  * @param buffer The buffer containing the document.
44  */
45 function wikipedia_didyoumean(buffer) {
46     var doc = buffer.document;
47     var didyoumean_xpath = '//div[@class="searchdidyoumean"]/a[1]';
48     var didyoumean = xpath_find_any(doc, didyoumean_xpath);
49     var found = didyoumean.iterateNext();
50     if (found) {
51         // "Did you mean" found.
52         doc.location = found.href;
53     } else {
54         // Follow the first hit if wikipedia_didyoumean_follow_first_hit.
55         if (wikipedia_didyoumean_follow_first_hit) {
56             var firsthit_xpath = '//ul[@class="mw-search-results"]/li[1]/a';
57             var firsthit = xpath_find_any(doc, firsthit_xpath);
58             found = firsthit.iterateNext();
59             if (found) {
60                 doc.location = found.href;
61             }
62         }
63     }
66 /**
67  * define_wikipedia_webjumps defines webjumps for wikipedia in various
68  * languages.  If called with no args, it will define webjumps for all
69  * known languages.  When called with any number of language codes, it
70  * will define webjumps for those language.  The language codes
71  * correspond to the subdomains of wikipedia.com for each language.
72  *
73  * Examples:
74  * define_wikipedia_webjumps("en"); // Makes a webjump to the English WP.
75  * define_wikipedia_webjumps("en", "de", "fr"); // English, German and French
76  * define_wikipedia_webjumps(); // All of the available Wikipedias.
77  */
78 function define_wikipedia_webjumps() {
79     if (arguments.length == 0)
80         var prefixes = object_keys(wikipedia_versions);
81     else
82         prefixes = Array.slice(arguments);
83     for each (let i in prefixes) {
84         var rest = wikipedia_versions[i];
85         var name = string_format(wikipedia_webjumps_format, {s: i});
86         define_webjump(name, "http://" + i + ".wikipedia.org/wiki/" + rest.search);
87     }
91 function wikipedia_other_language (doc) {
92     var regexp = new RegExp("//([^\\.]+)\\.wikipedia\\.org");
93     var links = doc.querySelectorAll('#p-lang li a');
94     var options = {};
95     for (let [_, link] in Iterator(links)) {
96         var href = link.getAttribute("href");
97         if (! href)
98             continue;
99         var matched = href.match(regexp);
100         if (! matched)
101             continue;
102         if (wikipedia_versions[matched[1]] != undefined)
103             options[wikipedia_versions[matched[1]]["language"]] = link.href;
104         else
105             dumpln("Found unknown language: " + matched[1] + "... Please, report a bug.");
106     }
107     return options;
111 interactive("wikipedia-other-language",
112     "Queries the user for another language to view the current article in.",
113     function (I) {
114         var options = wikipedia_other_language(I.buffer.document);
115         var chosen = yield I.minibuffer.read_object_property(
116             $prompt = "Languages:",
117             $object = options);
118         I.buffer.document.location = options[chosen];
119     });
122 define_keymap("wikipedia_keymap", $display_name = "wikipedia");
123 define_key(wikipedia_keymap, "C-c C-o", "wikipedia-other-language");
126 var wikipedia_modality = {
127     normal: wikipedia_keymap
131 /*** MAIN LOADING FUNCTIONALITY ***/
133 define_page_mode("wikipedia-mode",
134     /wikipedia/,  // TODO: Better regular expression
135     function enable (buffer) {
136         if (wikipedia_enable_didyoumean) {
137             do_when("buffer_dom_content_loaded_hook", buffer, wikipedia_didyoumean);
138         }
139         buffer.page.local.headings_xpath = '//h1[@id="firstHeading"] | //span[@class="mw-headline"] | //div[@id="toctitle"]';
140         buffer.content_modalities.push(wikipedia_modality);
141     },
142     function disable (buffer) {
143         remove_hook.call(buffer, "buffer_dom_content_loaded_hook", wikipedia_didyoumean);
144         var i = buffer.content_modalities.indexOf(wikipedia_modality);
145         if (i > -1)
146             buffer.content_modalities.splice(i, 1);
147     },
148     $display_name = "Wikipedia");
150 page_mode_activate(wikipedia_mode);
152 /*** HERE BE DRAGONS ***/
153 /* No, here is really just "data" which is cumbersome to scroll through. */
155 define_variable("wikipedia_versions", {
156     "aa": { language: "Afar", search: "Special:Search?search=%s&go=Go" },
157     "ab": { language: "Abkhazian", search: "%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:Search?search=%s&go=%D0%9F%D0%B5%D1%80%D0%B5%D0%B9%D1%82%D0%B8" },
158     "af": { language: "Afrikaans", search: "Spesiaal:Soek?search=%s&go=Wys" },
159     "ak": { language: "Akan", search: "Special:Search?search=%s&go=K%C9%94" },
160     "als": { language: "Alemannic", search: "Spezial:Suche?search=%s&go=Artikel" },
161     "am": { language: "Amharic", search: "%E1%88%8D%E1%8B%A9:Search?search=%s&go=%E1%8A%A5%E1%8A%95%E1%88%82%E1%8B%B5%21" },
162     "an": { language: "Aragonese", search: "Espezial:Mirar?search=%s&go=Ir-ie" },
163     "ang": { language: "Anglo-Saxon", search: "Special:Search?search=%s&go=G%C4%81n" },
164     "ar": { language: "Arabic", search: "%D8%AE%D8%A7%D8%B5:%D8%A8%D8%AD%D8%AB?search=%s&go=%D8%A7%D8%B0%D9%87%D8%A8" },
165     // TODO: arz - Egyptian Arabic
166     "arc": { language: "Assyrian Neo-Aramaic", search: "Special:Search?search=%s&go=%DC%99%DC%A0" },
167     "as": { language: "Assamese", search: "%E0%A6%AC%E0%A6%BF%E0%A6%B6%E0%A7%87%E0%A6%B7:Search?search=%s&go=%E0%A6%AF%E0%A6%BE%E0%A6%93%E0%A6%81%E0%A6%95" },
168     "ast": { language: "Asturian", search: "Especial:Search?search=%s&go=Dir" },
169     "av": { language: "Avar", search: "%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:Search?search=%s&go=%D0%9F%D0%B5%D1%80%D0%B5%D0%B9%D1%82%D0%B8" },
170     "ay": { language: "Aymara", search: "Especial:Buscar?search=%s&go=Sara%C3%B1a" },
171     "az": { language: "Azeri", search: "X%C3%BCsusi:Search?search=%s&go=G%C9%99tir" },
172     "ba": { language: "Bashkir", search: "%D0%AF%D1%80%D2%99%D0%B0%D0%BC%D1%81%D1%8B:Search?search=%s&go=%D0%9A%D2%AF%D1%81%D0%B5%D2%AF" },
173     "bar": { language: "Bavarian", search: "Spezial:Suche?search=%s&go=Artikl" },
174     // TODO:t-smg - Samogitian
175     "bcl": { language: "Central Bicolano", search: "Espesyal:Hanapon?search=%s&go=Duman%C3%A1n" },
176     "be": { language: "Belarusian", search: "%D0%90%D0%B4%D0%BC%D1%8B%D1%81%D0%BB%D0%BE%D0%B2%D0%B0%D0%B5:Search?search=%s&go=%D0%90%D1%80%D1%82%D1%8B%D0%BA%D1%83%D0%BB" },
177     // TODO: be-x-old - Belarusian (Tarashkevitsa)
178     "bg": { language: "Bulgarian", search: "%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A2%D1%8A%D1%80%D1%81%D0%B5%D0%BD%D0%B5?search=%s&go=%D0%9E%D1%82%D0%B2%D0%B0%D1%80%D1%8F%D0%BD%D0%B5" },
179     "bh": { language: "Bihari", search: "Special:Search?search=%s&go=Go" },
180     "bi": { language: "Bislama", search: "Special:Search?search=%s&go=Go" },
181     "bm": { language: "Bambara", search: "Special:Recherche?search=%s&go=Taa" },
182     "bn": { language: "Bengali", search: "%E0%A6%AC%E0%A6%BF%E0%A6%B6%E0%A7%87%E0%A6%B7:Search?search=%s&go=%E0%A6%9A%E0%A6%B2%E0%A7%8B" },
183     "bo": { language: "Tibetan", search: "Special:Search?search=%s&go=%E0%BD%A6%E0%BD%BC%E0%BD%84%E0%BC%8B%E0%BC%8D" },
184     "bpy": { language: "Bishnupriya Manipuri", search: "%E0%A6%AC%E0%A6%BF%E0%A6%B6%E0%A7%87%E0%A6%B7:Search?search=%s&go=%E0%A6%B9%E0%A6%BE%E0%A6%A4" },
185     "br": { language: "Breton", search: "Dibar:Klask?search=%s&go=Mont" },
186     "bs": { language: "Bosnian", search: "Posebno:Pretraga?search=%s&go=Idi" },
187     "bug": { language: "Buginese", search: "Istimewa:Pencarian?search=%s&go=%E1%A8%92%E1%A8%95%E1%A8%9A" },
188     "bxr": { language: "Buryat (Russia)", search: "Special:Search?search=%s&go=Go" },
189     "ca": { language: "Catalan", search: "Especial:Cerca?search=%s&go=V%C3%A9s-hi" },
190     "cdo": { language: "Min Dong", search: "Special:Search?search=%s&go=K%C3%B3%CC%A4" },
191     "ce": { language: "Chechen", search: "%D0%91%D0%B0%D1%88%D1%85%D0%BE:Search?search=%s&go=%D0%94%D0%B5%D1%85%D1%8C%D0%B0%D0%B4%D0%BE%D1%85%D1%83" },
192     "ceb": { language: "Cebuano", search: "Special:Pangita?search=%s&go=Sige%21" },
193     "ch": { language: "Chamorro", search: "Special:Search?search=%s&go=H%C3%A5nao" },
194     "cho": { language: "Choctaw", search: "Special:Search?search=%s&go=Go" },
195     "chr": { language: "Cherokee", search: "Special:Search?search=%s&go=Go" },
196     "chy": { language: "Cheyenne", search: "Special:Search?search=%s&go=Go" },
197     "co": { language: "Corsican", search: "Special:Search?search=%s&go=And%C3%A0" },
198     "cr": { language: "Cree", search: "Special:Search?search=%s&go=Go" },
199     "crh": { language: "Crimean Tatar", search: "Mahsus:Search?search=%s&go=Bar" },
200     "cs": { language: "Czech", search: "Speci%C3%A1ln%C3%AD:Search?search=%s&go=J%C3%ADt+na" },
201     "csb": { language: "Kashubian", search: "Specjaln%C3%B4:Search?search=%s&go=Bi%C3%B4j%21" },
202     "cu": { language: "Old Church Slavonic", search: "%D0%9D%D0%B0%D1%80%D0%BE%CC%81%D1%87%D1%8C%D0%BD%D0%B0:Search?search=%s&go=%D0%BF%D1%80%D1%A3%D0%B8%D0%B4%D0%B8%CC%81" },
203     "cv": { language: "Chuvash", search: "%D0%AF%D1%82%D0%B0%D1%80%D0%BB%C4%83:Search?search=%s&go=%D0%9A%D1%83%C3%A7" },
204     "cy": { language: "Welsh", search: "Arbennig:Search?search=%s&go=Mynd" },
205     "da": { language: "Danish", search: "Speciel:S%C3%B8gning?search=%s&go=G%C3%A5+til" },
206     "de": { language: "German", search: "Spezial:Suche?search=%s&go=Artikel" },
207     "diq": { language: "Zazaki", search: "Special:Search?search=%s&go=%C5%9Eo" },
208     "dsb": { language: "Lower Sorbian", search: "Specialne:Pyta%C5%9B?search=%s&go=Nastawk" },
209     "dv": { language: "Divehi", search: "Special:Search?search=%s&go=Go" },
210     "dz": { language: "Dzongkha", search: "Special:Search?search=%s&go=%E0%BD%A0%E0%BD%82%E0%BE%B1%E0%BD%BC%E0%BC%8D" },
211     "ee": { language: "Ewe", search: "Special:Search?search=%s&go=Yi" },
212     "el": { language: "Greek", search: "%CE%95%CE%B9%CE%B4%CE%B9%CE%BA%CF%8C:%CE%91%CE%BD%CE%B1%CE%B6%CE%AE%CF%84%CE%B7%CF%83%CE%B7?search=%s&go=%CE%9C%CE%B5%CF%84%CE%AC%CE%B2%CE%B1%CF%83%CE%B7" },
213     "eml": { language: "Emilian-Romagnol", search: "Speciale:Ricerca?search=%s&go=Vai" },
214     "en": { language: "English", search: "Special:Search?search=%s&go=Go" },
215     "eo": { language: "Esperanto", search: "Speciala:Ser%C4%89i?search=%s&go=Ek%21" },
216     "es": { language: "Spanish", search: "Especial:Buscar?search=%s&go=Ir" },
217     "et": { language: "Estonian", search: "Eri:Search?search=%s&go=Mine" },
218     "eu": { language: "Basque", search: "Berezi:Search?search=%s&go=Joan" },
219     "fa": { language: "Farsi", search: "%D9%88%DB%8C%DA%98%D9%87:%D8%AC%D8%B3%D8%AA%D8%AC%D9%88?search=%s&go=%D8%A8%D8%B1%D9%88" },
220     "ff": { language: "Fula", search: "Special:Recherche?search=%s&go=Consulter" },
221     "fi": { language: "Finnish", search: "Toiminnot:Haku?search=%s&go=Siirry" },
222     // TODO: fiu-vro - Võro
223     "fj": { language: "Fijian", search: "Special:Search?search=%s&go=Lako" },
224     "fo": { language: "Faroese", search: "Serstakur:Leita?search=%s&go=Far" },
225     "fr": { language: "French", search: "Special:Recherche?search=%s&go=Consulter" },
226     "frp": { language: "Franco-Provençal/Arpitan", search: "Sp%C3%A8ci%C3%A2l:Recherche?search=%s&go=Alar" },
227     "fur": { language: "Friulian", search: "Speci%C3%A2l:Ricercje?search=%s&go=Va" },
228     "fy": { language: "West Frisian", search: "Wiki:Sykje?search=%s&go=Side" },
229     "ga": { language: "Irish", search: "Speisialta:Search?search=%s&go=Gabh" },
230     "gd": { language: "Scottish Gaelic", search: "Special:Search?search=%s&go=Go" },
231     "gl": { language: "Galician", search: "Especial:Procurar?search=%s&go=Artigo" },
232     "glk": { language: "Gilaki", search: "%D9%88%DB%8C%DA%98%D9%87:%D8%AC%D8%B3%D8%AA%D8%AC%D9%88?search=%s&go=%D8%A8%D9%88%D8%B4%D9%88" },
233     "gn": { language: "Guarani", search: "Mba%27ech%C4%A9ch%C4%A9:Buscar?search=%s&go=Ha" },
234     "got": { language: "Gothic", search: "Special:Search?search=%s&go=%F0%90%8C%B0%F0%90%8D%86%F0%90%8C%B2%F0%90%8C%B0%F0%90%8C%B2%F0%90%8C%B2%F0%90%8C%B0%F0%90%8C%BD" },
235     "gu": { language: "Gujarati", search: "Special:Search?search=%s&go=%E0%AA%9C%E0%AA%BE%E0%AA%93" },
236     "gv": { language: "Manx", search: "Special:Search?search=%s&go=Gow" },
237     "ha": { language: "Hausa", search: "Special:Search?search=%s&go=Go" },
238     "hak": { language: "Hakka", search: "Special:Search?search=%s&go=Chin-ngi%CC%8Dp" },
239     "haw": { language: "Hawaiian", search: "Special:Search?search=%s&go=Hele" },
240     "he": { language: "Hebrew", search: "%D7%9E%D7%99%D7%95%D7%97%D7%93:%D7%97%D7%99%D7%A4%D7%95%D7%A9?search=%s&go=%D7%9C%D7%A2%D7%A8%D7%9A" },
241     "hi": { language: "Hindi", search: "%E0%A4%B5%E0%A4%BF%E0%A4%B6%E0%A5%87%E0%A4%B7:Search?search=%s&go=%E0%A4%9C%E0%A4%BE%E0%A4%8F%E0%A4%81" },
242     "ho": { language: "Hiri Motu", search: "Special:Search?search=%s&go=Go" },
243     "hr": { language: "Croatian", search: "Posebno:Tra%C5%BEi?search=%s&go=Kreni" },
244     "hsb": { language: "Upper Sorbian", search: "Specialnje:Pyta%C4%87?search=%s&go=Nastawk" },
245     "ht": { language: "Haitian", search: "Espesyal:Chache?search=%s&go=Ale" },
246     "hu": { language: "Hungarian", search: "Speci%C3%A1lis:Keres%C3%A9s?search=%s&go=Menj" },
247     "hy": { language: "Armenian", search: "%D5%8D%D5%BA%D5%A1%D5%BD%D5%A1%D6%80%D5%AF%D5%B8%D5%B2:%D5%88%D6%80%D5%B8%D5%B6%D5%A5%D5%AC?search=%s&go=%D4%B1%D5%B6%D6%81%D5%B6%D5%A5%D5%AC" },
248     "hz": { language: "Herero", search: "Special:Search?search=%s&go=Go" },
249     "ia": { language: "Interlingua", search: "Special:Cercar?search=%s&go=Ir" },
250     "id": { language: "Indonesian", search: "Istimewa:Pencarian?search=%s&go=Tuju+ke" },
251     "ie": { language: "Interlingue", search: "Special:Search?search=%s&go=Vade" },
252     "ig": { language: "Igbo", search: "Special:Search?search=%s&go=Go" },
253     "ii": { language: "Sichuan Yi", search: "Special:Search?search=%s&go=%E8%BF%9B%E5%85%A5" },
254     "ik": { language: "Inupiak", search: "Special:Search?search=%s&go=Go" },
255     "ilo": { language: "Ilokano", search: "Special:Search?search=%s&go=Inkan" },
256     "io": { language: "Ido", search: "Specala:Search?search=%s&go=Irez" },
257     "is": { language: "Icelandic", search: "Kerfiss%C3%AD%C3%B0a:Leit?search=%s&go=%C3%81fram" },
258     "it": { language: "Italian", search: "Speciale:Ricerca?search=%s&go=Vai" },
259     "iu": { language: "Inuktitut", search: "Special:Search?search=%s&go=%E1%90%8A%E1%90%83%E1%95%97%E1%96%85" },
260     "ja": { language: "Japanese", search: "%E7%89%B9%E5%88%A5:%E6%A4%9C%E7%B4%A2?search=%s&go=%E8%A1%A8%E7%A4%BA" },
261     "jbo": { language: "Lojban", search: "Special:Search?search=%s&go=jarco" },
262     "jv": { language: "Javanese", search: "Astamiwa:Pencarian?search=%s&go=Tumuju" },
263     "ka": { language: "Georgian", search: "%E1%83%A1%E1%83%9E%E1%83%94%E1%83%AA%E1%83%98%E1%83%90%E1%83%9A%E1%83%A3%E1%83%A0%E1%83%98:%E1%83%AB%E1%83%98%E1%83%94%E1%83%91%E1%83%90?search=%s&go=%E1%83%A1%E1%83%A2%E1%83%90%E1%83%A2%E1%83%98%E1%83%90" },
264     "kab": { language: "Kabyle", search: "Uslig:Search?search=%s&go=%E1%BA%92er" },
265     "kg": { language: "Kongo", search: "Special:Search?search=%s&go=Kuenda" },
266     "ki": { language: "Kikuyu", search: "Special:Search?search=%s&go=Go" },
267     "kj": { language: "Kuanyama", search: "Special:Search?search=%s&go=Go" },
268     "kk": { language: "Kazakh", search: "%D0%90%D1%80%D0%BD%D0%B0%D0%B9%D1%8B:%D0%86%D0%B7%D0%B4%D0%B5%D1%83?search=%s&go=%D3%A8%D1%82%21" },
269     "kl": { language: "Greenlandic", search: "Speciel:S%C3%B8gning?search=%s&go=Pisuppoq" },
270     "km": { language: "Khmer", search: "%E1%9E%96%E1%9E%B7%E1%9E%9F%E1%9F%81%E1%9E%9F:%E1%9E%9F%E1%9F%92%E1%9E%9C%E1%9F%82%E1%9E%84%E1%9E%9A%E1%9E%80?search=%s&go=%E1%9E%91%E1%9F%85" },
271     "kn": { language: "Kannada", search: "%E0%B2%B5%E0%B2%BF%E0%B2%B6%E0%B3%87%E0%B2%B7:Search?search=%s&go=%E0%B2%B9%E0%B3%8B%E0%B2%97%E0%B3%81" },
272     "ko": { language: "Korean", search: "%ED%8A%B9%EC%88%98%EA%B8%B0%EB%8A%A5:%EC%B0%BE%EA%B8%B0?search=%s&go=%EA%B0%80%EA%B8%B0" },
273     "kr": { language: "Kanuri", search: "Special:Search?search=%s&go=Go" },
274     "ks": { language: "Kashmiri", search: "Special:Search?search=%s&go=Go" },
275     "ksh": { language: "Riuparian", search: "Spezial:S%C3%B6k?search=%s&go=Sigg" },
276     "ku": { language: "Kurdish", search: "Taybet:Search?search=%s&go=Gotar" },
277     "kv": { language: "Komi", search: "%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:Search?search=%s&go=%D0%92%D1%83%D0%B4%D0%B6%D0%BD%D1%8B" },
278     "kw": { language: "Cornish", search: "Special:Search?search=%s&go=Ke" },
279     "ky": { language: "Kirghiz", search: "Special:Search?search=%s&go=Go" },
280     "la": { language: "Latin", search: "Specialis:Quaerere?search=%s&go=Ire" },
281     "lad": { language: "Ladino", search: "Especial:Buscar?search=%s&go=Yir" },
282     "lb": { language: "Luxembourgish", search: "Spezial:Sichen?search=%s&go=S%C3%A4it" },
283     "lbe": { language: "Lak", search: "%D0%9A%D1%8A%D1%83%D0%BB%D0%BB%D1%83%D0%B3%D1%8A%D0%B8%D1%80%D0%B0%D0%BB_%D0%BB%D0%B0%D0%B6%D0%B8%D0%BD:Search?search=%s&go=%D0%9F%D0%B5%D1%80%D0%B5%D0%B9%D1%82%D0%B8" },
284     "lg": { language: "Luganda", search: "Special:Search?search=%s&go=Nona" },
285     "li": { language: "Limburgish", search: "Speciaal:Zeuke?search=%s&go=Artikel" },
286     "lij": { language: "Ligurian", search: "Speciale:Ri%C3%A7erca?search=%s&go=Vanni" },
287     "lmo": { language: "Lombard", search: "Speciale:Ricerca?search=%s&go=V%C3%A0" },
288     "ln": { language: "Lingala", search: "Special:Recherche?search=%s&go=K%C9%9Bnd%C9%9B%CC%81" },
289     "lo": { language: "Lao", search: "%E0%BA%9E%E0%BA%B4%E0%BB%80%E0%BA%AA%E0%BA%94:%E0%BA%8A%E0%BA%AD%E0%BA%81%E0%BA%AB%E0%BA%B2?search=%s&go=%E0%BB%84%E0%BA%9B" },
290     "lt": { language: "Lithuanian", search: "Specialus:Paie%C5%A1ka?search=%s&go=Rodyti" },
291     "lv": { language: "Latvian", search: "Special:Search?search=%s&go=Aiziet%21" },
292     // TODO: map-bms - Banyumasan
293     "mg": { language: "Malagasy", search: "Special:Recherche?search=%s&go=Tsidiho" },
294     "mh": { language: "Marshallese", search: "Special:Search?search=%s&go=Go" },
295     "mi": { language: "Maori", search: "Special:Search?search=%s&go=Haere" },
296     "mk": { language: "Macedonian", search: "%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D1%98%D0%B0%D0%BB%D0%BD%D0%B8:%D0%91%D0%B0%D1%80%D0%B0%D1%98?search=%s&go=%D0%9E%D0%B4%D0%B8" },
297     "ml": { language: "Malayalam", search: "%E0%B4%AA%E0%B5%8D%E0%B4%B0%E0%B4%A4%E0%B5%8D%E0%B4%AF%E0%B5%87%E0%B4%95%E0%B4%82:Search?search=%s&go=%E0%B4%AA%E0%B5%8B%E0%B4%95%E0%B5%82" },
298     "mn": { language: "Mongolian", search: "Special:Search?search=%s&go=%D0%AF%D0%B2%D0%B0%D1%85" },
299     "mo": { language: "Moldovan", search: "Special:C%C4%83utare?search=%s&go=%D0%94%D1%83%D1%87%D0%B5" },
300     "mr": { language: "Marathi", search: "%E0%A4%B5%E0%A4%BF%E0%A4%B6%E0%A5%87%E0%A4%B7:%E0%A4%B6%E0%A5%8B%E0%A4%A7%E0%A4%BE?search=%s&go=%E0%A4%B2%E0%A5%87%E0%A4%96" },
301     "ms": { language: "Malay", search: "Khas:Gelintar?search=%s&go=Pergi" },
302     "mt": { language: "Maltese", search: "Special:Fittex?search=%s&go=Mur" },
303     "mus": { language: "Muscogee", search: "Special:Search?search=%s&go=Go" },
304     "my": { language: "Burmese", search: "Special:Search?search=%s&go=%E1%80%9E%E1%80%BD%E1%80%AC%E1%80%B8%E2%80%8B%E1%80%95%E1%80%AB%E2%80%8B" },
305     "mzn": { language: "Mazandarani", search: "%D9%88%DB%8C%DA%98%D9%87:%D8%AC%D8%B3%D8%AA%D8%AC%D9%88?search=%s&go=%D8%A8%D9%88%D8%B1" },
306     "na": { language: "Nauruan", search: "Special:Search?search=%s&go=Go" },
307     "nah": { language: "Nahuatl", search: "N%C5%8Dncuahqu%C4%ABzqui:Tlat%C4%93m%C5%8Dz?search=%s&go=Y%C4%81uh" },
308     "nap": { language: "Neapolitan", search: "Speci%C3%A0le:Ricerca?search=%s&go=Vaje" },
309     "nds": { language: "Low Saxon", search: "Spezial:S%C3%B6%C3%B6k?search=%s&go=Los" },
310     "ne": { language: "Nepali", search: "Special:Search?search=%s&go=%E0%A4%9C%E0%A4%BE%E0%A4%89" },
311     "new": { language: "Newar/Nepal Bhasa", search: "%E0%A4%B5%E0%A4%BF%E0%A4%B6%E0%A5%87%E0%A4%B7:Search?search=%s&go=%E0%A4%A5%E0%A5%8D%E0%A4%B5+%E0%A4%9A%E0%A5%8D%E0%A4%B5%E0%A4%B8%E0%A5%81" },
312     "ng": { language: "Ndonga", search: "Special:Search?search=%s&go=Go" },
313     "nl": { language: "Dutch", search: "Speciaal:Zoeken?search=%s&go=Artikel" },
314     "nn": { language: "Norwegian (nynorsk)", search: "Spesial:S%C3%B8k?search=%s&go=Vis" },
315     "no": { language: "Norwegian (bokmål)", search: "Spesial:S%C3%B8k?search=%s&go=G%C3%A5" },
316     "nov": { language: "Novial", search: "Special:Search?search=%s&go=Vada" },
317     "nrm": { language: "Norman", search: "Special:Search?search=%s&go=Lanchiz" },
318     "nv": { language: "Navajo", search: "Special:Search?search=%s&go=Go" },
319     "ny": { language: "Chichewa", search: "Special:Search?search=%s&go=Pitani" },
320     "oc": { language: "Occitan", search: "Especial:Rec%C3%A8rca?search=%s&go=Consultar" },
321     "om": { language: "Oromo", search: "Special:Search?search=%s&go=Fufi" },
322     "or": { language: "Oriya", search: "Special:Search?search=%s&go=Go" },
323     "os": { language: "Ossetian", search: "%D0%A1%C3%A6%D1%80%D0%BC%D0%B0%D0%B3%D0%BE%D0%BD%D0%B4:Search?search=%s&go=%D0%A1%D1%82%D0%B0%D1%82%D1%8C%D1%8F%D0%BC%C3%A6" },
324     "pa": { language: "Punjabi", search: "%E0%A8%96%E0%A8%BE%E0%A8%B8:Search?search=%s&go=%E0%A8%9C%E0%A8%BE%E0%A8%93" },
325     "pag": { language: "Pangasinan", search: "Special:Search?search=%s&go=Ula" },
326     "pam": { language: "Kapampangan", search: "Special:Search?search=%s&go=Sulung" },
327     "pap": { language: "Papiamentu", search: "Special:Search?search=%s&go=Go" },
328     "pdc": { language: "Pennsylvania German", search: "Spezial:Suche?search=%s&go=Seite" },
329     "pi": { language: "Pali", search: "Special:Search?search=%s&go=%E0%A4%97%E0%A4%9A%E0%A5%8D%E0%A4%9B%E0%A4%BE%E0%A4%AE%E0%A4%BF" },
330     "pih": { language: "Norfolk", search: "Special:Search?search=%s&go=Go" },
331     "pl": { language: "Polish", search: "Specjalna:Szukaj?search=%s&go=Przejd%C5%BA" },
332     "pms": { language: "Piedmontese", search: "Special:Ricerca?search=%s&go=Va" },
333     "ps": { language: "Pashto", search: "%DA%81%D8%A7%D9%86%DA%AB%DA%93%DB%8C:%D9%84%D9%BC%D9%88%D9%86?search=%s&go=%D9%88%D8%B1%DA%81%D9%87" },
334     "pt": { language: "Portuguese", search: "Especial:Busca?search=%s&go=Ir" },
335     "qu": { language: "Quechua", search: "Sapaq:Maskay?search=%s&go=Riy" },
336     "rm": { language: "Romansh", search: "Special:Search?search=%s&go=dai%21" },
337     "rmy": { language: "Vlax Romani", search: "Uzalutno:C%C4%83utare?search=%s&go=Ja" },
338     "rn": { language: "Kirundi", search: "Special:Search?search=%s&go=Go" },
339     "ro": { language: "Romanian", search: "Special:C%C4%83utare?search=%s&go=Salt" },
340     // TODO: roa-rup - Aromanian
341     // TODO: roa-tara - Tarantino
342     "ru": { language: "Russian", search: "%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:Search?search=%s&go=%D0%9F%D0%B5%D1%80%D0%B5%D0%B9%D1%82%D0%B8" },
343     "rw": { language: "Kinyarwanda", search: "Special:Search?search=%s&go=Go" },
344     "sa": { language: "Sanskrit", search: "Special:Search?search=%s&go=%E0%A4%9C%E0%A4%BE%E0%A4%AF%E0%A5%87%E0%A4%82" },
345     "sah": { language: "Sakha", search: "%D0%90%D0%BD%D0%B0%D0%BB%D0%BB%D0%B0%D0%B0%D1%85:Search?search=%s&go=%D0%9A%D3%A9%D1%80%D0%B4%D3%A9%D1%80" },
346     "sc": { language: "Sardinian", search: "Speciale:Search?search=%s&go=Bae" },
347     "scn": { language: "Sicilian", search: "Spiciali:Ricerca?search=%s&go=Vai" },
348     "sco": { language: "Scots", search: "Special:Search?search=%s&go=Gang" },
349     "sd": { language: "Sindhi", search: "Special:%DA%B3%D9%88%D9%84%D8%A7?search=%s&go=%DA%A9%D9%88%D9%84%D9%8A%D9%88" },
350     "se": { language: "Nortern Sami", search: "Special:Search?search=%s&go=Mana" },
351     "sg": { language: "Sango", search: "Special:Search?search=%s&go=Go" },
352     "sh": { language: "Serbo-Croatian", search: "Special:Search?search=%s&go=Go" },
353     "si": { language: "Sinhalese", search: "%E0%B7%80%E0%B7%92%E0%B7%81%E0%B7%9A%E0%B7%82:%E0%B6%9C%E0%B7%80%E0%B7%9A%E0%B7%82%E0%B6%AB%E0%B6%BA?search=%s&go=%E0%B6%BA%E0%B6%B1%E0%B7%8A%E0%B6%B1" },
354     "simple": { language: "Simple English", search: "Special:Search?search=%s&go=Go" },
355     "sk": { language: "Slovak", search: "%C5%A0peci%C3%A1lne:Search?search=%s&go=%C3%8Ds%C5%A5+na" },
356     "sl": { language: "Slovenian", search: "Posebno:Search?search=%s&go=Pojdi+na" },
357     "sm": { language: "Samoan", search: "Special:Search?search=%s&go=Alu" },
358     "sn": { language: "Shona", search: "Special:Search?search=%s&go=Enda" },
359     "so": { language: "Somali", search: "Special:Search?search=%s&go=Soco" },
360     "sq": { language: "Albanian", search: "Speciale:K%C3%ABrkim?search=%s&go=Shko" },
361     "sr": { language: "Serbian", search: "%D0%9F%D0%BE%D1%81%D0%B5%D0%B1%D0%BD%D0%BE:Search?search=%s&go=%D0%98%D0%B4%D0%B8" },
362     "ss": { language: "Swati", search: "Special:Search?search=%s&go=K%C3%BAh%C3%A1mba" },
363     "st": { language: "Sesotho", search: "Special:Search?search=%s&go=Go" },
364     "stq": { language: "Saterland Frisian", search: "Spezial:Suche?search=%s&go=Siede" },
365     "su": { language: "Sundanese", search: "Husus:Sungsi?search=%s&go=Jung" },
366     "sv": { language: "Swedish", search: "Special:S%C3%B6k?search=%s&go=G%C3%A5+till" },
367     "sw": { language: "Swahili", search: "Special:Search?search=%s&go=Nenda" },
368     "szl": { language: "Silesian", search: "Specjalna:Szukaj?search=%s&go=P%C5%99y%C5%84d%C5%BA" },
369     "ta": { language: "Tamil", search: "%E0%AE%9A%E0%AE%BF%E0%AE%B1%E0%AE%AA%E0%AF%8D%E0%AE%AA%E0%AF%81:Search?search=%s&go=%E0%AE%9A%E0%AF%86%E0%AE%B2%E0%AF%8D" },
370     "te": { language: "Telugu", search: "%E0%B0%AA%E0%B1%8D%E0%B0%B0%E0%B0%A4%E0%B1%8D%E0%B0%AF%E0%B1%87%E0%B0%95:%E0%B0%85%E0%B0%A8%E0%B1%8D%E0%B0%B5%E0%B1%87%E0%B0%B7%E0%B0%A3?search=%s&go=%E0%B0%B5%E0%B1%86%E0%B0%B3%E0%B1%8D%E0%B0%B2%E0%B1%81" },
371     "tet": { language: "Tetum", search: "Espesi%C3%A1l:Buka?search=%s&go=P%C3%A1jina" },
372     "tg": { language: "Tajik", search: "%D0%92%D0%B8%D0%B6%D0%B0:Search?search=%s&go=%D0%91%D0%B8%D1%80%D0%B0%D0%B2" },
373     "th": { language: "Thai", search: "%E0%B8%9E%E0%B8%B4%E0%B9%80%E0%B8%A8%E0%B8%A9:%E0%B8%84%E0%B9%89%E0%B8%99%E0%B8%AB%E0%B8%B2?search=%s&go=%E0%B9%84%E0%B8%9B" },
374     "ti": { language: "Tigrinya", search: "Special:Search?search=%s&go=Go" },
375     "tk": { language: "Turkmen", search: "Special:Search?search=%s&go=Git" },
376     "tl": { language: "Tagalog", search: "Natatangi:Search?search=%s&go=Punta" },
377     "tn": { language: "Tswana", search: "Special:Search?search=%s&go=Tsamaya" },
378     "to": { language: "Tongan", search: "Special:Search?search=%s&go=Fai+%C4%81" },
379     "tokipona": { language: "Tokipona", search: "Special:Search?search=%s&go=Go" },
380     "tpi": { language: "Tok Pisin", search: "Special:Search?search=%s&go=Go" },
381     "tr": { language: "Turkish", search: "%C3%96zel:Ara?search=%s&go=Git" },
382     "ts": { language: "Tsonga", search: "Special:Search?search=%s&go=Nghena" },
383     "tt": { language: "Tatar", search: "Maxsus:Search?search=%s&go=K%C3%BC%C3%A7" },
384     "tum": { language: "Tumbuka", search: "Special:Search?search=%s&go=Go" },
385     "tw": { language: "Twi", search: "Special:Search?search=%s&go=Go" },
386     "ty": { language: "Tahitian", search: "Special:Recherche?search=%s&go=Haere" },
387     "udm": { language: "Udmurt", search: "%D0%9F%D0%B0%D0%BD%D0%B5%D0%BB%D1%8C:Search?search=%s&go=%D0%9F%D0%B5%D1%80%D0%B5%D0%B9%D1%82%D0%B8" },
388     "ug": { language: "Uyghur", search: "Special:Search?search=%s&go=Kuchush" },
389     "uk": { language: "Ukranian", search: "%D0%A1%D0%BF%D0%B5%D1%86%D1%96%D0%B0%D0%BB%D1%8C%D0%BD%D0%B0:Search?search=%s&go=%D0%9F%D0%B5%D1%80%D0%B5%D0%B9%D1%82%D0%B8" },
390     "ur": { language: "Urdu", search: "%D8%AE%D8%A7%D8%B5:Search?search=%s&go=%D8%AD%D8%B1%DA%A9%D8%AA" },
391     "uz": { language: "Uzbek", search: "Maxsus:Search?search=%s&go=O%27tish" },
392     "ve": { language: "Venda", search: "Special:Search?search=%s&go=Go" },
393     "vec": { language: "Venetian", search: "Speciale:Serca?search=%s&go=V%C3%A0" },
394     "vi": { language: "Vietnamese", search: "%C4%90%E1%BA%B7c_bi%E1%BB%87t:T%C3%ACm_ki%E1%BA%BFm?search=%s&go=Xem" },
395     "vls": { language: "West Flemish", search: "Specioal:Zoeken?search=%s&go=OK" },
396     "vo": { language: "Volapük", search: "Patikos:Suk?search=%s&go=Getol%C3%B6d" },
397     "wa": { language: "Walloon", search: "Sipeci%C3%A5s:Recherche?search=%s&go=Potch%C3%AE" },
398     "war": { language: "Waray-Waray", search: "Special:Bilnga?search=%s&go=Kadto-a" },
399     "wo": { language: "Wolof", search: "Special:Ceet?search=%s&go=Ayca" },
400     "wuu": { language: "Wu", search: "Special:Search?search=%s&go=%E8%BF%9B%E5%85%A5" },
401     "xal": { language: "Kalmyk", search: "%D0%9A%D3%A9%D0%B4%D0%BB%D1%85%D0%BD%C9%99:Search?search=%s&go=Go" },
402     "xh": { language: "Xhosa", search: "Special:Search?search=%s&go=Hamba" },
403     "yi": { language: "Yiddish", search: "%D7%91%D7%90%D6%B7%D7%96%D7%95%D7%A0%D7%93%D7%A2%D7%A8:%D7%96%D7%95%D7%9B%D7%9F?search=%s&go=%D7%92%D7%99%D7%99" },
404     "yo": { language: "Yoruba", search: "P%C3%A0t%C3%A0k%C3%AC:Search?search=%s&go=%C3%93+y%C3%A1%21" },
405     "za": { language: "Zhuang", search: "Special:Search?search=%s&go=Bei" },
406     "zea": { language: "Zealandic", search: "Speciaol:Zoeken?search=%s&go=Bladzie" },
407     "zh": { language: "Chinese", search: "Special:Search?search=%s&go=%E8%BF%9B%E5%85%A5" },
408     // TODO: zh-classical - Classical Chinese
409     // TODO: zh-min-nan - Min Nan
410     "zu": { language: "Zulu", search: "Special:Search?search=%s&go=Go" }
411 }, "Wikipedia version information. The key is the language code for the Wikipedia.");
413 provide("wikipedia");