Extension:Live Translate

Live Translate is a simple extension that allows live translation of wiki pages using Google Translate. It also enables you to define a "dictionary" of certain words or phrases and their translations; any word or phrase in the original text found in the "dictionary" will be translated using that dictionary, instead of using Google Translate.

Feature overview

 * Live translation of page contents using Google Translate.
 * Ability to define translations of special words in-wiki that will then be left alone by Google Translate.

Installation
Once you have downloaded the code, place the LiveTranslate directory within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file:

After this you need to run MediaWiki's update script, which can be found at /maintenance/update.php.

Usage
Live Translate adds a "Translate" button to the top right-hand corner of wiki pages, together with a dropdown menu that allows you to select the target language. Hitting the "Translate" button will cause the text in the wiki page to be translated to the selected destination language within the browser (it will not modify the original source text in any way). The source language will be assumed to be the wiki's main language, unless the wiki page's name ends with a "/" and then a language code, e.g., "Main Page/de" - if that is the case, the wiki page's language will be assumed to be the one that corresponds to that language code.

After a user hits the "Translate" button, another button, "Show original", will appear, which if pressed will return the display to its original language.

Defining a translation dictionary
You can define a dictionary of "special words" for which you provide translations, and that will then be left alone by Google Translate. This dictionary is defined in a page within the wiki; by default the page is named "Live Translate Dictionary", but this name can be changed in LocalSettings.php. The contents of the page should be a list in CSV (comma-separated values) format, where the first row contains the set of relevant language codes, and the successive ones the translations. An example would be:

en, nl, de Hello world, Hallo wereld, Hallo welt Awesome, Geweldig, Große

Version 0.1
2010-12-x



Internationalization
Live Translate is fully internationalized. Translation of Live Translate messages is done through translatewiki.net. The translation for this extension can be found here. To add language values or change existing ones, you should create an account on translatewiki.net, then request permission from the administrators to translate a certain language or languages on this page (this is a very simple process). Once you have permission for a given language, you can log in and add or edit whatever messages you want to in that language.

Authors
Live Translate has been written by Jeroen De Dauw as WikiWorks consultant for Texas Instruments.