{"id":1895,"date":"2022-08-30T15:20:20","date_gmt":"2022-08-30T15:20:20","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/02\/problem-about-google-translate-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:20:20","modified_gmt":"2022-08-30T15:20:20","slug":"problem-about-google-translate-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-google-translate-collection-of-common-programming-errors\/","title":{"rendered":"problem about google-translate-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li>\n<img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/hui9i.jpg?s=32&amp;g=1\" \/><br \/>\nYury<br \/>\njava android google-api google-translate google-api-java-client<br \/>\nHow can I use Google Translate API and translate text in an android app? I tried this:http:\/\/code.google.com\/p\/google-api-translate-java\/but it doesn&#8217;t work. I have an Api Key too. My code is(according to official example):GoogleAPI.setHttpReferrer(&#8220;http:\/\/mysite.com&#8221;);GoogleAPI.setKey(&#8220;My Key&#8221;);String translatedText = Translate.DEFAULT.execute(&#8220;Bonjour le monde&#8221;, Language.FRENCH, Language.ENGLISH);I put this code in my main Activity but I get an error: &#8220;Unhandled exception type GoogleAPIExcepti<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f7a09738c4af3c0583719c7ba91b47b8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSqu36<br \/>\njquery jsonp google-translate<br \/>\nI&#8217;m currently developping a GreaseMonkey user script to provide a direct translation of some form fields inside an Intranet App.Everything goes OK until I call Google Translation API using this code :var apiurl = &#8216;https:\/\/ajax.googleapis.com\/ajax\/services\/language\/translate?v=1.0&amp;langpair=fr%7Cen&amp;q=&#8217;; $.getJSON(apiurl+encodeURIComponent(text)+&#8221;&amp;callback=?&#8221;,function(data){alert(&#8216;Translation Complete&#8217;);\/\/Change text });Here are my problems : I&#8217;m forced to use JSONP as this is a Cross-D<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/69e090710d2a4303aeb8151a5c1f90d7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntnorthcutt<br \/>\nmulti-language google-translate accessibility<br \/>\nI am aware of the question What are options are there to implement a multi language site, but the answers there are focused on multi-language support on the backend as well as the frontend. I am only concerned with offering multi-language viewing of a site&#8217;s content, not multi-language content creation.Could it be as simple as putting the Google Translate Tools code on my site? I see that there are at least a couple of plugins that offer this functionality &#8211; anyone have experience with those?<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e070f2eed033fd3ebc7c4be4f0a878e1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nphucloi89<br \/>\nandroid google-translate<br \/>\nI want to create a translate app in Android,i use Google Translate API,but it has error,please help me for fix it. This is my codepublic void onClick(View v) {\/\/ TODO Auto-generated method stubString InputString;String OutputString = null;InputString = InputText.getText().toString();try {Translate.setHttpReferrer(&#8220;http:\/\/translate.google.com.vn\/&#8221;);OutputString = Translate.DEFAULT.execute(InputString, Language.ENGLISH, Language.VIETNAMESE); \/\/\/\/\/\/\/\/} catch (Exception ex) {ex.printStackTrace();<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ecc551c79dd471426528a8399b84eac3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlionel b<br \/>\njavascript asynchronous concurrency google-translate<br \/>\nI&#8217;m trying to write a script that will allow me to quickly examine how a word changes when translated multiple times by Google translate. Unfortunately, I&#8217;m not very experienced with Javascript and I can&#8217;t pin down the source of the problem I&#8217;m having:function initialize() {var word = &#8220;Hello&#8221;;var english = [word];var german = [];document.write(&#8220;1&#8221;);var i = 0;for (i=0; i&lt;10; i++) {google.language.translate(english[i], &#8216;en&#8217;, &#8216;de&#8217;, function(result) {if (!result.error) {german.push(result.transl<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1dc604233d8a0c48f0884769acb1fb93?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAndreas_D<br \/>\njava google-translate<br \/>\nI need an example to convert Spanish language to English language using Google Translation API. I tried with the following code. It gives some exception. can someone help me on the same.Code : import com.google.api.translate.*; public class GoogleTranslator {\/*** @param args*\/@SuppressWarnings(&#8220;deprecation&#8221;)public static void main(String[] args) {\/\/ TODO code application logic heretry {Translate.setHttpReferrer(&#8220;sp-en&#8221;);String translatedText = Translate.translate(&#8220;Hola mundo&#8221;, Language.SPANISH<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d5f91983a9d9cfb69981b6108a63b412?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nskaffman<br \/>\njava google-translate<br \/>\nHow can i convert language in my Java? Is there any API exist, which convert any language to any other language? I am using Google Translate API, but it giving me below exception.java.lang.Exception: [google-api-translate-java] Error retrieving translation. at com.google.api.GoogleAPI.retrieveJSON(GoogleAPI.java:123) at com.google.api.translate.Translate.execute(Translate.java:69) at com.nextenders.client.beans.ruleengine.RuleEngineTest.main(RuleEngineTest.java:27) Caused by: java.net.ConnectExc<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bade22f3ef898da4e933664f1ad06f15?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRadicz<br \/>\nc# google-translate webclient-download<br \/>\nI would like to ask for advice. I have a method where I send translate.google a string of text to be translated. The method is called through the BackgroundWorker. The problem is that on some computers it works without problems, but on some computers fail me DownloadData. An exception only reports an unknown error. I&#8217;m sorry for my English. Thanks for any advice.private string translateCleanString(string cleanText){UnicodeEncoding enc = new UnicodeEncoding();string url = string.Format(&#8220;http:\/\/ww<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-12-02 21:13:38. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Yury java android google-api google-translate google-api-java-client How can I use Google Translate API and translate text in an android app? I tried this:http:\/\/code.google.com\/p\/google-api-translate-java\/but it doesn&#8217;t work. I have an Api Key too. My code is(according to official example):GoogleAPI.setHttpReferrer(&#8220;http:\/\/mysite.com&#8221;);GoogleAPI.setKey(&#8220;My Key&#8221;);String translatedText = Translate.DEFAULT.execute(&#8220;Bonjour le monde&#8221;, Language.FRENCH, Language.ENGLISH);I put this code in my main Activity but I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1895","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1895","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1895"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1895\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1895"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1895"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1895"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}