google-translate

How to translate specific content in website

落爺英雄遲暮 提交于 2019-12-11 08:56:44
问题 I'm wondering if there is a way to use google translation, or any other app/widget/way to programaticaly embed translation into a website to help translating specific content (not general all site translation): Example: I have one form input element with a value in english, and want to translate only that value to French, and insert it into a specific html element and then send that info in a form. <!DOCTYPE html> <html> <body> <input type="text" id="origin" value="Some text in English"/>

google tts with paid account

爱⌒轻易说出口 提交于 2019-12-11 06:49:23
问题 You now have to pay to use the google translate api. I'm happy to pay for the service but I can't find a way to use the tts. This is what I'm doing var GoogleTranslate = function(){ var key = "myapikey" this.speak = function(words) { var url = "http://translate.google.com/translate_tts?tl=es&q=" + escape(words) + "&key=" + key new Audio(url).play(); } } but when I do new GoogleTranslate().speak("hola") The requests to http://translate.google.com/translate_tts never return a response. How do I

Can't return to default language with Google Translate in javascript

风格不统一 提交于 2019-12-11 05:19:44
问题 i have a code uses google-translate and jquery.cookie to translate all page to other language: $(document).ready(function () { var googTrans = $.cookie('googtrans'); if (googTrans === '/es/en') { //Paint specific flag var src = $('.lang-change img').attr('src').replace('flag_en.png', 'flag_es.gif'); $('.lang-change img').attr('src', src); $('#lang-change-en').attr('id', 'lang-change-es'); } $(".lang-change").on("click",function(){ if (googTrans == '/es/en') { //If language is english return

Missing a valid API key about Google Translation API Client issue?

筅森魡賤 提交于 2019-12-11 03:54:38
问题 I follow the https://cloud.google.com/translate/docs/reference/libraries#client-libraries-usage-java to get started java client demo. I have already set authentication json file to the environment variable GOOGLE_APPLICATION_CREDENTIALS . However, I got the translateException when I run java sample code. Exception in thread "main" com.google.cloud.translate.TranslateException: The request is missing a valid API key. at com.google.cloud.translate.spi.v2.HttpTranslateRpc.translate

How to use Google public API access key in android application?

扶醉桌前 提交于 2019-12-11 03:28:47
问题 I want to use Google Translate API (v2) in my android application. What I did: created project in Google Developers Console set up billing for this project generated 2 public api access keys for android applications: a. First one that accepts request from any application b. Second one that accepts requests from my application only I tried to translate text from the application via https://www.googleapis.com/language/translate/v2?key=MY-KEY&target=de&q=Hello%20world It works fine with the key

How to trigger the listen button on the Google-translate page using javascript?

天涯浪子 提交于 2019-12-11 00:19:01
问题 I want to add shortcuts to the Google-translate page. Press Alt c or Esc to clear the textarea ; press Alt j to pronounce. This is the current user script: userscripts.org/scripts/review/110928 I do not know how to trigger the listen button on that page. I tried: var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); var cb = document.getElementById("gt-src-listen"); cb.dispatchEvent(evt); but it does

jQuery translate + toggle, how to link the two?

好久不见. 提交于 2019-12-10 23:34:35
问题 I'm currently working on a jQuery script that will translate the site's text into a foreign language . I'm utilizing Google Translate API for this. I would like the page to include a link that says En Espanol and when the user clicks on En Espanol, the body of the page gets translated into Spanish with the exception of that link which says In English - when the user clicks on that link, the body of the page will revert back to English. The following code below is what I have so far. Any help

google translate not showing up when https is used in url

十年热恋 提交于 2019-12-10 20:38:59
问题 For some reason when you go to the url https://www.improvementskills.org/index.cfm google translate does not show up, but when you go to http://www.improvementskills.org/index.cfm it works fine. So I know the issue is with SSL and having https. Does anyone know what the problem is and how to fix it. Thanks! 回答1: You are loading Google's JavaScript with an http URL, even when your page is served with https . The browser rejects that, because it's insecure to include non- https content in an

How to use Google translate API from code

守給你的承諾、 提交于 2019-12-10 19:51:38
问题 I am trying to create an app that send a word to translate.google.com , take the result of the translation and display it to the user. I composed the URL but I do not know how to extract the word/phrase from the webpage. Example pseudo: en is code for english and es is code for spanish String from = "en"; String to = "es"; String word = "hello"; //this will be user input text really String URL = "http://www.translate.google.com/#" + from + "/" + to + "/" + word; Therefore the request URL will

Is this possible to set the language in tinymce editor in javascript?

怎甘沉沦 提交于 2019-12-10 17:32:59
问题 I have using tinymce text edit for my asp.net applications.Now i have added language pack.now i want to set the language pack for the text editor programatically.And also hide the language pack bar from the visible state. for example : i want to programatically set the language of the text editior is hindi.Pleasr guide me to get out of this... whenever user clicks translation Button in my web form , i have initialized this string variable.then i want to set the tinymce editor language