google-translate

Google Translate API - No Access Control Origin with Text to Speech

扶醉桌前 提交于 2019-11-29 15:02:34
I posted this question on SO to get Google Translate Text-To-Speech to work. Google Translate API text-to-speech: http requests forbidden I was told I needed a key and to enable billing. I've since done that. I know billing is enabled because, using their specified endpoint for words-only translations (not narrated speech) ( GET https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&q=Hello%20world ), I'm able to get a response both in DHC and in my application $.get : In my original question (above), I was told If I get an API key, I would no longer be

Python Google Translate API error

可紊 提交于 2019-11-29 15:01:02
I am very to new to python and trying to translate a bunch of keywords using google API. I have an excel file with 3000 keywords which are mix of english, spanish, german etc. Trying to translate everything to English. However, every time I run my code, I get error at different values. Sometimes, my code give error at 810th keyword while sometime it gives error at 1038 keyword. And I am not even editing the layout of the file. JSONDecodeError: Expecting value: line 1 column 1 (char 0) Below is my code: from googletrans import Translator import pandas import math import time df = pandas.read

Google Translate Activity not working anymore

℡╲_俬逩灬. 提交于 2019-11-29 14:55:41
问题 I wrote a program that invokes Google Translator android application via Intent.ACTION_VIEW . The problem is that invoking the Google Translator App does not work anymore, although it did once. The code is identical to the code given here: Returning Translated Text from Google Translate Activity (yes, I tried to replace my code by that code, the Google Translator App behaves as if it does not receive any data.) Currently I cannot specify the text and the two languages. The best I can do is to

Playing remote audio (from Google Translate) in HTML5 on a server

醉酒当歌 提交于 2019-11-29 13:57:18
I'm trying to use text-to-speech on a website using HTML5 and Google Translate. Getting speech from Google is as easy as a GET request to: http://translate.google.com/translate_tts?tl=en&q=hello In order to play that file I'm using the audio-tag: <audio id="speech" src="http://translate.google.com/translate_tts?tl=en&q=hello" controls="controls" autoplay="autoplay">Your browser does not support the audio element.</audio> That works perfectly when I try to open the html file locally using Chrome 11, but doesn't work at all when I open the html from my server... It just doesn't do anything (the

Google Website Translator Automatic Display Mode

∥☆過路亽.° 提交于 2019-11-29 13:39:05
I'm trying to include google website translator on my website. I want to use the automatic thing so the bar shows up if your browser language is different to the page language. Every time I select the automatic Display mode the code it gives me is for 'tabbed'. Can anybody tell me what i'm doing wrong or provide the right code? Thanks in advance. EDIT: <div id="google_translate_element"></div> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.FloatPosition.TOP_LEFT},

Javascript to set cookie

断了今生、忘了曾经 提交于 2019-11-29 12:56:15
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 (this[2]) {with (this[1]) {with (this[0]) {return function(event) {ccm_exitVersionList() };}}}})<

Google Translate isn't Hidden

梦想与她 提交于 2019-11-29 10:49:47
Having opted for the "Automatic" version of Google Translate Widget, I expected not to see the "Select Language" dropdown if my browser was the same language as the site. However, I see it all the time no matter what I set the html lang attribute to or what I set my browsers preferred language to. I have also noticed that it doesn't seem to make any difference whether the meta "google-translate-customization" tag is there or not, the widget is always in view. I'd like the site to just be translated if the users browser isn't set to English. Any advice would be appreciated. Code used:- In head:

“google translate” vs “translate api”

我只是一个虾纸丫 提交于 2019-11-29 07:50:41
I hear that the Translate API will be charged for, but what exactly prevents us form using the free Google Translate service here for free ? Otherwise put, what are the limitations of the free service? According to the link below, nothing prevents you. https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=es&dt=t&q=Hello Set your requests content-type to application/json and it fixes the weird formatting, I found the uri pattern after bashing around the google websites for a while. I wouldn't recommend translating the bible with it but I've done ~10k words this week without

Using DeepL API to translate text

倖福魔咒の 提交于 2019-11-29 07:02:21
问题 Is there any possibility to find out if the DeepL translator offers an API for the translation? Unfortunately I haven't found any information on this. Would like to implement this to an Excel script for auto translation. I've already tried it with Google (like https://translate.google.com/#en/es/Hello%20World) but DeepL seems more accurate. 回答1: There is a POST call that allows you get the translations, I don't know how many time this will be supported or it's times limitations but here it is

Python script to translate via google translate

岁酱吖の 提交于 2019-11-29 05:13:29
I'm trying to learn python, so I decided to write a script that could translate something using google translate. Till now I wrote this: import sys from BeautifulSoup import BeautifulSoup import urllib2 import urllib data = {'sl':'en','tl':'it','text':'word'} request = urllib2.Request('http://www.translate.google.com', urllib.urlencode(data)) request.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11') opener = urllib2.build_opener() feeddata = opener.open(request).read() #print feeddata soup = BeautifulSoup(feeddata) print soup