google-translate

How can I tell Google Translate to not translate a section of a website?

。_饼干妹妹 提交于 2019-11-27 06:17:48
Google Translate has a developer tool that will enable google translate on a website. Is there a way to tell Google Translate to not translate a section of the website? Perhaps with a class name on an HTML element? I've tried the HTML5 translate=no attribute. It has no effect. This is a particular problem because Google is mistranslating the name of the website. Jukka K. Korpela According to Google instructions , setting class="notranslate" prevents Google translation. This appears to work, though using it inline (e.g., for a single word) may imply some confusion, so you need to check out what

JavaScript/jQuery - Get text and translate it

我只是一个虾纸丫 提交于 2019-11-27 06:17:27
问题 Is it possible to use jQuery to get a text from an element and translate it to other languages? Before <p>Hello</p> After <p>bonjour</p> 回答1: Use Google translation API. Easy to use. The following translates Spanish to English. To translate from and to other languages, simply change 'es' and 'en' <div id="content"></div> google.load("language", "1"); function initialize() { var content = document.getElementById('content'); content.innerHTML = '<div id="text">Hola, me alegro mucho de verte.<\

How to disable google translate from html in chrome

被刻印的时光 ゝ 提交于 2019-11-27 05:09:43
问题 I just made a website for a french restaurant. The website is in english, but I guess there is enough french on the website (labeled pictures of menu items) to prompt the visitor to translate the website if using Chrome. Is there something I can add to the html to prevent chrome from asking to translate the page? I'd assume it'd be something like <html lang="en"> but that doesn't work. Any ideas? Thanks 回答1: Add this tag in between <head> and </head> : <meta name="google" content="notranslate

Implementing Google Translate with custom flag icons

人走茶凉 提交于 2019-11-27 03:06:29
Currently, I'm using the simple Google Translate drop-down menu found here: http://translate.google.com/translate_tools I'd like to also be able to click on some flag icons I have and trigger the same javascript calls that are called by the text-based links in the google translate widget. Anyone have ideas on how to accomplish this? I can't figure out how to make clicking on the flags initiate the same behavior as clicking on the google translate text links. Had a lot of fun finding a solution for this question! <!-- Use CSS to replace link text with flag icons --> <ul class="translation-links

Google Translate set default language

纵饮孤独 提交于 2019-11-27 01:38:28
问题 Maybe this has an obvious solution that I'm overlooking, but I can't seem to find the correct parameter to put in to make this happen. Using the Google Translate widget on a site, I need to set the default language that the user sees when entering the site, even though the site is english. function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en' }, 'google_translate_element'); } I've tried adding: defaultLanguage: 'fr' and tried: targetLanguage: 'fr'

Translate website to any specific language, on page load

China☆狼群 提交于 2019-11-27 01:24:20
问题 Anybody have any idea how to translate a web page into any language using Google translate when it loads? I don't want a drop down menu, I just want to convert the website into a specific language when it loads. I have tried many things from http://code.google.com/p/jquery-translate/ but all in vain. Any good suggestions would be appreciated. 回答1: <!-- This code will translate page contents automatically (without user input) Settings located at line 9, current script will translate english to

Translate text using vba

狂风中的少年 提交于 2019-11-26 22:23:39
问题 Probably could be a rare petition, but here is the issue. I am adapting an excel of a third-party to my organization. The excel is developed in English and the people of my organization just speaks Spanish. I want to use exactly the same code that the original worksheet have, I prefer don't touch it (although I can do it), so I want to use a function that every time that a msgbox appears (with the text in English), I translate the msgbox messages but without touching the original script. I am

Google Translate V2 cannot hanlde large text translations from C#

核能气质少年 提交于 2019-11-26 21:51:55
问题 I've implemented C# code using the Google Translation V2 api with the GET Method. It successfully translates small texts but when increasing the text length and it takes 1,800 characters long ( including URI parameters ) I'm getting the "URI too large" error. Ok, I burned down all the paths and investigated the issue across multiple pages posted on Internet. All of them clearly says the GET method should be overriden to simulate a POST method ( which is meant to provide support to 5,000

Adding Google Translate to a web site

廉价感情. 提交于 2019-11-26 19:55:11
问题 Looking here Google Translate I get the following code. <meta name="google-translate-customization" content="9f841e7780177523-3214ceb76f765f38-gc38c6fe6f9d06436-c"></meta> <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="/

GoogleTrans API Error - Expecting value: line 1 column 1 (char 0)

荒凉一梦 提交于 2019-11-26 14:38:41
问题 I am having this error when translating thousands of text data in an iteration: Expecting value: line 1 column 1 (char 0) My code for translating big amounts of text: translatedList = [] for index, row in df.iterrows(): newrow = copy.deepcopy(row) try: # translate the 'text' column translated = translator.translate(row['text'], dest='en') newrow['translated'] = translated.text except Exception as e: print(str(e)) continue translatedList.append(newrow) I receive this error after translating