Instant Translation demo not working?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Instant Translation demo not working?

Jim Deegan
My question concerns the Instant Translation example app, which worked fine
(until late 2008). However, not long thereafter, I'd get a "Session expired"
error whenever I clicked in the input-area (labeled 'Translate text:'). Perhaps
Orbeon Forms 3.8.0 fixed this problem by adding the following line to the
xforms:model in the view.xhtml file:
<xforms:setfocus ev:event="xforms-ready" control="input-area"/>
 
Now, however, translated output does not display in the area labeled
'Translation:'. This holds true for different browsers and when viewing the app
on localhost or on a public site (e.g., orbeon.com). Are other users
experiencing this problem (no display of translation into target language)?
 
I wonder if a Google requirement is causing the problem (see
http://code.google.com/apis/ajaxlanguage/documentation/#Examples): "For
google.language.translate, the POST method is available. Applications that use
this interface must abide by all existing terms of use
(http://code.google.com/apis/ajaxlanguage/terms.html). An area to pay special
attention to relates to correctly identifying yourself in your requests.
Applications MUST always include a valid and accurate http referer header ...
in their requests."  (Note, however, that this requirement appears in a section
entitled 'For Flash and other Non-JavaScript Environments' ).
 
After adding <xhtml:http_referer>Referer:
"http://localhost:8080/orbeon-CE/xforms-translate/"</xhtml:http_referer> to the
header of the view.xhtml file, I got the following error:

Condition failed for every branch of choose: [(/request/request-path =
'/xforms-server-submit'), (/request/request-path = '/xforms-translate/'),
(/request/request-path = '/xforms-translate/post')]
 
Details: Resource URL -> oxf:/page-flow.xml Line 34 Column 106
 
Description -> reading page model data output
        page id -> apps
        model -> apps/${1}/page-flow.xml
 
Element: <page id="apps" path-info="/([^/]+)/.*" matcher="oxf:perl5-matcher"
model="apps/${1}/page-flow.xml"/>
 
Also, might Orbeon Forms' reliance on Yahoo's version of JSON
(...\resources\yui\json.js) conflict with Google Translate's version of JSON
and related source code?
 
Regards,
Jim Deegan
[hidden email]


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Instant Translation demo not working?

Alessandro  Vernet
Administrator
Jim,

Thank you for reporting this; the code that we have in this example
that parses what is returned by Google is a bit weak, and it is pretty
sensitive to Google changing how they return data. I fixed this, and
it will work again in the next nightly build. For reference, the bug
is:

http://forge.ow2.org/tracker/index.php?func=detail&aid=315181&group_id=168&atid=350207

Alex

On Thu, Jul 8, 2010 at 1:43 PM,  <[hidden email]> wrote:

> My question concerns the Instant Translation example app, which worked fine
> (until late 2008). However, not long thereafter, I'd get a "Session expired"
> error whenever I clicked in the input-area (labeled 'Translate text:'). Perhaps
> Orbeon Forms 3.8.0 fixed this problem by adding the following line to the
> xforms:model in the view.xhtml file:
> <xforms:setfocus ev:event="xforms-ready" control="input-area"/>
>
> Now, however, translated output does not display in the area labeled
> 'Translation:'. This holds true for different browsers and when viewing the app
> on localhost or on a public site (e.g., orbeon.com). Are other users
> experiencing this problem (no display of translation into target language)?
>
> I wonder if a Google requirement is causing the problem (see
> http://code.google.com/apis/ajaxlanguage/documentation/#Examples): "For
> google.language.translate, the POST method is available. Applications that use
> this interface must abide by all existing terms of use
> (http://code.google.com/apis/ajaxlanguage/terms.html). An area to pay special
> attention to relates to correctly identifying yourself in your requests.
> Applications MUST always include a valid and accurate http referer header ...
> in their requests."  (Note, however, that this requirement appears in a section
> entitled 'For Flash and other Non-JavaScript Environments' ).
>
> After adding <xhtml:http_referer>Referer:
> "http://localhost:8080/orbeon-CE/xforms-translate/"</xhtml:http_referer> to the
> header of the view.xhtml file, I got the following error:
>
> Condition failed for every branch of choose: [(/request/request-path =
> '/xforms-server-submit'), (/request/request-path = '/xforms-translate/'),
> (/request/request-path = '/xforms-translate/post')]
>
> Details: Resource URL -> oxf:/page-flow.xml Line 34 Column 106
>
> Description -> reading page model data output
>        page id -> apps
>        model -> apps/${1}/page-flow.xml
>
> Element: <page id="apps" path-info="/([^/]+)/.*" matcher="oxf:perl5-matcher"
> model="apps/${1}/page-flow.xml"/>
>
> Also, might Orbeon Forms' reliance on Yahoo's version of JSON
> (...\resources\yui\json.js) conflict with Google Translate's version of JSON
> and related source code?
>
> Regards,
> Jim Deegan
> [hidden email]
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet