Script Summary: Search terms with all languages in Wikipedia.
Wikipedia does not support searching terms in all languages. For example, if user tries to "Go" to "China" (written in English) entry in Chinese Wikipedia, he/she does not enter the Chinese "China" entry. Instead, the user is redirected to a search page, saying "China" entry does not exist. The worse is, he/she cannot even find the China entry in the first page of the search list.
With this script, a list of other languages is displayed in the Wikipedia search page, if such entry exists in each language version. In the example above, a long list of links is displayed, such as English, Deutsch or Cantonese. Clicking on the links is equivalent to using the "Go" button from the corresponding language Wikipedia site. Furthermore, each language's native name is preserved, exactly as what is shown in normal entries, which helps user identifying unfamiliar languages.
An useful application could happen if you encounter a strange term. For example, if you don't know what "Netzwerk" is, use "Go" or "Search" button in any of your favorite Wikipedia site, you will see German appear in the "other languages" container. Click any of the listed languages and click "English" in the opened entry page, you will be redirected to the "Network" entry page.
The languages are not ordered as in the normal entry pages. The order depends on which server responds query first.
Options and features
It is recommended to use the language filter option in this script to limit query only for what you are interested in. It shortens query response time and save Wikipedia server bandwidth. (default no filter)
Auto Enter is a convenient feature if you favorite some Wikipedia sites but also be interested in some other sites. After adding some language prefix codes in the auto enter list, say ["en", "de"], when you search a term, if the English Wikipedia has the term entry, you will be automatically redirected to the corresponding English entry. If English not, but German does, you will enter the German entry. If none does, you will stay at the search page. Leave the list blank to disable Auto Enter. (default disabled)
There is also a wait interval for XML HTTP response. (default 0.5 second)
Please open the script file to change the options.
Thanks to the MediaWiki API, people can retrieve sufficient information related to the Wikipedia site to extend functionality. I mainly use GM_xmlhttpRequest function to query the entry page information of the search term. The server returns invalid page ID is the term is not in that language.
There is a bug entry in Wikimedia Bugzilla (https://bugzilla.wikimedia.org/show_bug.cgi?id=1837), which suggests using http://wikicities.com/wiki/Special:Search to search inter-languages. However, that link redirects to Wikia, a Wikipedia related site, but not mirror site of Wikipedia.
Some terms may appear in different but analogous languages, such as classical and modern Chinese. Wikipedia seems consider them identical and return duplicated query results. Though there are false positives, there should be no false negatives, meaning if a term DOES exist in a Wikipedia site, it WILL be returned, definitely.
Some Wikipedia site might not have language name, such as Wikimedia Commons. In these cases, only the site prefix ("commons" in this example) is displayed in the other language list. However, the link is correct.
- Use "Go" button to "Netzwerk" ("Network" in German) entry in English Wikipedia
- Search "Greasemonkey" in English Wikipedia
1.4 on 10/06/2012:
- Support https scheme.
1.3 on 03/03/2011:
- Update and bug fix for new Wikipedia structure.
1.2.4 on 05/28/2009:
- Use Firefox native JSON object, which is introduced in Firefox 3.5.
1.2.3 on 03/12/2009:
- Add an Object function to get all properties, which can be considered for general use.
1.2.2 on 03/11/2009:
- Fix bug in search term encoding function, which only replaces the first "+" to "_". Thanks to zanhsieh!
1.2.1 on 03/10/2009:
- Add encoding function to convert "+" to "_" (per Wikipedia rule).
1.2 on 03/09/2009:
- Add auto enter.
1.1 on 03/09/2009:
- Add language filter.
- Add intersect function to Array prototype, which can be considered for general use.
- Add comments.
1.0 on 03/07/2009:
- Initial version.