Reputation: 3527
What's wrong with my request?
I have string in russian:
$string = Потенциал, %
I want to translate it to ukrainian with google API:
I urlencode string:
$q = urlencode($string)
And i request google API:
In response I get :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Value"
}
],
"code": 400,
"message": "Invalid Value"
}
}
What's wrong with my request?
Upvotes: 7
Views: 9689
Reputation: 1
I have my target language different in SDL Trados and Google, on google it is Kurdish Sorani with the code (ckb) on Trados it comes as some different names for the same language, which made even AI mad! Central Kurdish Iraq (ckb-IQ) Central Kurdish Iran (ckb-IR) Central Kurdish (- Peros Arabic Iraq (ku -Arab-IQ) Kurdish - Perso-Arabic - Iran (ku -Arab-IR) they are all exactly the same language and dialect and I have told the SDL Trados many many times but not been solved.
Upvotes: 0
Reputation: 7794
In my case I was trying to translate to "es-uy" but despite being a valid language code, Google doesn't support it.
Here are the language codes that the API supports: https://cloud.google.com/translate/docs/languages
Upvotes: 3
Reputation: 3527
Solution was simple. Google has UK letters for ukrainian instead of UA.
Upvotes: 12