Closed DanielMalmgren closed 5 years ago
I put a full output from command here: https://pastebin.com/yvMR4SGt
My base locale is sv_SE and in this example I tried translating to es_ES. Tried other languages though, seems Google gives 429 at first call. This worked yesterday however, I was using version 0.11 then.
Ok, I thought I'd try the Google Translation API way instead, so I set up an API key and put it in laravel_google_translate.php (just replaced the NULL with my API key encapsuled in quotes), now I get the following error instead:
array(1) {
["error"]=>
array(3) {
["code"]=>
int(400)
["message"]=>
string(13) "Invalid Value"
["errors"]=>
array(1) {
[0]=>
array(3) {
["message"]=>
string(13) "Invalid Value"
["domain"]=>
string(6) "global"
["reason"]=>
string(7) "invalid"
}
}
}
}
I guess it somehow doesn't like my API key, just can't understand how I would otherwise format it?
Thanks for bearing with me :-)
Ok, turns out after some more testing that the "Invalid Value" that Google is complaining about is my language codes. Using "en" and "sv" instead of "en_US" and "sv_SE" made it work like a charm. Still not really clear though on why I had to use the API at all, why google-translate-php makes it return http 429...
I just got the following crash. Feels like Google don't like the amount of requests it gets in a rapid flow? Is there some delay needed somewhere so make them happier?