google-translate

Google Translate API: Requests from this client application <empty> are blocked

有些话、适合烂在心里 提交于 2021-02-19 08:27:24
问题 I've been getting error 403 - Requests from this Android client application are blocked using paid Google Cloud Platform Translation API. Works great when restrictions are set to none. There are a few threads around reporting similar issue, but none answered. I've seen in some examples, there's a version which had .setApplicationName(), I think that might help, but I can't find which version would that be. Code used is:` private void translate(String textToTranslate, String targetLanguage,

How to change google translator select language text in coding

房东的猫 提交于 2021-02-18 16:36:56
问题 I am using the google translator in my website, I want to change the select language text in the drop down. Anyone suggest for this. Here is my code; function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'ar', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); } Thanks in advance. 回答1: According to this question you can modify the element as you want. Like this: <script src="https://code

How to change google translator select language text in coding

谁说胖子不能爱 提交于 2021-02-18 16:35:20
问题 I am using the google translator in my website, I want to change the select language text in the drop down. Anyone suggest for this. Here is my code; function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'ar', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); } Thanks in advance. 回答1: According to this question you can modify the element as you want. Like this: <script src="https://code

Python: Cannot install googletrans

爷,独闯天下 提交于 2021-02-17 04:49:52
问题 I try to install googletrans https://pypi.org/project/googletrans/ by running this command as adviced: $ pip install googletrans but I always get same error both at python 3.5 and python 2.7: Collecting googletrans Using cached googletrans-3.0.0.tar.gz (17 kB) ERROR: Could not find a version that satisfies the requirement httpx==0.13.3 (from googletrans) (from versions: none) ERROR: No matching distribution found for httpx==0.13.3 (from googletrans) I tried different commands but I still

Python: Cannot install googletrans

心不动则不痛 提交于 2021-02-17 04:49:31
问题 I try to install googletrans https://pypi.org/project/googletrans/ by running this command as adviced: $ pip install googletrans but I always get same error both at python 3.5 and python 2.7: Collecting googletrans Using cached googletrans-3.0.0.tar.gz (17 kB) ERROR: Could not find a version that satisfies the requirement httpx==0.13.3 (from googletrans) (from versions: none) ERROR: No matching distribution found for httpx==0.13.3 (from googletrans) I tried different commands but I still

GoogleTrans Python not translating

[亡魂溺海] 提交于 2021-02-13 17:34:42
问题 I am using GoogleTrans for my project. Actually I have a text in Marathi which I got from "speech to text" but when I am converting that text into English it is not translating properLY. But when I am using Google Translate from website, it is translating properly with 100% accuracy ? Image Here is the piece of Code : import speech_recognition as sr from cltk.corpus.utils.importer import CorpusImporter from googletrans import Translator import goslate import googletrans print("Hello World")

GoogleTrans Python not translating

岁酱吖の 提交于 2021-02-13 17:34:42
问题 I am using GoogleTrans for my project. Actually I have a text in Marathi which I got from "speech to text" but when I am converting that text into English it is not translating properLY. But when I am using Google Translate from website, it is translating properly with 100% accuracy ? Image Here is the piece of Code : import speech_recognition as sr from cltk.corpus.utils.importer import CorpusImporter from googletrans import Translator import goslate import googletrans print("Hello World")

Google Translate javascript snippet not working

我与影子孤独终老i 提交于 2021-02-10 16:41:52
问题 I tried using the code snippet from w3school.com. It worked on w3school but doesnt work on my PC. <div id="google_translate_element"></div> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en' }, 'google_translate_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> I got the following in the console. translate.html:18 GET file://translate.google.com/translate_a/element

Why Google Translate API doesn't accept API-Key in JSON request body?

安稳与你 提交于 2021-02-07 12:55:23
问题 I'm new to use Google Could Platform. I tried Translation API's tutorial. By some reason I want to use API-Key for its authentication. but API doesn't accept key in JSON Request, though it accepts same key in HTTP query parameter. Is this a restriction of Google Translation API? or do I have any mistake? Following is what I tried: Worked when API-key is passed as a query parameter $ curl -H 'Content-Type: application/json' 'https://translation.googleapis.com/language/translate/v2?key

Google translate - Disable translating of a part of my text

二次信任 提交于 2021-02-07 05:08:00
问题 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