Google translation api

http://translate.google.cn/translate_a/single?client=gtx&dt=t&dj=1&ie=UTF-8&sl=auto&tl=en_US&q=你好嗎
你好嗎 to How are you
sl= original Language
tl= Translated language
Get JSON

Hi @tony.ycy.program, are you just sharing how to do something or do you have a question?

image

Your blocks aren’t going to work because the “sentences” property is a list (known as a JSON array). You need to get the first list item of “sentences” and then get the “trans” property from that.

When you see [1], that means there is a single array item. That item doesn’t have a property name “0”… that’s just a list index. It counts up from 0… 1… 2… etc.

A shortcut is to get the property name “sentences[1].trans” from the JSON object. See this.

2 Likes