473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

help me with one google translate question

1
hi there,

I have one big problem with my translator site. It works great since 1 month ago... Now, I have a problem with it, everything I wrote, they say 'error translating'. I think that google modify some things on APIs...

So, my problem:

I have this code:

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT type="text/javascript" src="http://www.google.com/jsapi"></SCRIPT>
  2. <SCRIPT type="text/javascript">
  3. google.loader.ApiKey='ABQIAAAAnvi2UVNIq_80BAVD4Y4FGBRnHh2_6MU_2gGD9TKVUdKuJciOfRTwWuHk5M_Vqv-4A948HHgFTnsL6Q';
  4. google.load('language','1');
  5. google.setOnLoadCallback(init);
  6. function init()
  7.     {
  8.     document.getElementById('done').disabled=true;
  9. }
  10. function del()
  11.     {
  12.     document.getElementById('text').value='';
  13.     document.getElementById('done').value='';
  14. }
  15. function SubmitKey(text)
  16.     {
  17.     text=text.substring(0,512);
  18.     var src=document.getElementById('src').value;
  19.     var dst=document.getElementById('dst').value;
  20.     document.getElementById('done').disabled=false;
  21.     google.language.translate(text,src,dst,function(res)
  22.         {
  23.         if(!res.error) 
  24.         document.getElementById("done").value=res.translation;
  25.         else 
  26.         document.getElementById("done").value='Error Translating';
  27.     }
  28.     )
  29. }</SCRIPT>
  30.  
  31.  
  32.  <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true&amp;key=ABQIAAAAOjTDkgSN4mqLWcSGv01YxRROwYgObTE6AqUp4nNCDsyrn4uqmhT9GaAxxiKKIISBj-9Gm7tlemyC6Q" type="text/javascript"></script>
  33.  
  34.     <script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0" type="text/javascript"></script>
  35.  
  36.     <script src="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type="text/javascript"></script>
  37.  
  38.     <script type="text/javascript">
  39.  
  40.     function initialize() {
  41.       if (GBrowserIsCompatible()) {
  42.  
  43.         // Create and Center a Map
  44.         var map = new GMap2(document.getElementById("map_canvas"));
  45.         map.setCenter(new GLatLng(37.4419, -122.1419), 13);
  46.         map.addControl(new GLargeMapControl());
  47.         map.addControl(new GMapTypeControl());
  48.  
  49.         // bind a search control to the map, suppress result list
  50.         map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHt new GSize(10,20)));
  51.       }
  52.     }
  53.     GSearch.setOnLoadCallback(initialize);
  54.  
  55.     </script>
  56.   <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script>


and in body:

Expand|Select|Wrap|Line Numbers
  1. <strong>Original text</strong><br>
  2.             <textarea onkeyup="SubmitKey(this.value)" id="text" name="textarea"></textarea>
  3.                 <br>
  4.             <strong>Language Translator:</strong> 
  5.             <select  id="src" onchange="SubmitKey(document.getElementById('text').value)" name="select">
  6.  
  7.               <option value="sq">Albanian</option>
  8.               <option value="ar">Arabic</option>
  9.               <option value="bg">Bulgarian</option>
  10.               <option value="ca">Catalan</option>
  11.  
  12.  
  13.  
  14.             </select>
  15.  
  16.             </td>
  17.  
  18. <td valign="center" width="10%">
  19.  
  20.  
  21.  
  22. </td>
  23. <td align="center" width="45%">
  24. <strong>Translation</strong><br>
  25. <textarea id="done" disabled="disabled" name="textarea2"></textarea><br>
  26. <strong>In language:</strong> 
  27. <select id="dst" onchange="SubmitKey(document.getElementById('text').value)" name="select">
  28.  
  29.               <option value="sq">Albanian</option>
  30.               <option value="ar">Arabic</option>
  31.               <option value="bg">Bulgarian</option>
  32.             </select>
  33.  
anything I write, script say: 'error translating'

you can see online demo from my site at: translatorul.net/translator_en.php

Thanx alot
Dec 20 '11 #1
0 1261

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
9
by: soup_or_power | last post by:
Sorry these are not c++ questions per se. Your help is appreciated. Suppose arr is an array (e.g. int arr) Here are some questions: a)What does arr point to? My answer: to the first element of...
7
by: brian_dell4 | last post by:
x-no-archive: yes 1) How to hide a url when mouse is kept over the url Hyperlink ? 2) How to hide the url details on the address bar ? ie when user visits different urls the http links on the...
8
by: twoeyedhuman1111 | last post by:
Okay, I have this sample code: class a; class b; class b { public: private:
1
by: Michael J. Savage | last post by:
Hi All, I posted yesterday re appending a table to another but it seems I was asking the wrong question. What I'm trying to do is open a client information table and, with a click of a...
1
by: Gena | last post by:
Hi , I'm a newbe to programming and have a small question: I made a small program with a class. in the class's header file I have : double *ptr_output; Void main() { double result;
2
by: carly | last post by:
Hi......i need some help with this C program. I have created a array called "data" of 100 integers, im just having problems with writing the funtion call that will sort the 100 elements data through...
1
by: janicerby98 | last post by:
Could someone help me with this math problem? I am not too familiar with the consept of math, and could use some help. Find two consecutive positive integers such that the sum of their square is 85....
6
by: pagina21 | last post by:
I am a true beginner in Access and coding. I am creating a database with facility information and I want to use the address of a specific facility to display a map on my form or at least open a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.