AnsweredAssumed Answered

Google Translate API - escape character?

Question asked by Extensitech on Dec 18, 2015
Latest reply on Dec 19, 2015 by user19752

I'm experimenting with the google translate API. Finding it pretty easy to work with with InsertfromURL and some pretty straightforward parsing of the resulting JSON.

 

(I'm well aware of the imperfect nature of google translation, btw. I'm using this as a "first pass" for a native speaker to clean up.)

 

Here's my challenge. I'm translating phrases (not individual words, since word order changes from language to language, and context is important generally, as well). Sometimes those phrases include field data that just "is what it is", and shouldn't be translated.

 

For example, I may be on a record for a person whose first name is "Destiny", and I might want to translate the phrase "Do you want to send Destiny an email?" into Spanish. The Google API comes back with "¿Quieres enviar destino un correo electrónico?".

 

Surely, there must be some sort of escape character that I can put around "Destiny" so that her name doesn't get translated... but I cannot find it. If it were just names, of course, I'm sure I could do a down and dirty workaround, but I'd imagine this same issue could come up with things like product names, or just places where I want to insert the value from a field "as-is".

 

For translating web sites, there's a <notranslate> tag (or something like that) in the api, but I can't see the equivalent for just translating a phrase, nor can I figure out how to pass my phrase through the part of the api where that tag would work.

 

Has anyone tried this and figured it out? If not, I'll keep looking, but I don't want to wear out my keyboard searching google if one of you has already figured this out.

 

Chris Cain

Extensitech

Outcomes