google-translate

R: google translate API (packages 'translate' & ''translateR')

孤街醉人 提交于 2019-12-04 21:47:41
I am trying to use the translate and translateR packages with R-Studio. I have created both a 'server' and 'browser' API key. The browser API works fine when running the example: https://www.googleapis.com/language/translate/v2?key=YOUR_API_KEY&q=hello%20world&source=en&target=de However, when using either API key and either package with R-Studio ( translate / translateR ), I obtain an error message. With translate > library(translate) > set.key("mykey") > translate('Hello, world!', 'en', 'de') Error in function (type, msg, asError = TRUE) : SSL certificate problem: unable to get local issuer

Is there any way for more than one Google Translate widget to be loaded on a page

半腔热情 提交于 2019-12-04 20:27:35
Is there any way possible to load a Google Translate widget in the sidebar and one in the footer, for example. Every way I've tried has only loaded so that both appear in the location of the first instance on the page. After a bit of tinkering I kinda felt obligated to solve the puzzle! You can skip to the good part by checking out the jsfiddle: (it works as of now but knowing google it might not tomorrow) http://jsfiddle.net/melfy/15zr6ov0/ Lets begin: First google translate is loaded and adds a listener for a select box it adds to the DOM after you call the right element but we need that

Using google Text-To-Speech (TTS) API on iOS

三世轮回 提交于 2019-12-04 12:19:52
I'm using the API with this code: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"file.mp3"]; NSString *text = textToTranslate; //@"You are one chromosome away from being a potato."; NSString *urlString = [NSString stringWithFormat:@"http://www.translate.google.com/translate_tts?tl=en&q=%@",text]; NSURL *url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

In need of an open source text language translation api [closed]

半城伤御伤魂 提交于 2019-12-04 12:02:36
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I have read other posts related to this but I haven't got anything concrete. I am developing an android app using phonegap which needs

translate url with google translate from python script

♀尐吖头ヾ 提交于 2019-12-04 11:52:39
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): ... urllib2.HTTPError: HTTP Error 403: Forbidden However the same URL works fine when accessed from

PyInstaller file fails to execute script - DistributionNotFound

亡梦爱人 提交于 2019-12-04 11:41:06
I'm trying to convert my python file to an executable using PyInstaller. The program uses the Google Cloud Translate API to translate given text between languages. When running python quicktrans.py in the terminal, the program works fine. Then I ran pyinstaller quicktrans.py , SHIFT + right-clicked the directory the executable was in, and ran the .exe file in the terminal. This is the traceback that it spit out (Note this is not the whole traceback because it is a little lengthy): File "c:\users\kalab\realpython\quicktrans\google\cloud\connection.py", line 31, in <module> get_distribution(

Implementing google translation api in swift 3 iOS

百般思念 提交于 2019-12-04 09:49:13
Hi i am new to iOS development and i am trying to implement google translation API within my app. I found some sample code online from GitHub https://github.com/prine/ROGoogleTranslate . I downloaded the sample code and followed the instructions provided by obtaining an api key from google cloud translate and placing it within the code however the code is not working, iv looked at the comments on the GitHub site and found that it has worked for other developers. I really don't know what i am doing wrong in the code. ROGoogleTranslateParams.swift import Foundation public struct

Only get single translation from Google Translate API

ぐ巨炮叔叔 提交于 2019-12-04 05:03:13
问题 So I'm using the Google Translate API in PHP as explained in the documentation... require 'vendor/autoload.php'; putenv('GOOGLE_APPLICATION_CREDENTIALS=src/i18n-php/credential.json'); use Google\Cloud\Translate\TranslateClient; $g_tr = new TranslateClient([ 'projectId' => 'my-project' ]); $source_language = "en"; $target_language = "de"; $text_to_translate = "Last name"; $result = $g_tr->translate($text_to_translate, [ 'source' => $source_language, 'target' => $target_language, ]); echo

Translate Content in JavaScript an HTML with the Google Translate API

笑着哭i 提交于 2019-12-04 04:33:12
问题 I need to create a button that will be able to toggle the language of a page's content between French and English. How can I use the Google Translate API for this? 回答1: Does this help : <div id="google_translate_element"></div> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ // here is where you change the language pageLanguage: 'en' }, 'google_translate_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb

Google translate get current language

点点圈 提交于 2019-12-04 03:31:36
问题 After finding zero of anything to help me online.... I am using the current function for a multi language site: function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'en,es', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); } However I have no idea how to get the current language once a user changes it. I'm not sure if this is even possible. Basically I want to update to Spanish images