views:

132

answers:

1

Has someone ever used isReliable with the Google Translate API? It always returns "undefined" value.

google.language.translate('hello','','es',function(result){
    alert(result.isReliable); // prints undefined
    alert(result.translation); // prints "hola"
});

Resources: Google Translate API - Result objects

+1  A: 

isReliable - A boolean representing whether or not the detection interval believes the language code is reliable for the given text.

It only works for language detection (not for translation).

You can see an example here.

Eran Betzalel
do you have an example of isReliable?
andufo
Yes, just view the source at the link I gave in the answer. After the `result` object is filled with the right data `isReliable` will get it's value. You can see this by using FireBug and setting break point at `if (!result.error) {`.
Eran Betzalel