google-translate

Javascript/Jquery call Google Translate on button click (with flags) [closed]

丶灬走出姿态 提交于 2019-12-02 18:03:23
问题 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 last year . Is there any good example where I can use Google Translate for translations inside html page? I mean, if I click on german flag (button) than translate to german etc... My question is how to simulate this combo box for specific languages? https://www.w3schools.com/howto/howto_google_translate.asp Thanks 回答1: You

Javascript/Jquery call Google Translate on button click (with flags) [closed]

試著忘記壹切 提交于 2019-12-02 08:33:17
Is there any good example where I can use Google Translate for translations inside html page? I mean, if I click on german flag (button) than translate to german etc... My question is how to simulate this combo box for specific languages? https://www.w3schools.com/howto/howto_google_translate.asp Thanks You can hide this auto-created selection-field and set it's value dynamically by iterating over each option-field to search for the desired language that you can choose via an input-field. Hope this helps: <!DOCTYPE html> <html lang="en-US"> <body> <h1>My Web Page</h1> <p>Hello everybody!</p>

How can I use Google Translate via Ajax using jQuery?

╄→гoц情女王★ 提交于 2019-12-02 07:09:41
问题 I am using Ajax via jQuery, and I am trying to translate using the Google Translate Service. The service does not seem to work for me. What am I doing wrong? How would I go about using this in my web application? 回答1: You can do it like this: $.ajax({ url: 'https://ajax.googleapis.com/ajax/services/language/translate', dataType: 'jsonp', data: { q: 'Hello world!', // text to translate v: '1.0', langpair: 'en|es' }, // '|es' for auto-detect success: function(result) { alert(result.responseData

How can I use Google Translate API to Translate text in Microsoft Excel

半世苍凉 提交于 2019-12-02 06:05:59
问题 I am hoping someone here can help me with the google translator API. I have an excel file with about 80k rows, and I am trying to build a macro where it translates everything in a column except for the first row. As an example I have six columns in Microsoft Excel such as the below Excel Column Headers Column A = Name Column B = Address Column C = Phone Number Column D = Request Column E = Google Translated Request Column F = Notes and I want to use the google translator API to take what is

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

為{幸葍}努か 提交于 2019-12-02 03:49:35
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 test</custom tag><br /> After translation to Spanish I need: <strong>Translated content </strong><br />

How can I use Google Translate API to Translate text in Microsoft Excel

时光总嘲笑我的痴心妄想 提交于 2019-12-02 02:04:52
I am hoping someone here can help me with the google translator API. I have an excel file with about 80k rows, and I am trying to build a macro where it translates everything in a column except for the first row. As an example I have six columns in Microsoft Excel such as the below Excel Column Headers Column A = Name Column B = Address Column C = Phone Number Column D = Request Column E = Google Translated Request Column F = Notes and I want to use the google translator API to take what is in column D and translate it to column E without translating what is in the first row as those are my

Why are touch event listeners seemingly preventing the selection of google translate languages on the iphone or ipad?

自作多情 提交于 2019-12-02 00:47:18
问题 I've a problem with the google translate widget. When using the iphone or the ipad I can't select the language to translate to. I can click the first button, but then when the languages menu appears and I tap a language, the menu immediately disappears and the click registers on the element that was behind the menu. This problem only occurs under very specific situations which I will outline below. The problem described below has been observed on an iphone4 ios5.0.1 and ipad2 ios 7.0.6. The

Why are touch event listeners seemingly preventing the selection of google translate languages on the iphone or ipad?

走远了吗. 提交于 2019-12-01 21:57:44
I've a problem with the google translate widget. When using the iphone or the ipad I can't select the language to translate to. I can click the first button, but then when the languages menu appears and I tap a language, the menu immediately disappears and the click registers on the element that was behind the menu. This problem only occurs under very specific situations which I will outline below. The problem described below has been observed on an iphone4 ios5.0.1 and ipad2 ios 7.0.6. The problem has NOT been observed on firefox 29.0.1, chrome 31.0.1650.63 m or internet explorer 11. JSfiddle

Google translate get current language

萝らか妹 提交于 2019-12-01 19:19:00
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 if Spanish is chosen over English. Any help would be appreciated! Your not gonna believe it: window

Google Translate Widget - Translation complete callback

不问归期 提交于 2019-12-01 16:10:42
I'm using the google translate widget on one of my sites with the following google supplied code: <div id="google_translate_element"></div><script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); } </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> <script> My problem: The translate runs after the page has loaded but I also have a script that auto