google-translate

Google Cloud Translate - 403 Forbidden Missing API key

我与影子孤独终老i 提交于 2020-01-03 04:58:10
问题 I have gone thru the Google cloud transalte API and decided to use Java platform for my application Based on the documents, tested the below code with required jar's. this code working fine in my eclipse Translate translate = TranslateOptions.getDefaultInstance().getService(); String name = rs.getString("name"); Translation translation1 = translate.translate(name); String TransalateName = translation1.getTranslatedText(); However when export this code into a jar and running in Shell script

Are there any APIs for programmatically translating text on the server-side?

a 夏天 提交于 2020-01-02 04:49:29
问题 I've looked at Google Translate but from what I can tell it only offers a client-side JavaScript API for freely translating text between languages. What I need to do is translate text on the server side in Java. Is there a library that makes it possible to do this for free with Google Translate? 回答1: Here is a Java API... http://code.google.com/p/google-api-translate-java/ and just for reference, a PHP implementation - http://code.google.com/p/gtranslate-api-php/ 回答2: There is nothing

translate url with google translate from python script

帅比萌擦擦* 提交于 2020-01-01 14:24:50
问题 I'm trying to use google translate from a python script: #!/usr/bin/env python from urllib2 import urlopen from urllib import urlencode base_url = "http://www.google.com/translate?" params = (('langpair','en|es'), ('u','http://asdf.com'),) url = base_url+urlencode(params) print "Encoded URL: %s" % url print urlopen(url).read() I'm getting the error 403 when I use it. # ./1.py Encoded URL: http://www.google.com/translate?langpair=en%7Ces&u=http%3A%2F%2Fasdf.com Traceback (most recent call last

Google Translate API Requests Limit

99封情书 提交于 2020-01-01 12:08:31
问题 I know the Google Translate API has a limit of 5,000 characters per request, but how many requests are allowed under a certain period of time? 回答1: It seems to be 100,000. Though this can be increased. (Refer discussion in the link) 回答2: With the (paid) google translate API v2, one can set different quotas, like a Per-User Limit, which throttles the maximum number of characters a user can send for translation / second. You can set this as low as you want, i.e. 10.0 characters/second/user.

How does google verify Android SHA1 fingerprints and packages?

三世轮回 提交于 2020-01-01 02:44:12
问题 I am trying to make my Google Translate API work but currently I can't find a way. This is how I have set things in Google Developer Console : I have set my SHA1 fingerprint with the debug certificates. And package name -"bg.webmap.wordy"(which is the actual name). When I try to make a call an "ipRefererBlocked" error is returned in JSON. But when I remove the fingerprint and package name, It works perfectly, but then everybody can use this key, so it is very insecure. So my problem is with

How to disable google translate original text tooltips

泪湿孤枕 提交于 2019-12-31 12:35:15
问题 I have used google translate as a language converter in my site but it displays annoying tool tips called 'Original text'. How do I disable this and any other better ideas/tools/apis to do this? Thanks. The code used is... <div id="google_translate_element"></div><script> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en' }, 'google_translate_element'); } </script><script src="http://translate.google.com/translate_a/element.js?cb

Temporary removal of HTML from string for Google Translate API to reduce cost

南笙酒味 提交于 2019-12-31 04:18:05
问题 I have to translate some details using a Google API which we're paying for. The details contain HTML, and Google charges for each character. I don't want to send the complete content, but only the English text instead, with the HTML removed. I can remove HTML tags and entities using PHP functions, but I have to place the English content back in the HTML tags after translation for proper display. It will also include CSS. Example: <strong>This is a test</strong><br />   <custom tag>This is a

Google Translate API always returning 'Daily Limit Exceeded'

一曲冷凌霜 提交于 2019-12-30 03:00:14
问题 I'm trying to get the google translate API up and running. On the getting started guide, it gives the following example: https://www.googleapis.com/language/translate/v2/detect?key={MyAppId}&q=google+translate+is+fast I just want to get this working for now, so I'm just trying to get it working view via a browser post, so I created a testing web application (screenshot): and grabbed the API key, replaced the sample URL's key with my API key. I get the following response: { "error": { "errors"

Javascript to set cookie

拥有回忆 提交于 2019-12-29 08:24:35
问题 I am trying to have a javascript set a cookie that tells Google Translate which language to set the page. I have tried this based on my browser's cookie when selecting a language. <script> $(document).ready(function(){ setcookie(“googtrans”, “/en/fr”, time()+3600, “/”, “www.example.com”); setcookie(“googtrans”, “/en/fr”, time()+3600, “/”, “.example.com”); }); </script> I am not very good with javascript and I get an unexpected token ILLEGAL, not sure what this means: <script>(function() {with

Request to Google Text-To-Speech API [closed]

故事扮演 提交于 2019-12-28 23:38:32
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I have this URL: http://translate.google.com/translate_tts?ie=utf-8&tl=en&q=Hello+world When I put it to the address bar in a browser and hit enter, I get mp3 file with synthesized speech saying "Hello world". Everything is correct. But now I have a link in HTML that redirects to this URL, like this: <a href=