Invalid value (400) using google translate api

google-api, google-api-php-client, google-translate

Solution

Solution was simple. Google has UK letters for ukrainian instead of UA.

Problem

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: https://www.googleapis.com/language/translate/v2?q=%D0%9F%D0%BE%D1%82%D0%B5%D0%BD%D1%86%D0%B8%D0%B0%D0%BB%2C%20%25&target=ua&source=ru&key=A... In response I get : ``` { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid Value" } ], "code": 400, "message": "Invalid Value" } } ``` What's wrong with my request?

Original source