google-translate

Python googletrans encoding weird chars

痞子三分冷 提交于 2021-01-27 16:57:43
问题 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

Python googletrans library not translating correctly

余生颓废 提交于 2021-01-27 16:27:55
问题 I'm using the google trans library to translate some comments from different languages to English. But when testing this library no matter what I try to translate it will say that the language 'src' is English. Even setting the 'src' to a specific language doesn't fix this problem. Examples of this can be seen below: Sample Code 1: from googletrans import Translator translator = Translator() print(translator.translate('veritas lux mea')) Output: Translated(src=en, dest=en, text=veritas lux

Python googletrans library not translating correctly

旧街凉风 提交于 2021-01-27 16:26:39
问题 I'm using the google trans library to translate some comments from different languages to English. But when testing this library no matter what I try to translate it will say that the language 'src' is English. Even setting the 'src' to a specific language doesn't fix this problem. Examples of this can be seen below: Sample Code 1: from googletrans import Translator translator = Translator() print(translator.translate('veritas lux mea')) Output: Translated(src=en, dest=en, text=veritas lux

Python googletrans library not translating correctly

霸气de小男生 提交于 2021-01-27 16:26:14
问题 I'm using the google trans library to translate some comments from different languages to English. But when testing this library no matter what I try to translate it will say that the language 'src' is English. Even setting the 'src' to a specific language doesn't fix this problem. Examples of this can be seen below: Sample Code 1: from googletrans import Translator translator = Translator() print(translator.translate('veritas lux mea')) Output: Translated(src=en, dest=en, text=veritas lux

Translate an entire Google Sheet using Google Translate

喜欢而已 提交于 2021-01-21 10:41:45
问题 I have a Google Sheet written in the Japanese Language. I need to convert it into English. I know we can use googletranslate(<sheet!:cell>, <input_language>, <output_language>) to translate. But without a script, this forces me to translate each and every row. I need a script that will convert my whole Google Sheet into English. I prefer if it's converted into a separate sheet. Please let me know of the possible solutions. TIA 回答1: You want to translate Japanese to English for all cells of

What is “httpcore._exceptions.ConnectTimeout: timed out” error supposed to mean? How would I fix it?

爷,独闯天下 提交于 2021-01-05 08:08:12
问题 Basically, I'm using google translate API to translate a few documents that need to be translated into as many languages as possible, phrase by phrase. It had worked previously without any hassle, but when I use it now I keep getting this error. httpcore._exceptions.ConnectTimeout: timed out the line in which this error is happening is: word = Translator().translate(word_list[untrans_word], src=user_first_lang, dest=lang_to_translate_to) This word variable is in a function that translates the

What is “httpcore._exceptions.ConnectTimeout: timed out” error supposed to mean? How would I fix it?

ぃ、小莉子 提交于 2021-01-05 08:06:32
问题 Basically, I'm using google translate API to translate a few documents that need to be translated into as many languages as possible, phrase by phrase. It had worked previously without any hassle, but when I use it now I keep getting this error. httpcore._exceptions.ConnectTimeout: timed out the line in which this error is happening is: word = Translator().translate(word_list[untrans_word], src=user_first_lang, dest=lang_to_translate_to) This word variable is in a function that translates the

Invalid value (400) using google translate api

纵然是瞬间 提交于 2020-12-10 14:26:18
问题 What's wrong with my request? I have sting in russian: $string = Потенциал, % I want to translate it to ukrainian with google API: I urlencode string: $q = urlencode($string) And i request google API: https://www.googleapis.com/language/translate/v2?q=%D0%9F%D0%BE%D1%82%D0%B5%D0%BD%D1%86%D0%B8%D0%B0%D0%BB%2C%20%25&target=ua&source=ru&key=A... In response I get : { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid Value" } ], "code": 400, "message": "Invalid

How to translate only one html<div>

心不动则不痛 提交于 2020-08-10 18:49:06
问题 I have a list of services requested by API from a provider. I do not have access to the backend configuration in any way. I can only make some changes to html via twig templates. So, I would like to know if there is any way to translate these descriptions automatically via ajax with google, or I need an api, etc. I already check the possibility of using the google API, but I don't have enough technical knowledge to implement it. Example <select class="form-control" id="category"> </select>