Pages: 1
[img]http://img174.imageshack.us/img174/8711/apivj8.jpg[/img]
then click the check box then press "Generate API Key"
and then after clicking the generate..
you will see something like this
[img]http://i234.photobucket.com/albums/ee220/ezekielclarion/oyeha.jpg[/img]
it means that you are not log in.. hehe
you will need to sign up or log in, if you arleady have an accnt then log in
after logging in..
copy your api key at the first box..
[b]Step four:[/b]
put this code inside of your created file the "googletranslate"
[quote]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Google AJAX Language API - Language Translation</title>
<style type="text/css">
body {
color: black;
font-family: Arial, sans-serif;
font-size: small;
margin: 15px;
position: absolute;
top: 0px;
left: 0px;
}
form.query-box {
font-size: 15px;
margin-top : 0px;
margin-right : 0px;
margin-bottom : 4px;
margin-left : 0px;
width: 100%;
}
input.query-input {
padding-left : 2px;
margin-bottom : 4px;
width: 240px;
height: 100px;
border: 1px solid #BCCDF0;
background-color: #fffffe;
}
input.button {
float:right;
margin-top : -23px;
margin-left: -90px;
}
div#main {
width: 240px;
}
div#results {
padding-top: 20px;
width: 240px;
}
div#results_title {
color: lightgray;
font-weight: bold;
}
#results_body {
color: gray;
font-weight: bold;
font-size: 14px;
padding-left : 2px;
width: 240px;
height: 100px;
border: 1px solid #BCCDF0;
background-color: #fffffe;
}
#langpair {
background:#fffffe!important;
width:150px!important;
text-align:left;
}
</style>
<script src="http://www.google.com/jsapi?key=[b]API KEY HERE[/b]" type="text/javascript"></script>
</head>
<body>
<div id="main">
<form class="query-box" onsubmit="return submitChange();">
<select name="langpair" id="langpair">
<option value="ar|en">Arabic to English</option>
<option value="zh|en">Chinese to English</option>
<option value="zh-CN|zh-TW">Chinese(Simplified to Traditional)</option>
<option value="zh-TW|zh-CN">Chinese (Traditional to Simplified)</option>
<option value="nl|en">Dutch to English</option>
<option value="en|ar">English to Arabic</option>
<option value="en|zh-CN">English to Chinese(Simplified)</option>
<option value="en|zh-TW">English to Chinese(Traditional)</option>
<option value="en|nl">English to Dutch</option>
<option value="en|fr">English to French</option>
<option value="en|de">English to German</option>
<option value="en|it">English to Italian</option>
<option value="en|ja" selected="">English to Japanese</option>
<option value="en|ko">English to Korean</option>
<option value="en|pt-PT">English to Portuguese</option>
<option value="en|ru">English to Russian</option>
<option value="en|es">English to Spanish</option>
<option value="fr|en">French to English</option>
<option value="fr|de">French to German</option>
<option value="de|en">German to English</option>
<option value="de|fr">German to French</option>
<option value="it|en">Italian to English</option>
<option value="ja|en">Japanese to English</option>
<option value="ko|en">Korean to English</option>
<option value="pt|en">Portuguese to English</option>
<option value="ru|en">Russian to English</option>
</select>
<input class="button" type="submit" value="Translate"/><br><br>
<input class="query-input" id="source" type="text" autocomplete="off" value=""/>
</form><hr>
</div>
<div id="results">
<textarea id="results_body"></textarea>
</div>
<script type="text/javascript">
google.load("language", "1");
google.setOnLoadCallback(submitChange);
function submitChange() {
var value = document.getElementById('source').value;
var langpair = document.getElementById('langpair');
var pair = langpair.options[langpair.selectedIndex].value.split('|');
var src = pair[0];
var dest = pair[1];
google.language.translate(value, src, dest, translateResult);
return false;
}
function translateResult(result) {
var resultBody = document.getElementById("results_body");
if (result.translation) {
resultBody.innerHTML = result.translation;
} else {
resultBody.innerHTML = '';
}
}
function nrcIE(){
if (document.all){return false;}}
function nrcNS(e){
if(document.layers||(document.getElementById&&!document.all)){
if (e.which==2||e.which=
){
return false;}}}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=nrcNS;
}else{document.onmouseup=nrcNS;document.oncontextmenu=nrcIE;}
document.oncontextmenu=new Function("return false");
</script>
</body>[/quote]
then find the bolded part inside the code..
and change it with your own [b]api key[/b] the one that you generated..
then hit the save button..
then after that
paste this code inside the onload handler
[b]1[/b]
[quote]var code="<center><iframe style='FILTER: chroma(color=#FFFFFF)' allowtransparency='true' frameborder=0 width='300' height='300' scrolling='no' src=[b]GOOGLETRANSLATE.HTML URL[/b]></iframe></center>";
addBox("RIGHT","[color=#FF0000]Free Translator[/color]",code,"div_13","15");[/quote]
if the 1st code didn't work use this one
[b]2[/b]
[quote]var header="[color=#FF0000]Free Translator[/color]";
var code="<center><iframe style='FILTER: chroma(color=#FFFFFF)' allowtransparency='true' frameborder=0 width='300' height='300' scrolling='no' src=[b]GOOGLETRANSLATE.HTML URL[/b]></iframe></center>";
addBox(header,code,"custombox_879","right");[/quote]
then after pasting it in your onlaod handler
find the bolded part inside then change it with the url of your googletranslate.html
you can also chage the title if you want.. just chage the red part...
then hit the save button..
and that's it.. done!!
i hope you understand my tutorial
enjoy it!
bye bye..!
Last edited by ezekielclarion (2008-06-16 07:26:06)
tnx for sharing i'l try this
Last edited by ezekielclarion (2008-05-16 03:37:41)
do you have a public atp or something so that newbies and guests can try this one out....?
Pages: 1