Translation API - Store translations in a database?

547 views
Skip to first unread message

Mike.Hayes

unread,
Jun 26, 2008, 6:08:57 PM6/26/08
to Google AJAX API
Hi

I'm looking at using the translation APIs to convert our English sites
into other languages so that we can expand into the market in other
countries.

The issue is that the terms (http://code.google.com/apis/ajaxlanguage/
terms.html) state that I cannot:

"copy, store, archive, republish or create a database of results
returned from the service, in whole or in part, directly or
indirectly, except that you may store results in a temporary cache for
a period not to exceed Fifteen (15) days solely for the purpose of
using those results to carry out a specific user-requested action"

So -- I'm guessing this means I'm not actually allowed to store the
results from Google Translation into flat files or into a database? I
wanted to store the results for instant translations of the website
into other languages until volunteer human translations come along to
improve it further than the computer translations.

I'm just after some confirmation that I'm NOT allowed to use the
translation API to do this, or am I misunderstood? I would of course
love to use it, but if I can't.. I can't. + I don't wish to use
Javascript to translate the pages live, that would become really
really messy and wouldn't allow our human volunteer translations to
then improve upon the existing Google translations at the website(s).

I was going to see if there was a support/help e-mail but thought it
may be better to give Groups a try.. perhaps it is possible to do what
I wish to and others already are? (surely there is a way you are
allowed to use Google Translation to convert websites into multiple
languages without just using Javascript there and then on the spot on
each page load?)

Thanks for any help, it's much appreciated.

Mike

Ben Lisbakken

unread,
Jun 27, 2008, 7:22:51 PM6/27/08
to Google-AJAX...@googlegroups.com
Hey Mike --

If you are planning to store the translations for a very short period (a few days), we don't mind.  However, anything more permanent goes against our TOS and is not OK.

Regards,
Ben

ismail...@iassmarts.com

unread,
Jul 18, 2008, 6:28:30 AM7/18/08
to Google AJAX API
Ben,

Is there option for a paid service or plans for a paid service so that
the translations can be stored?

Many thanks

Ben Lisbakken

unread,
Jul 18, 2008, 1:04:58 PM7/18/08
to Google-AJAX...@googlegroups.com
No, sorry, we do not offer that.

-Ben

Artem

unread,
Jul 19, 2008, 9:28:30 AM7/19/08
to Google AJAX API
Hello! sorry for my bad English

I would like provide GOOGLE TRANSLATION API via my PROXY server!
i use proxy for some caching and friendly adaptation for FLASH apps.

I have a lot of online users on my site.

my PROXY server send HTTP_VIA and HTTP_X_FORWARDED_FOR headers for
detect requests as different client, my PROXY server have limit one
connection per client and some limit rate.

what problems i can have if i have a lot of simultaneously and
parallels connections from my PROXY server?

Best regards Artem

Ben Lisbakken

unread,
Jul 21, 2008, 3:25:40 PM7/21/08
to Google-AJAX...@googlegroups.com
Hey Artem --

I'm kind of confused what you are asking about.  If you are asking about rate limits, there are none on the Translation API.

If you are asking about if it is OK to cache with a Proxy server, the answer is no unless you are clearing your cache very regularly.

I hope those answers help!

-Ben

Robert

unread,
Jul 21, 2008, 6:17:28 PM7/21/08
to Google-AJAX...@googlegroups.com
I think I can understand where the person is coming from Ben.

I've often noticed that including Google Analytics scripts at the bottom of a page, slows down the loading of the page just a little.

That's a concern for all of us.  I don't think anyone wants to translate and essentially dead paragraph that is not dynamic.

I think what you may be referring to is some 3rd party trying to create a huge database of words or common phrases in multiple languages and storing them and then reselling them.

I don't think that's the focus in this question, it's more of speed (and only speed).

-r
-- 
CONFIDENTIALITY NOTICE The contents of this message may be privileged and confidential. Therefore, if this message has been received in error, please delete it without reading it. Your receipt of this message is not intended to waive any applicable privilege. Please do not disseminate this message without the permission of the author. This e-mail does not serve as a contract or a legally binding agreement of any sort whatsoever. Agreements with ActiveCommunity.com are done by formal contract only and by signature and witnesses.

Willy

unread,
Jul 23, 2008, 8:59:05 AM7/23/08
to Google AJAX API
Google translation has a ways to go before it can be easily used for
complex applications like this whatever the interpretation of their
rules of use. While it works well if the applications are limited to
Web pages...the natural environment for JAVASCRIPT, trying to transfer
the results to other venues or programming languages...e.g. PERL,
JAVA, or even a simple mailto URL...fails miserably when multibyte
unicode is included...the way the "alphabets" of non-Western languages
are represented on the Net. Furthermore, the URL translator...which
this author suggests he wants to use...has a serious bug in its
handling of JAVA Applets...it drops the closing tag blanking
everything after the start of the applet on the translated page.

