Google Translate API - isReliable not returning anything
-
21-09-2019 - |
Question
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow