Translate

hummy
Posts: 19
Joined: Mon Apr 07, 2014 8:47 pm

Translate

Post by hummy »

Hi Admin,

Does Translate ALT and Description work only with google Api?

Is it posible to translate with yandex translate api that is free?

And if it's posible, Can you please explain how to translate with yandex or bing translator?
Thanks
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: Translate

Post by admin »

Do you want to translate existing DB or newly added galleries?
Don't forget to run script update
hummy
Posts: 19
Joined: Mon Apr 07, 2014 8:47 pm

Re: Translate

Post by hummy »

newly added galleries. I want to translate description and category(group) Field when I import galleries.
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: Translate

Post by admin »

Sure, you can do it

http://smartcj.com/wiki/doku.php?id=goo ... ew_entries

but instead of pointing to http://YOURDOMAIN/scj/bin/rot.php - point to your script that will accept following parameters, request a translation from your favorite service and return the translation.
Don't forget to run script update
hummy
Posts: 19
Joined: Mon Apr 07, 2014 8:47 pm

Re: Translate

Post by hummy »

Hi Admin,

I tried with yandex translator, at script I put all fields like you post on wiki:

In this field URL
Contains this value http
Then Search For *
in This Field Description
And Replace it With external::https://translate.yandex.net/api/v1.5/t ... late?key=I put my APIKEY&lang=en-es&text={DESCRIPTION}

and results give me translation but in this form:

<?xml version="1.0" encoding="utf-8"?>
<Translation code="200" lang="en-ru">
<text>Быть или не быть?</text>
<text>Вот в чем вопрос.</text>
</Translation>

So I go to google and Created my server Apikey and put at last field of script

external::http://www.es.ildo.tv/scj/bin/rot.php?a ... api_key=my APIKEY

and results

http://www.es.ildo.tv/scj/bin/rot.php?a ... AIzaSEuF_1.....
returned code 404

What's wrong with google translator?

Any chance to adjust yandex translator to get it working with your script?

Thanks
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: Translate

Post by admin »

1. You still point to rot.php
don't do it
you and to point to your script that should return the translation

2. Your script should return plain text, not xml and so on


it's really easy:
When you import a gallery smartcj sees let's say

external::http://www.es.ildo.tv/your_script.php?text={DESCRIPTION}

"external::" means that smartcj should call external url
is this case this is your_script.php , replacing {DESCRIPTION} with actual description
your_script.php because rot.php knows about google API only

Your script calls yandex API and return plain text to smartcj, that saves the result in DB

Any programmer can code such script without any problems.
Don't forget to run script update
hummy
Posts: 19
Joined: Mon Apr 07, 2014 8:47 pm

Re: Translate

Post by hummy »

Ok now i got google api and on description i get as results:

Description : Tres + + caliente como el infierno + + + lesbianas muñecas + espectáculo + off + bonita + sexo + fiesta
How can I take off all this ++++++?

And for translate TAGS what I have to put instead of {DESCRIPTION} ?

If i put {TAGS} i get

2cthreesome|2cbeauty|2cblonde|2credhead|2cpanties|2clingerie|2clesbian|2cmassage|lamiendo|coño
Thanks
hummy
Posts: 19
Joined: Mon Apr 07, 2014 8:47 pm

Re: Translate

Post by hummy »

Hi Admin,

I fixed the ++++ with str_replace on template

but still get problem translating tags i tried with {TAGS} and with {TAG1} but is not working.
Thanks
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: Translate

Post by admin »

I've tried


external::http://domain/test.php?text={TAGS}

and it works fine.

Can you please show what exactly you try to do, what rules do you have and so on so I can repeat the situation here ?
Don't forget to run script update
hummy
Posts: 19
Joined: Mon Apr 07, 2014 8:47 pm

Re: Translate

Post by hummy »

Ok so at import replecements

If this field URL

Contains this value http

Then Search For *

in This Field Tags

And Replace it With

external::http://es.ildo.tv/mos/bin/rot.php?actio ... _key=AIzaS.........

and when I import Galleries I select all patterns I need include Tags
and at tags as results I get

2cthreesome|2cbeauty|2cblonde|2credhead|2cpanties|2clingerie|2clesbian|2cmassage|lamiendo|coño
Post Reply