On the other hand, Google provides the best machine translation on the
Web and the best interface for accessing it. If you would like a more
thorough discussion of that to which we are referring, check out
http://www.dreamagic.com/Google.

Cordially,
Willy Chaplin
Webmaster
The Dream Machine
dreamagic.com

siteowner

unread,
Aug 24, 2008, 2:21:39 PM8/24/08
to Google AJAX API
Hi Ben

I have question similar to Mike.Hayes'.

I've launched a copy of my website in another country, and all
editorial content have been translated by humans.

However, our site features an option to submit a review of businesses
that we have in our database. We have a lot of these reviews, and most
of them include a personal story, submitted by the user. We haven't
translated these stories, as they are submitted by the community and
arrive in a steady flow. The reviewed businesses attract customers in
both countries, so users in the new country have an interest in at
least understanding what other users have written about a certain
business. A machine translation for these submittes stories seem like
the perfect solution, and Google's API is the obvious choice, but then
there's an issue....

Since the API is javascript based, the content will not be indexable
by search engines, which is a shame, because it would be relevant to
have these pages indexed, as they contain relevant information for
searches on these businesses. Also, non-javascript users are excluded
from the party.

So the first solution that comes to mind is to pre-translate the whole
thing and store it in our database. I presumed this wasn't allowed,
and reading this discussion I got that confirmed. Storing it in a
database would also have the downside that regular improvements in the
translation algorithms wouldn't be utilised.

So I'm left with 2 ideas that I would like your thoughts on before
trying them. Last thing I want to do is to make Google angry ;):

A) Have the pages use a HTTP request to call the API from the server
side script each time the page is loaded. This would mean that the
translation isn't stored, but still no javascript would be used and
therefore the content would be indexable.

B) Store the translations for a short period of time (a few days),
stretching the TOS to its limit. This would make pages load faster (No
HTTP Request) and it would allow for improvements in translation
algorithm to come into effect.

Regardless of using method A or B, I don't see anything "evil" or
abusive in this way of using the API. The result that users see are
the same, I can still include the Google branding on the page, and
javascript is avoided which would prevent some users from using the
service anyway. The desire to have the content indexed is white hat in
my opinion, because this technique would make relevant content
available to searches by users in the new country - something that
would otherwise not be available.

I hope you will give me your thoughts on this, thanks!


Patrick

Ben Lisbakken

unread,
Aug 25, 2008, 1:16:29 PM8/25/08
to Google-AJAX...@googlegroups.com
On Sun, Aug 24, 2008 at 11:21 AM, siteowner <pat...@blasone.eu> wrote:

Hi Ben

I have question similar to Mike.Hayes'.

I've launched a copy of my website in another country, and all
editorial content have been translated by humans.

However, our site features an option to submit a review of businesses
that we have in our database. We have a lot of these reviews, and most
of them include a personal story, submitted by the user. We haven't
translated these stories, as they are submitted by the community and
arrive in a steady flow. The reviewed businesses attract customers in
both countries, so users in the new country have an interest in at
least understanding what other users have written about a certain
business. A machine translation for these submittes stories seem like
the perfect solution, and Google's API is the obvious choice, but then
there's an issue....

Since the API is javascript based, the content will not be indexable
by search engines, which is a shame, because it would be relevant to
have these pages indexed, as they contain relevant information for
searches on these businesses. Also, non-javascript users are excluded
from the party.

The indexing issue makes sense.  I'm not sure what the answer is to that.  Our TOS state that you can keep a cached version for a short period of time, so maybe the answer is to update once a day with a cron job?  As for the non-javascript users being excluded, I think it's safe to say that there are very (very) few non-javascript users, even with mobile devices.  Either way, we have a non-javascript way to use our API:
http://code.google.com/apis/ajaxlanguage/documentation/reference.html#_intro_fonje
 


So the first solution that comes to mind is to pre-translate the whole
thing and store it in our database. I presumed this wasn't allowed,
and reading this discussion I got that confirmed. Storing it in a
database would also have the downside that regular improvements in the
translation algorithms wouldn't be utilised.

Like I said above, and you mention below, doing a regular cron job to grab the translation should suit you well.  The benefit of up-to-date translation algorithms, as well as no Javascript and fast service.  If you were to write something like this, you would be a popular guy on this group if you were to share it!
 


So I'm left with 2 ideas that I would like your thoughts on before
trying them. Last thing I want to do is to make Google angry ;):

It's tough to make us angry :)

Let me know if you have further questions,
Ben
 

siteowner

unread,
Aug 28, 2008, 4:33:38 PM8/28/08
to Google AJAX API
Hi everyone

