auto translate

Post Reply
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

auto translate

Post by diszk »

Hello, sorry for 2 threads but I read somewhere here that I should separate the questions.

So is there a way to a use oneliner command for translation?
I mean, here is the actual command:
php rotation.php action=translate

but then I have to answer questions and I'd like to know if I can add the answers to the command like
php rotation.php action=translate fromfield=custom_name tofield=group_custom_var3 apikey=gjjub7ughgvg fromlang=en tolang=de

thanks in advance!
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: auto translate

Post by admin »

Hello, not a problem its add what you need

php rotation.php action=translate target_site_id= ... source_language=... target_language=... api_key=.... target_entity=... source_field=... target_field=....

looks good to start with?
Don't forget to run script update
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

Re: auto translate

Post by diszk »

more than good, many thanks, I'll try it soon

also another thing: google has changed the chinese letters:
cn -> zh-CN (or zn)
tw -> zh-TW

so the en-cn translation request's result will be "400:Invalid value"
and the en-tw translation will be "wrong language pairs"

you can check it:
https://www.googleapis.com/language/tra ... t=cn&q=car
https://www.googleapis.com/language/tra ... t=tw&q=car

and the correct ones for simplified cn:
https://www.googleapis.com/language/tra ... t=zh&q=car
or
https://www.googleapis.com/language/tra ... h-CN&q=car

and for traditional cn:
https://www.googleapis.com/language/tra ... h-TW&q=car

sadly, there is no "zh" in the list, so I cannot make it work, also I only need simplified chinese, so if your translator function working only with 2 letters, I don't mind if you just delete traditional chinese

if you don't have an API key, I'll send mine thru PM

source:
https://cloud.google.com/translate/docs/languages

thanks!
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: auto translate

Post by admin »

Thank you, its been added )
Don't forget to run script update
diszk
Posts: 63
Joined: Tue Jan 17, 2012 12:07 am

Re: auto translate

Post by diszk »

Sorry for long response time, and thank you, but there is a small issue.
I created a new language slave, zhcn and wanted to translate from en to zh-cn, but the list contains "zh-cn" and it seems that when creating a zh-cn slave, the system marks is as "zh", so I get this error when trying to translate:

You want to translate from en to zh-cn, while this slave it marked as zh, looks like this is an error (36.873989105225, 8.1685881614685)
thanks!

also sent you a PM about a different thing
admin
Site Admin
Posts: 37197
Joined: Wed Sep 10, 2008 11:43 am

Re: auto translate

Post by admin »

That's right , sorry for the delay
Please, run update and recreate the lng slave.
Don't forget to run script update
Post Reply