Hi,

Second attempt. Sorry in transferring my changes to a SVN branch (I was using 
2.0.3) to create a patch I missed a critical piece. The attached patch will fix 
the translation to work by actually loading the Google Language API.

Cheers,
Jacques

-----Original Message-----
From: Jacques Beaurain [mailto:[email protected]] 
Sent: March 18, 2010 10:48 AM
To: [email protected]
Subject: Re: [translate-pootle] Google Ajax API in Pootle

Hi Again,

Ok I cleaned up the Javascript a bit and here is my patch. I've found that 
Google API messes with string format specifiers so there is a couple of regular 
expressions used to replace the entries with __1__, __2__ etc. before sending 
the string to Google and after translation the original specifiers will be 
placed back. We use 3 kinds of specifiers with position:

  1. C/C++ printf: e.g. "Only %2$d bytes free on '%1$s'."
  2. .Net String.Format: e.g. "Only {1} bytes free on '{0}'."
  3. Single %n positional specifiers: e.g. "Only %2 bytes free on '%1'." 

By doing the replacements in the same order as specified above we've found that 
we get pretty good results with the languages we are currently experimenting 
with (ru & zh_CN). 

This is my first venture into Pootle's codebase so I appreciated any feedback 
and will refine the implementation further if needed.

Cheers,

Jacques


-----Original Message-----
From: Jacques Beaurain [mailto:[email protected]]
Sent: March 18, 2010 8:45 AM
To: [email protected]
Subject: Re: [translate-pootle] Google Ajax API in Pootle

Hi All,

I should have a patch later today for this. Regarding the legal implications 
Google is actually pretty permissive with these APIs. I do not believe this 
should be an issue for Pootle integration, the actual full terms for this 
specific API is at: http://code.google.com/apis/ajaxlanguage/terms.html

Cheers,
J

-----Original Message-----
From: Kevin Donnelly [mailto:[email protected]]
Sent: March 17, 2010 8:10 PM
To: [email protected]
Subject: Re: [translate-pootle] Google Ajax API in Pootle

On Wednesday 17 March 2010 22:36, Amos Jeffries wrote:
> Alaa, catch Friedel on this. There was a discussion about this on IRC 
> a while back. Some legal implications came up with google data. Can't 
> be displayed in a non-google interface, or other sourced texts, etc.

I hope Jacques patch can be included.  Re the terms, the only thing I can find
is:
http://www.google.com/accounts/TOS?hl=en&loc=en

=====
5.3 You agree not to access (or attempt to access) any of the Services by any 
means other than through the interface that is provided by Google, unless you 
have been specifically allowed to do so in a separate agreement with Google.

5.5 Unless you have been specifically permitted to do so in a separate 
agreement with Google, you agree that you will not reproduce, duplicate, copy, 
sell, trade or resell the Services for any purpose.
=====

Regarding 5.3, I would have thought that the Google Translate APIs:
http://code.google.com/intl/en/apis/ajaxlanguage/documentation/reference.html
constitute the interface.  Regarding 5.5, Pootle is not actually providing the 
translation service.  Am I missing something more specific?

If the Google terms are as restrictive as you suspect, it would be worth 
contacting them to confirm this directly.  Not least, it would be worth 
publicising the fact that this "service" is tied down to Google.

But if the terms allow Pootle to use the output, then Jacques' patch would be 
useful.  Having spent a couple of years working on a (GPLed) Welsh translator, 
Google's (closed) translator is actually quite good.  The downside is that our 
project has basically had the rug pulled from under it, so I am not a Google 
fan (not least because of the directions they seem to be developing in).  Terms 
that are as restrictive as you suggest would confirm this, but perhaps asking 
them is all we need to do to clarify things?

--
Pob hwyl / Best wishes

Kevin Donnelly

kevindonnelly.org.uk - Welsh and stuff

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval Try the new software tools for 
yourself. Speed compiling, find bugs proactively, and fine-tune applications 
for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval Try the new software tools for 
yourself. Speed compiling, find bugs proactively, and fine-tune applications 
for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle

Attachment: pootle_google_translate.patch
Description: pootle_google_translate.patch

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle

Reply via email to