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