google-translate

Google translate - Disable translating of a part of my text

被刻印的时光 ゝ 提交于 2021-02-07 05:07:50
问题 I'm working on an admin page to create post for a blog. I have a french textarea and an english textarea. So, for those who cannot translate by there own, I created a button "translate with google": <a id="tr_textefr" href="http://translate.google.fr/#fr/en/" target="_blank"> Traduire avec Google</a> And my french textarea has a javascript function called onkeyup : function translate(what){ var button = "tr_" + what; var textarea = document.getElementById(what); var google = "http://translate

Google translate - Disable translating of a part of my text

十年热恋 提交于 2021-02-07 05:04:57
问题 I'm working on an admin page to create post for a blog. I have a french textarea and an english textarea. So, for those who cannot translate by there own, I created a button "translate with google": <a id="tr_textefr" href="http://translate.google.fr/#fr/en/" target="_blank"> Traduire avec Google</a> And my french textarea has a javascript function called onkeyup : function translate(what){ var button = "tr_" + what; var textarea = document.getElementById(what); var google = "http://translate

How to return the auto detected language from LanguageApp.translate?

安稳与你 提交于 2021-01-29 11:10:45
问题 I´d like to make an application which translates text to english (no matter which language is entered). The translation is already working pretty well, but now i´m trying to detect the language entered and i have no clue how to get the detected language from LanguageApp.translate. I tried using the google API but as it´s paid i need a opinion which is free as it´s a small project just for me and non commercial. var translatedText = LanguageApp.translate(sourceText, sourceLang, targetLang,

Google Cloud Translation API: Creating glossary error

荒凉一梦 提交于 2021-01-28 22:07:36
问题 I tried to test Cloud Translation API using glossary. So I created a sample glossary file(.csv) and uploaded it on Cloud Storage. However when I ran my test code (copying sample code from official documentation), an error occurred. It seems that there is a problem in my sample glossary file, but I cannot find it. I attached my code, error message, and screenshot of the glossary file. Could you please tell me how to fix it? And can I use the glossary so that the original language is used when

googletrans Translate() not working on Spyder but works on Colab

别等时光非礼了梦想. 提交于 2021-01-28 21:32:06
问题 I am using googletrans Translator on offline data in local repo: translator = Translator() translations = [] for element in df['myText']: translations.append(translator.translate(element).text) df['translations'] = translations On Google Colab it works fine(20 mins) but on my machine it takes 30 mins and stops with ReadTimeout error: File "<ipython-input-9-2209313a9a78>", line 4, in <module> translations.append(translator.translate(element).text) File "C:\Anaconda3\lib\site-packages

why python googletrans suddenly not working? [duplicate]

有些话、适合烂在心里 提交于 2021-01-28 10:06:21
问题 This question already has answers here : googletrans stopped working with error 'NoneType' object has no attribute 'group' (10 answers) Closed 2 years ago . Here is the code: # coding: utf-8 from googletrans import Translator translator = Translator() print translator.translate('here', dest='zh-CN') everything goes well before today. But not I try to use this python library. then I got this error. root@localhost:~# python googletest.py Traceback (most recent call last): File "googletest.py",

why python googletrans suddenly not working? [duplicate]

给你一囗甜甜゛ 提交于 2021-01-28 09:57:19
问题 This question already has answers here : googletrans stopped working with error 'NoneType' object has no attribute 'group' (10 answers) Closed 2 years ago . Here is the code: # coding: utf-8 from googletrans import Translator translator = Translator() print translator.translate('here', dest='zh-CN') everything goes well before today. But not I try to use this python library. then I got this error. root@localhost:~# python googletest.py Traceback (most recent call last): File "googletest.py",

How to parse out unescaped single quote ' from json string in javascript Google Translate

為{幸葍}努か 提交于 2021-01-27 19:13:31
问题 I am calling google translate api and getting back strings that are not fully decoded. In particular, I am seeing ' where single quotes should be. For example: { "q": "det är fullt", "target": "en" } Returns { "data": { "translations": [ { "translatedText": "It&\#39;s full", "detectedSourceLanguage": "sv" } ] } } I would have expected JSON.parse to take care of this, but it does not. Is there some other native function I need to be calling? My current fix is to fix this using a regex .replace

Google translate widget mobile overflow [duplicate]

≯℡__Kan透↙ 提交于 2021-01-27 18:26:51
问题 This question already has answers here : Styling Google Translate widget for mobile websites (3 answers) Closed 4 years ago . I'm having a bit of a problem with google's translate plugin on my site. It appears fine in desktop mode but as I move down to mobile the width of the dropdown exceeds the browser width. Is there anyway to prevent this from happening? best regards 回答1: As you can't add css to elements that don't exist you have to add it after you click on the translate dropdown CTA.

Python googletrans encoding weird chars

偶尔善良 提交于 2021-01-27 17:04:07
问题 I have an ui which takes german language among other things and translate these in english sentences. # -*- coding: utf-8 -*- from googletrans import Translator def tr(s) translator = Translator() return translator.translate(wordDE,src='de',dest='en').text Sometimes I get weird characters from the translator. For example: DE: Pascal und PHP sind Programmiersprachen für Softwareentwickler und Ingenieure. googletrans EN(utf8): Pascal and PHP are programming languages ​​for software developers