Search code examples
javascriptgoogle-translategoogle-translation-api

Google Translate API - isReliable not returning anything


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


Solution

  • 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.