googletranslate | Python Google Translate ( using reverse | REST library
kandi X-RAY | googletranslate Summary
kandi X-RAY | googletranslate Summary
Google translate "without" limits and without API key.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Translate text
- Calculate token from text
- Translate the given text
- Make a GET request
- Create a new object
googletranslate Key Features
googletranslate Examples and Code Snippets
Community Discussions
Trending Discussions on googletranslate
QUESTION
I have been trying to translate text from HTML code. Here is an example:
...ANSWER
Answered 2022-Feb-23 at 14:02Is the text you want always inside a single ? Or could there be more than one span or other element types?
This works for extracting the inner text from a single :
QUESTION
I have a frustrating issue with the Google Cloud Translate API.
I set up correctly the restriction of the key to some domains including *.example.com/ * (without blank space at the end)
I launch the script on the URL https://www.example.com/translate and i have the following message :
...ANSWER
Answered 2022-Feb-01 at 11:47I read the comments and you seem to be doing everything ok. I would recommend you to try:
- This error message can appear because you set API restrictions in the API key, is this the case? Maybe you’re restricting this specific API.
- If you aren’t setting any API restrictions, is it possible to try adding an IP instead of the domain just for testing purposes?
QUESTION
I'm trying to use the Googletranslate function on Google Sheets but would like the cell to detect English or Japanese. I wanted to use Detectlanguage to find out the language first but I'm not sure how to format it. Here's what I did but I get an error:
=if(=DETECTLANGUAGE(A2)="en",[=GOOGLETRANSLATE("jp"]))
If it's English, I wanted it to be translated to Japanese and vice versa. Does anyone know if I am on the right track? Thank you in advance.
...ANSWER
Answered 2021-Dec-26 at 00:55based on the GOOGLETRANSLATE and DETECTLANGUAGE functions,
try this:
QUESTION
I am using GoogleTranslate() with Sheets to translate some contents into different languages. In those contents, we have multiple hooks [ ] and % % in one string that do not need to translate. Example :
[name] [surname] looked at your profile %number% !
I do not need to translate hooks like [username] and %number%.
I'm looking for :
[name] [surname] a regardé ton profil %number% !
(in french for example)
A solution is already provided here for one character using REGEXREPLACE and REGEXEXTRACT. But I need either symbol [xxx] and %xxx% in one formula. Thank you.
...ANSWER
Answered 2021-Jun-03 at 09:43Try this:
=arrayformula(if(A1<>"",join("",if(isnumber(flatten(split(GOOGLETRANSLATE(join(" ",iferror(regexreplace(to_text(flatten(split(A1," "))),"(\[.*\])|(\%.*\%)","["&row(A$1:A)&"]"),)),"en","fr"),"[]"))),vlookup(flatten(split(GOOGLETRANSLATE(join(" ",iferror(regexreplace(to_text(flatten(split(A1," "))),"(\[.*\])|(\%.*\%)","["&row(A$1:A)&"]"),)),"en","fr"),"[]")),{sequence(len(regexreplace(A1,"[^\ ]",))+1,1),flatten(split(A1," "))},2,false),flatten(split(GOOGLETRANSLATE(join(" ",iferror(regexreplace(to_text(flatten(split(A1," "))),"(\[.*\])|(\%.*\%)","["&row(A$1:A)&"]"),)),"en","fr"),"[]")))),))
GOOGLETRANSLATE
does not work with ARRAYFORMULA
, but you can drag down this formula from cell B1
if you want to apply it to multiple rows in column A.
Individual steps taken:
Split text by space character, then flatten into one column.
Cell D1:
=flatten(split(A1," "))
Replace
[***]
and%***%
with[row#]
.Cell E1:
=arrayformula(iferror(regexreplace(to_text(flatten(split(A1," "))),"(\[.*\])|(\%.*\%)","["&row(A$1:A)&"]"),))
Join the rows into one cell.
Cell F1:
=join(" ",E:E)
Apply Google Translate.
Cell G1:
=GOOGLETRANSLATE(F1,"en","fr")
Split by
[]
.Cell H1:
=flatten(split(G1,"[]"))
Where rows contain numbers, lookup item 1) above.
Cell I1:
=arrayformula(if(isnumber(H1:H),vlookup(H1:H,{row(A$1:A),D:D},2,false),H1:H))
Join the rows into one cell.
Cell J1:
=join(" ",I:I)
QUESTION
I found @soMario correction of @Folleloide custom function to translate cell values in Google Sheets using DeepL API:
...ANSWER
Answered 2021-May-11 at 11:36I thought that when you are actually using deeplapi()
in your question, that function doesn't return the value. Because the last line of the function is Logger.log(data);
. And also, in your following situation (This is from your question),
You are using the function deeplapi()
as deeplapi(value1, value2, value3)
. But, your function deeplapi()
doesn't use the arguments. I thought that these might be the reason of your issue.
If you want to use your function as deeplapi(value1, value2, value3)
, how about the following modification?
QUESTION
Using the GOOGLETRANSLATE
formula:
ANSWER
Answered 2021-Mar-31 at 06:44I believe your goal as follows.
You want to translate the following situation.
From
QUESTION
I am using GoogleTranslate()
with Sheets to translate some contents into different languages. In those contents, we have some hooks [ ]
that do not need to translate. Example :
ANSWER
Answered 2021-Mar-15 at 15:07QUESTION
I am trying to translate many rows of sentences using the googletranslate() function on Google Sheets as a shortcut.
If I do this manually on the Google Translate website, I generally get two possible outputs with one being more grammatically correct. When I use googletrasnalte() I get the less grammatically correct.
Why is that and is there a way of changing it?
...ANSWER
Answered 2021-Mar-02 at 15:36This is a known issue, and it is a design decision by Google to use the older translation feature. See this issue: https://issuetracker.google.com/178959844. Perhaps you could create a Feature Request to have the better translation. If so you could do it in the the same public Issue Tracker and clicking on the "Create Issue" button.
QUESTION
I would need to remove from rows words which are not in English and specific symbols, like | or -, and three dots (...) if they are at the end of each row. In order to do this, I was considering to use googletranslate or langdetect packages in Python for detecting and removing from text words not in English, and create a list for symbols.
To apply them, I was doing as follows:
...ANSWER
Answered 2020-Dec-01 at 11:46like regex
QUESTION
I started using Cloud Google and implemented the translation API in my code but I can't use the response outside the callback.
...ANSWER
Answered 2020-Mar-12 at 14:07Using the function keyword changes the 'this' context. You can either save 'this' outside of the function or use arrow functions.
Here's how you would use an arrow function
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install googletranslate
You can use googletranslate like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page