vendredi 3 avril 2015

How to detect if the Google's Translate API fails to translate?

I am using the Google Translate API 2 now, because 1 is no longer available. My query results threw the javascript API look like this:



{
"data": {
"translations": [
{
"translatedText": "Haus"
},
{
"translatedText": "Übersetzung"
},
{
"translatedText": "sdhksjhks"
}
]
}
}


As you see "sdhksjhks" is a translation error, because I did not give the translator a word which it knew. How can I detect this error?


In the API Version 1 a field named 'responseStatus' was returned for every translation.





Aucun commentaire:

Enregistrer un commentaire