auto translate

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

auto translate

Post by diszk » Thu May 17, 2018 2:38 pm

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: 25849
Joined: Wed Sep 10, 2008 11:43 am

Re: auto translate

Post by admin » Fri May 18, 2018 7:48 am

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?
Have you done script update ?

diszk
Posts: 55
Joined: Tue Jan 17, 2012 12:07 am

Re: auto translate

Post by diszk » Fri May 18, 2018 8:16 am

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: 25849
Joined: Wed Sep 10, 2008 11:43 am

Re: auto translate

Post by admin » Tue May 22, 2018 3:09 am

Thank you, its been added )
Have you done script update ?

diszk
Posts: 55
Joined: Tue Jan 17, 2012 12:07 am

Re: auto translate

Post by diszk » Fri May 25, 2018 9:11 am

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: 25849
Joined: Wed Sep 10, 2008 11:43 am

Re: auto translate

Post by admin » Wed Jun 06, 2018 7:55 am

That's right , sorry for the delay
Please, run update and recreate the lng slave.
Have you done script update ?

Post Reply