Google service doesn't work in libtranslate

Bug #124287 reported by Cassiel
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
libtranslate (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: libtranslate0

Version info: libtranslate0 v0.99-0ubuntu3 (feisty)

Google has changed its translate page (http://www.google.com/translate_t?langpair=es|en). The translated result is displayed in a div tag, instead of a textarea tag, as before.

Changing lines 65 to 67 of file /usr/share/libtranslate/services.xml from:

<pre-marker text="&lt;textarea"/>
<pre-marker text="&gt;"/>
<post-marker text="&lt;/textarea&gt;"/>

to:

<pre-marker text="&lt;div id=result_box"/>
<pre-marker text="&gt;"/>
<post-marker text="&lt;/div&gt;"/>

seems to fix the problem.

Related branches

Revision history for this message
Thomas E Jenkins (thomas-jenkins) wrote :

I can confirm this fix is still required and works in Hardy. Before applying this gnome-translate would just write the untranslated text in the "Translated text" box.

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I noticed that the package version your bugging is updated in Lucid. Please update via http://releases.ubuntu.com/lucid/ repost a detailed error report, and update the bug status. Thanks!

Changed in libtranslate (Ubuntu):
status: New → Incomplete
Revision history for this message
mariodebian (mariodebian) wrote :

The patch for Google have changed a bit:

In debian/patches/05_services.patch

- <pre-marker text="&lt;textarea"/>
+ <pre-marker text="&lt;span title="/>
+ <!--<pre-marker text="result_box"/>-->
        <pre-marker text="&gt;"/>
- <post-marker text="&lt;/textarea&gt;"/>
+ <post-marker text="&lt;/span&gt;"/>

This bug is duplicate of: 511474 523393 529689

Revision history for this message
farchumbre (farchumbre) wrote :

somehow mariodebian's solution didn't work for me

what worked for me was

 #2

to solve the problem

sudo gedit /usr/share/libtranslate/services.xml

then look for the lines containing

<text-translation url="http://www.google.com/translate_t?text=${text:escape}&amp;langpair=${from}|${to}&amp;ie=utf8&amp;oe=utf8">
 <pre-marker text="&lt;div id="/>
 <pre-marker text="result_box"/>
 <pre-marker text="&gt;"/>
 <post-marker text="&lt;/div&gt;"/>
      </text-translation>

and replace them with

<text-translation url="http://www.google.com/translate_t?text=${text:escape}&amp;langpair=${from}|${to}&amp;ie=utf8&amp;oe=utf8">
     <pre-marker text="id="/>
     <pre-marker text="result_box"/>
     <pre-marker text="mouseover"/>
     <pre-marker text="&gt;"/>
     <post-marker text="&lt;"/>
       </text-translation>

save and restart gnome-translate

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

farchumbre, thank you for your help on this bug and making Ubuntu better. The next step is to take your proposed solution and make it into a patch ( https://wiki.ubuntu.com/Bugs/HowToFix ) for others to test with and, barring exception, merged into libtranslate.

Changed in libtranslate (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libtranslate - 0.99-0ubuntu8

---------------
libtranslate (0.99-0ubuntu8) natty; urgency=low

  * debian/patches/05_services.patch:
    - update services.xml, taken from Fedora
      (LP: #124287, #319110, #483423)
  * debian/patches/08_fix_modules_build.patch:
    - fix module build (LP: #419793)
  * convert to source format 3.0 (quilt)
 -- Andreas Moog <email address hidden> Fri, 18 Mar 2011 00:31:09 +0100

Changed in libtranslate (Ubuntu):
status: New → Fix Released
Revision history for this message
Ten (ten) wrote :

Currently libtranslate with google as a service returns erroneous markup:

" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">

To fix this edit:

sudo vim /usr/share/libtranslate/services.xml

And set your pre/post markers to this:

        <pre-marker text="&lt;span title="/>
        <pre-marker text="onmouseover="/>
        <pre-marker text="onmouseout="/>
        <pre-marker text="&gt;"/>
        <post-marker text="&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;"/>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.