Following Ben's reply I've put together my solution for handling
machine translation of our texts. Ben encouraged me to post the code
here, so here it is. If anyone can use it great. It's very much cut
down to getting the job done (translating non-html texts). It's in
classic ASP and MSSQL, but it can easily be translated to any
scripting language.

I've decided to store the translations in a field in the same database
table as the original texts are in. In order to keep track of when a
text was updated the last time, I've added a datetime field too.

In order not to violate the TOS, all the texts must be translated
every 1-2 of days. To do this I use a cron job that runs every hour.
(Actually a free site uptime checker tool that calls a page on our
site every hour). Every time this runs, my script will take the 2 % of
texts that has gone the longest time since the last update. Having it
set at 2 % will get all the texts updated in about 2 days (48 hours x
2 % = 96 %). This is within the rules, but at the same time requests
to Google are kept to a minimum and spread out as much as possible -
No need to waste Google's resources on unneccesary requests.

CRON JOB:

[CODE]
strSQL = "SELECT TOP 2 PERCENT IdField, OriginalText, TranslatedText,
LanguageCode FROM YourTable ORDER BY LastTranslated ASC"
Set rs = database.Execute(strSQL, adCmdText)
If Not rs.EOF Then arrTexts = rs.GetRows
rs.Close
Set rs = Nothing

For i = 0 To Ubound(arrTexts, 2)
If Len(arrTexts(1, i)) > 0 Then
strText = Translate(Trim(arrTexts(1, i)), strFromLang,
strToLang, false)
If strText <> "" Then
strSQL = "SET DATEFORMAT DMY;UPDATE YourTable SET
TranslatedText = '" & Replace(strText, "'", "''") & "', LastTranslated
= '" & FormatSQLTime(Now) & "' WHERE IdField = " & arrTexts(0, i)
Set opdatering = database.Execute(komtekst, adCmdText)
End If
End If
Next
[/CODE]


siteowner

unread,
Aug 28, 2008, 4:55:05 PM8/28/08
to Google AJAX API
Oops, thought I could edit my post. Just wanted to save it so far to
see if the code could display properly... It didn't display that well
I think...

Anyone know how to post code in these forums?

jgeerdes [AJAX APIs "Guru"]

unread,
Aug 28, 2008, 5:26:08 PM8/28/08
to Google AJAX API
paste-it.net

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jgee...@mchsi.com

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church

siteowner

unread,
Aug 28, 2008, 6:18:40 PM8/28/08
to Google AJAX API
Thanks jgeerdes! Ok so here's the code:

Script to be called every hour: http://www.paste-it.net/public/ce732df/

Translate() function: http://www.paste-it.net/public/kc0df29/

I hope someone can use it. I've used it to translate about 700 texts
of varying length, so I know it works. Feel free to use it as you
wish..

An example of the finished result can be seen here:
http://www.mylooks.co.uk/patient-reviews/751

razan essa

unread,
May 31, 2018, 12:06:21 PM5/31/18
to Google AJAX APIs
@siteowner

can you please re-upload the code I couldn't find it at this site 

Jeremy Geerdes

unread,
May 31, 2018, 2:15:42 PM5/31/18
to google-ajax...@googlegroups.com
Sadly, this post was 10 years ago. I don't have the code anymore.

jg

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/fd61f724-4ce7-45c8-b22b-2f26a9b1b7da%40googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-searc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jeremy R. Geerdes, Pastor
Debra Heights Wesleyan Church
4025 Lower Beaver Rd
Des Moines


Making more and better disciples of Jesus.

razan essa

unread,
Jun 2, 2018, 4:17:45 PM6/2/18
to Google AJAX APIs
opsss, 
any one can help me doing that : 
I have to table in my database, I need to translate one column from each previous table
 and save the translation in another column 
I don't know how to start  passing data from database into api and get result to store it 
any help !!!


On Thursday, May 31, 2018 at 9:15:42 PM UTC+3, jgeerdes [AJAX APIs "Guru"] wrote:
Sadly, this post was 10 years ago. I don't have the code anymore.

jg

On Thu, May 31, 2018 at 11:06 AM razan essa <razan....@gmail.com> wrote:
@siteowner

can you please re-upload the code I couldn't find it at this site 


On Friday, August 29, 2008 at 1:18:40 AM UTC+3, siteowner wrote:
Thanks jgeerdes! Ok so here's the code:

Script to be called every hour: http://www.paste-it.net/public/ce732df/

Translate() function: http://www.paste-it.net/public/kc0df29/

I hope someone can use it. I've used it to translate about 700 texts
of varying length, so I know it works. Feel free to use it as you
wish..

An example of the finished result can be seen here:
http://www.mylooks.co.uk/patient-reviews/751

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to

To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/fd61f724-4ce7-45c8-b22b-2f26a9b1b7da%40googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-search-api+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages