Languages

Pages

Wikipedia Language Changer: Language Change Utility for Wikipedia


/* How does it work ? */

This Greasemonkey script change language of Wikipedia quickly.

I know there are many links to other languages at bottom of sidebar. However, I has some problems.

  • Troublesome scrolling to bottom of page
  • Too many languages in sidebar

for these probrem, I have created Greasemonkey has following functions:

  • Add language link as tab into top of page
  • Show only languages frequently use as tab
  • Add language changer as drop-down list
  • Double-click to toggle language(next version support multiple-language)

/* Install */

This script already uploaded to Userscripts.org. So please install it from this pase.

wikipedia_language_changer.user.js

/* Settings */

There are 3 main functions:

  1. Language tab : Add tab into tab-bar have ‘main’, ‘note’ at top of page
  2. Language list : Add drop-down list. select to jump.
  3. Quick toggle : Double-click to toggle language

Configurable items

name description value type
enable enable/disable function. true or false Boolean
lang   a list of Wikipedia language codes Array(String)
tab.lang language as tab. If you don’t specify, it won’t show any language.    
list.lang language into drop-down list. If you don’t specify, it show all languages.    
label language label. You can choose format from “English”(name), “en”(code), “English [en]“(both). ‘name’, ‘code’ or ‘both’ String
default It use as default language when use quick toggle. Wikipedia language code String

Sample settings

// configurations
var cfg = {
	// lang tab
	tab: {
		// true or false
		enable: true,
		// lang code you want to show as tab
		// *** if you don't specify, it won't show any langs ***
		lang: ['ja', 'en', 'de'],
		// 'code', 'name' or 'both'
		label: 'name'
	},
	// lang drop-down list
	list: {
		enable: true,
		// lang code you want to show as drop-down list
		// *** if you don't specify, it will show all langs ***
		lang: [],
		label: 'both'
	},
	// quick toggle
	toggle: {
		enable: true,
		// if you don't specify, it will set first element of cfg.toggle.lang
		default: 'ja',
		// pair of toggle language
		lang: ['ja', 'en']
	}
};

/* Conclusion */

I have inspired by Google Language Code Changer. Recently, the chance that talk with foreign people via Skype chat was increased. So I appreciate Wikipedia. I wish this script make Wikipedia more useful.

The quality of code is not good. However, I enjoyed coding. I love JS.

enjoy Wikipedia ! Wink

8 Comments

Similar Posts:

    No posts.

Trackback URL:

Comments:

  1. Wayne says;
    22 Apr 2009 - 0:12

    It does not work with FEATURED ARTICLES!

  2. hi Wayne, thank you for using this.
    Well, which feature does not work?
    and please let me know Wikipedia page which you tested.

  3. Let’s say your favourite languages are English, German and Italian.

    It works with
    http://en.wikipedia.org/wiki/Age_of_Empires_(video_game)
    http://it.wikipedia.org/wiki/Age_of_Empires

    but on this site is the English link missing.
    http://de.wikipedia.org/wiki/Age_of_Empires

  4. I’ve fixed bug and uploaded new version (0.1.1) to Userscripts.org.
    http://userscripts.org/scripts/show/13457

    Please re-install it and try again.
    Thanks for reporting ;)

  5. how do we configure this? i click on my greasemonkey script manager but i dont see where i can change the options.

    i’d like to keep the languages dropdown but i’d like to replace japanese and german by just french.

    thanks, very nice script.

  6. Thanks for comment, louis :)

    Actual script doesn’t have graphical user interfaces.
    The configuration part is in the script installed to your Firefox.
    Please follow this steps:

    1. [Firefox menu] -> Tools -> Greasemonkey -> Manage User Scripts…
    (or [GM icon] -> Manage User Scripts…)
    2. (Firefox will open GM dialog)
    3. Select “Wikipedia Language Changer” from the listbox on the left side
    4. Click “Edit” button
    5. (Firefox will open the script using the default editor)
    6. Edit configuration part in the script using your editor
    7. Save & close the script

    After these steps, to reflect your configuration, it needs reloading Wikipedia page.
    No need to reboot your Firefox.

    P.S. I can’t promise, but I’d like to provide more friendly interface for these configuration.

  7. thanks lol. easily done. i love the internet and its iusers.

    thanks for improving the world.

  8. Yeah! I’m glad to hear your voice in here.
    You can see all my scripts in here: http://userscripts.org/users/28357/scripts

    Google Site Image is my recent favorite one ;)
    And now, I’m writing new script related Wikipedia.

Add a Comment