|
Project Information
Featured
Downloads
Links
|
Two javascript files (dictionarylookup20.js and dictionarylookup20a.js), when integrated with your website, allow Google translation to happen by pointing the cursor over the word (or selected text) in a webpage and then hitting the SHIFT key. A popup window happens with the Google translation of your word (or less than 500 characters of selected text). Wikipedia lookup can happen as well by clicking on the Wikipedia? link in the popup. See instructions at the top of dictionarylookup20.js for how to integrate this javascript file into your website. This 12k file needs to be included and a certain type of link set (to start the effect). When the link is clicked an 80k javascript file (dictionarylookup20a.js) is dynamically loaded, which actually does the effect. You need to get your own Google API key (version 2) to run the software. Log onto code.google.com to register for this key. It is a long character string. The project has recently been changed to support Google language API key (version 2), which is commercial. You will now need to provide a credit/debit card number and pay (currently) $20 per million characters of translation. If your average translation is a word of 10 characters you would pay $20 per 100,000 requests, a good bargain. This commercial aspect of the language API now removes any legal problems with commercial enterprises (like newspapers) using GoogleTrans. You will need to edit the dictionarylookup20a.js javascript file to place in the V2 Google API key. Look for the 'GoogleAPIKeyV2' variable and place your API key there as a character string. Please remember that in the API ACCESS subsection of your Google API Console (at code.google.com) that you will need to place your domain name of the webpages supporting Googletrans. This will restrict use of your API key to your own domain so that other people will not be able to use it in their own webpages. I have also found that editing the list of refering websites does not work. Sometimes, when you wish to add a website to the list of acceptable URLs, from which GoogleTrans can work, you may have to create a new browser ACCESS key. You can have more than one browser app access key. Works on IE, Firefox, Opera, Chrome and Safari. User can change language translated to, if he wishes, by clicking on link in your webpage, or in the Language link at the top of the popup window. dictionarylookup20.js and dictionarylookup20a.js are all that is necessary to enable your own website with the cursor hover effect. In addition A Perl script (/cgi-bin/dictafy20.cgi)(and an introductory webpage: /cgi-bin/dictionary20.cgi) allow this to happen to most websites on the web. Call the Perl script with the webpage you wish hover translate behavior to happen on and the Perl script will read the website, change all links in it to point to the Perl script, inject the two javascript files within the website and present the website to the user. The user can effectively surf the web with dictionary lookup/Wikipedia lookup happening on all webpages. If you wish to use the dictafy20.cgi Perl script on your system there are some Perl variables to set at the top of this script. Dictionary20.cgi also has a hard coded html domain names that needs to be changed (probably by a global change command). A simple introduction page for this is provided as another Perl script: dictionary20.cgi If you are an online newspaper or magazine who wishes to allow your readers to make very quick Wikipedia Lookups, via GoogleTrans, please contact the author Paul: paul@securecottage.com. I think all online newspapers and magazines should have quick Wikipedia Lookup and that this increases the pleasure of reading the article when identities and corporations biops can quickly be looked up this way. I am willing to work with any newspaper/magazine willing to put up Wikipedia Lookup via cursor hover. |