GoogleTranslate | Translate JSON structures using google translation API | REST library
kandi X-RAY | GoogleTranslate Summary
kandi X-RAY | GoogleTranslate Summary
Translate JSON structures using google translation API
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of GoogleTranslate
GoogleTranslate Key Features
GoogleTranslate Examples and Code Snippets
Community Discussions
Trending Discussions on GoogleTranslate
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
QUESTION
I am able to successfully open a URL and save the resultant page as a .html file. However, I am unable to determine how to download and save a .mhtml (Web Page, Single File).
My code is:
...ANSWER
Answered 2020-Feb-22 at 13:33Did you try using Selenium with a Chrome Webdriver to save page?
QUESTION
Hello all i have a big issue here which is not getting resolved from a long time.
i am using ck editor and Mathjax plugin to add maths formula there like this
...ANSWER
Answered 2020-Feb-22 at 07:21$text=str_replace('"', "'",$formula_text)
$results=str_replace("\ ","\\",$text);
QUESTION
hello here is my code you may understand the whole issue from this
...ANSWER
Answered 2020-Jan-15 at 08:09There are two issues with the HTML that prevent rendering
- extra space in delimiter:
\ (
instead of\(
- pre and code elements: by default, MathJax ignores these elements, cf. skipTags in http://docs.mathjax.org/en/v2.7-latest/options/tex2jax.html
There's also extra space inside the span tag declarations (< span> etc) which you probably want to fix -- but those do not influence MathJax.
With those fixed, everything renders fine.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install GoogleTranslate
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