Home
Flashcards
Absolute Recall™ Web Reader Course Management
Log In
English 
WordChamp Help WordChamp Reader API Documentation
Help Features
WordChamp Reader API Documentation beta
Summary
The WordChamp Reader API is a JavaScript-based API that lets you set up your own web page to automatically use the WordChamp Web Reader.
Quickstart
To get started, follow these steps:
1.In the header, include the script element:
<script type="text/javascript" src="http://www.wordchamp.com/lingua2/js_prod/5418a132335839c87c676244996357ad.js"></script>
2.After the page gets loaded call the methods to set up the WordChamp Reader. This example sets up a function in the header which is called after the body gets loaded.
<head>
<script type="text/javascript">
<!--
function enableWordChampReader() {
    WORDCHAMP.init("0163bfda16a68085bfc89b71ef09fe9bdf851592","http://www.wordchamp.com/lingua2/flash_prod/3408923af5dbc917fd9efcd007552146.swf");
    WORDCHAMP.setLanguages(WORDCHAMP.ENGLISH,WORDCHAMP.SPANISH);
    WORDCHAMP.prepareForReader();
}
//-->
</script>
</head>
<body onload="enableWordChampReader()">
...
</body>
3.Call WORDCHAMP.init() with the access code you received for your site during registration and the path to the linguapi.swf that you downloaded from wordchamp.com.
4.Call WORDCHAMP.setLanguages() with the language ID for the language of the site and the translation target language.
5.Call WORDCHAMP.prepareForReader() to setup the web page for WordChamp Reader.
6.More class methods and constants for WordChamp Reader API are listed below.
Methods
WORDCHAMP.init — Initializes the WordChamp Reader.
WORDCHAMP.prepareForReader — Sets the region of the web page on which the WordChamp Reader is enabled.
WORDCHAMP.enableReader — Enables and disables the WordChamp Reader.
WORDCHAMP.setLanguages — Sets the default source and target languages for the page. The source language is the language of the web page, the target language is the language in which the Reader will deliver definitions.
WORDCHAMP.setFromLanguageID — Sets the default language of the web page.
WORDCHAMP.setToLanguageID — Sets the target language (i.e., the language to which the Reader translates).
WORDCHAMP.createToLanguageMenu — Creates a drop-down menu to allow readers to select the translation target language.
Description
WORDCHAMP.init(accessCode,swfFileLocation)
Parameter Type Description Required
accessCodeStringThe code you received when you registered for the WordChamp Reader API.yes
swfFileLocationStringThe path on your server to the flash audio player downloaded from WordChamp. Unfortunately, due to security restrictions in Microsoft Internet Explorer, it is not possible for us to use the Flash application on our servers when running from your website.yes
Example
WORDCHAMP.init("0163bfda16a68085bfc89b71ef09fe9bdf851592","http://www.wordchamp.com/lingua2/flash_prod/3408923af5dbc917fd9efcd007552146.swf");
Must be the first method called. It establishes the WordChamp Reader API internals.
WORDCHAMP.prepareForReader(nodeID,fromLanguageID)
Parameter Type Description Required
nodeIdStringThe id attribute of the HTML element node that should have the Reader translations.no
fromLanguageIDIntegerThe language ID that correspond to the language.no
Example
WORDCHAMP.prepareForReader("spanSpanish",WORDCHAMP.SPANISH);
<span id="spanSpanish">Su taza de cafe.</span>
If the parameters are left out, then the whole page is enabled for WordChamp Reader translations.
WORDCHAMP.prepareForReader();
WORDCHAMP.enableReader(enable)
Parameter Type Description Required
enableBooleantrue to enable, and false to disable translations. When disabled, there will no translation popups.yes
Example
WORDCHAMP.enableReader(true);
WORDCHAMP.setLanguages(fromLanguageID,toLanguageID)
Parameter Type Description Required
fromLanguageID Integer Index of the language that is the default source language of the web page. yes
toLanguageID Integer Index of the language that is the default translation target language. yes
Example
WORDCHAMP.setLanguages(WORDCHAMP.ENGLISH,WORDCHAMP.SPANISH);
Text on the page is translated from English to Spanish as a default. The fromLanguageID is overridden by the language setting in the function WORDCHAMP.prepareForReader() for the section specified by that function.
WORDCHAMP.setFromLanguageID(fromLanguageID)
Parameter Type Description Required
fromLanguageID Integer Index of the language that is the default source language of the web page. yes
Example
WORDCHAMP.setFromLanguageID(WORDCHAMP.ENGLISH);
Text on the page is translated from English. The fromLanguageID ist overridden by the language setting in the function WORDCHAMP.prepareForReader() for the section specified by that function.
WORDCHAMP.setToLanguageID(toLanguageID)
Parameter Type Description Required
toLanguageID Integer Index of the language that is the default translation target language. yes
Example
WORDCHAMP.setToLanguageID(WORDCHAMP.SPANISH);
Text on the page is translated to Spanish. This can be overridden by user selection of the target language set up by the method WORDCHAMP.createToLanguageMenu().
Language Constants
WORDCHAMP.AFRIKAANS
WORDCHAMP.ALBANIAN
WORDCHAMP.AMHARIC
WORDCHAMP.ARABIC
WORDCHAMP.ARMENIAN
WORDCHAMP.ASSAMESE
WORDCHAMP.AYMARA
WORDCHAMP.AZERI
WORDCHAMP.BALUCHI
WORDCHAMP.BASHKIR
WORDCHAMP.BASQUE
WORDCHAMP.BENGALI
WORDCHAMP.BHOJPURI
WORDCHAMP.BOSNIAN
WORDCHAMP.BRETON
WORDCHAMP.BRIJ
WORDCHAMP.BULGARIAN
WORDCHAMP.BURMESE
WORDCHAMP.BYELORUSSIAN
WORDCHAMP.CATALAN
WORDCHAMP.CHEROKEE
WORDCHAMP.CHINESE_CANTONESE
WORDCHAMP.CHINESE_MANDARIN
WORDCHAMP.CREOLE
WORDCHAMP.CROATIAN
WORDCHAMP.CZECH
WORDCHAMP.DANISH
WORDCHAMP.DARI
WORDCHAMP.DENA'INA
WORDCHAMP.DOGRI
WORDCHAMP.DUTCH
WORDCHAMP.ENGLISH
WORDCHAMP.ESPERANTO
WORDCHAMP.ESTONIAN
WORDCHAMP.FARSI
WORDCHAMP.FINNISH
WORDCHAMP.FLEMISH
WORDCHAMP.FRENCH
WORDCHAMP.FRISIAN
WORDCHAMP.FUR
WORDCHAMP.GAELIC
WORDCHAMP.GEORGIAN
WORDCHAMP.GERMAN
WORDCHAMP.GREEK
WORDCHAMP.GUJARATI
WORDCHAMP.HAUSA
WORDCHAMP.HAWAIIAN
WORDCHAMP.HEBREW
WORDCHAMP.HINDI
WORDCHAMP.HMONG
WORDCHAMP.HUNGARIAN
WORDCHAMP.ICELANDIC
WORDCHAMP.IGBO
WORDCHAMP.INDONESIAN
WORDCHAMP.INTERLINGUA
WORDCHAMP.IRISH
WORDCHAMP.ITALIAN
WORDCHAMP.JAPANESE
WORDCHAMP.JAVANESE
WORDCHAMP.JUDEOSPANISH
WORDCHAMP.KANNADA
WORDCHAMP.KANNAUJI
WORDCHAMP.KASHMIRI
WORDCHAMP.KAZAKH
WORDCHAMP.KHMER
WORDCHAMP.KINYARWANDA
WORDCHAMP.KLINGON
WORDCHAMP.KONKANI
WORDCHAMP.KOREAN
WORDCHAMP.KURDISH
WORDCHAMP.KYRGYZ
WORDCHAMP.LAKOTA
WORDCHAMP.LAOTIAN
WORDCHAMP.LATIN
WORDCHAMP.LATVIAN
WORDCHAMP.LITHUANIAN
WORDCHAMP.MAITHILI
WORDCHAMP.MALAGASY
WORDCHAMP.MALAY
WORDCHAMP.MALAYALAM
WORDCHAMP.MALTESE
WORDCHAMP.MANIPURI
WORDCHAMP.MAORI
WORDCHAMP.MARATHI
WORDCHAMP.MIZO
WORDCHAMP.MONGOLIAN
WORDCHAMP.NEPALI
WORDCHAMP.NORWEGIAN
WORDCHAMP.ORIYA
WORDCHAMP.OTHER
WORDCHAMP.PAPIAMENTO
WORDCHAMP.PASHTO
WORDCHAMP.POLISH
WORDCHAMP.PORTUGUESE
WORDCHAMP.PUNJABI
WORDCHAMP.QUECHUA
WORDCHAMP.ROMANIAN
WORDCHAMP.RUSSIAN
WORDCHAMP.SANSKRIT
WORDCHAMP.SERBIAN
WORDCHAMP.SHONA
WORDCHAMP.SINDHI
WORDCHAMP.SINHALESE
WORDCHAMP.SLOVAK
WORDCHAMP.SLOVENIAN
WORDCHAMP.SOMALI
WORDCHAMP.SOTHO
WORDCHAMP.SPANISH
WORDCHAMP.SWAHILI
WORDCHAMP.SWAZI
WORDCHAMP.SWEDISH
WORDCHAMP.TAGALOG
WORDCHAMP.TAIWANESE
WORDCHAMP.TAJIK
WORDCHAMP.TAMIL
WORDCHAMP.TATAR
WORDCHAMP.TELUGU
WORDCHAMP.THAI
WORDCHAMP.TIBETAN
WORDCHAMP.TSONGA
WORDCHAMP.TSWANA
WORDCHAMP.TURKISH
WORDCHAMP.TURKMEN
WORDCHAMP.TWI
WORDCHAMP.UKRAINIAN
WORDCHAMP.URDU
WORDCHAMP.UZBEK
WORDCHAMP.VENDA
WORDCHAMP.VIETNAMESE
WORDCHAMP.WELSH
WORDCHAMP.XHOSA
WORDCHAMP.YIDDISH
WORDCHAMP.YORUBA
WORDCHAMP.ZULU
government  |  testimonials  |  about us  |  contact us  |  links student safety  |  privacy policy  |  terms and conditions  |  copyright policy
Verb charts:    English  |  French  |  German  |  Italian  |  Spanish
© 2004-2011, GlobaLinguist, Inc. All rights reserved. Patent(s) pending.
Some images © 2011, iCLIPART.com.
WordChamp uses Japanese/English translations from the JMDICT file and Chinese/English translations from the CEDICT file
"WordChamp" is a registered trademark of GlobaLinguist, Inc.