google translator access via livecode

Tim Selander selander at tkf.att.ne.jp
Tue Jun 6 00:26:35 EDT 2023


I use google translate API with an LC Server web application. It 
would probably work exactly the same with LC desktop.

The call looks like this:
put "https://www.googleapis.com/language/translate/v2?key=(your 
google API account key)&q=cat&source=en&target=ja" into tURL
put URL tURL into vholder

The word to translate is 'cat' and vholder is below.

"data": { "translations": [ { "translatedText": "猫" } ] } }

JSON, I think. I just use LC and change itemdelimiter to zero in 
on the translated text.

There is a monthly free limit on amount of text, then you pay. My 
app is VERY low traffic and I have never gone over the free 
amount of text to translate.

Hope this helps!

Tim Selander
Tokyo, Japan




On 2023.06.05 3:35, Andrew Meit via use-livecode wrote:
> I am seeking a widget or live script code to translate a single word or at most 256 chrs text from within a stack.
> I think there is or was Google api livecode could use to talk with the Google translator server via scripting.
> My ideal use: while moving the cursor over and clicking text the mousetext can be sent to Google and return the translation.
> Anyone have a sample stack to share?
> Thanks, Andrew
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


More information about the use-livecode mailing list