google-translate

How to add flags to the google web translator?

青春壹個敷衍的年華 提交于 2019-12-24 03:31:04
问题 I am new to this Google web translator. I want to add flags in front of each language I am using here. Here is my code: <div id="google_translate_element"> </div> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'ar,de,en,fr,ru,zh-CN', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, multilanguagePage: true}, 'google_translate_element'); } </script> <script type="text/javascript"

Returning Translated Text from Google Translate Activity

流过昼夜 提交于 2019-12-23 18:04:09
问题 I have developed an Android application that launches a Google Translate Activity using the following code: ... Intent i = new Intent(); i.setAction(Intent.ACTION_VIEW); i.putExtra("key_text_input", "What time is it?"); i.putExtra("key_text_output", ""); i.putExtra("key_language_from", "en"); i.putExtra("key_language_to", "es"); i.putExtra("key_suggest_translation", ""); i.putExtra("key_from_floating_window", false); i.setComponent(new ComponentName("com.google.android.apps.translate", "com

automatic change text into other language + google translator

廉价感情. 提交于 2019-12-23 03:43:07
问题 In my PHP application there a new functionality I have to develop that is when user fill sign in form(html),whatever he/she put in "Name" field other two fileds i.e. "name in traditional Chinese" and "name in Chinese" should automatically filled. I want to know is it possible with google translator? if yes then please share with me code or example. 回答1: Assuming that you want the translations perfomed on the server side (PHP) you can use file_get_contents to fetch data from Google Translate

Google translator API using CURL post method

久未见 提交于 2019-12-22 13:12:49
问题 Did anyone have any experience in Google translator API v2 for translating HTML using PHP CURL on POST method? I have tried several codes and libraries from github, but none of them worded for me. What I have found is GET methods. Due to limitation for parsing data over GET or query string, I am unable to send large HTML data to translate. I am looking for a solution/snippets which can translate buffered data using using CURL 回答1: Here is my solution $handle = curl_init(); if (FALSE ===

Detect Google Website Translator change of language

匆匆过客 提交于 2019-12-22 10:57:23
问题 I'm using the Google Website Translator on my website to let the user translate the site on the fly. Using this code: function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'ar,de,el,en,es,fr,it,ja,ko,nl,ru,zh-CN', layout: google.translate.TranslateElement.FloatPosition.BOTTOM_RIGHT}, 'google_translate_element'); } This works great, only thing now is that I need to know which language the user has actually selected. I want to

node.js request encoding (google translate)

笑着哭i 提交于 2019-12-22 09:42:00
问题 I want use google translate api, so I made this node.js module. module.exports = function(sourceText,sourceLang,targetLang,callback) { var qst = qs.stringify({ client : 'gtx', sl : sourceLang, tl : targetLang, dt : 't', q : sourceText }); var options = { uri: 'http://translate.googleapis.com/translate_a/single?'+qst, }; request.get(options).on('response',function(response){ response.on('data',function(data){ console.log(data.toString('utf-8')); }); });.. I want mainly use translate japanese

how to create a button that plays a mp3 google tts

自作多情 提交于 2019-12-22 08:22:25
问题 i'm new here but i hope you can help me. i'm trying to create a button that plays the text to speech mp3 that google generates. i'm creating a translator, so, what i want is to do something like google translate is (in some way). i've tried with javascript and actionscript but i couldn't make it work. i have this javascript function: function audio () { // here i get the word that i want to hear texto = document.getElementById('txt-result-palabra').innerHTML; // now i get the language idioma

Exclude HTML tags when translating with Google Translate API

烈酒焚心 提交于 2019-12-21 14:36:15
问题 Currently I know that <span class="e;notranslate"e;> </span> is used to omit out text to translate between the span. I am looking out for sending content with HTML tag to Translate API and let it return without translating the tags. Is there anyway that tags could be omitted out before translating and putting them back when the JSON returns with the translated text or is there any syntax to exclude Translate API from translating the HTML tags? Doing some research before I decide to whether

Multiple Instances of Google Translate

99封情书 提交于 2019-12-21 04:19:13
问题 I'm trying to get multiple instances of Google Translation Drop Down to show up, but it seems it will only pick one to show up. Full Page Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Google Translate</title> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> <

What is the meaning of Google Translate query params?

廉价感情. 提交于 2019-12-21 03:45:13
问题 What is the meaning of all Google Translate query params? client:t sl:auto tl:sk hl:sk //language of the interface (default:en, you can try xx-bork or xx-hacker) dt:bd dt:ex dt:ld dt:md dt:qc dt:rw dt:rm dt:ss dt:t dt:at dt:sw ie:UTF-8 // encoding of the input (default: utf-8) oe:UTF-8 // encoding of the output, the results (default: utf-8) otf:1 srcrom:1 ssel:3 tsel:0 q:translate // query, what you type in the search box I already discovered some of them. 回答1: I'm developing an online