libtranslate-bin prints HTML garbage when translating with Google

Bug #1572955 reported by Dmitry
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libtranslate (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

$ echo cat | translate-bin -s google -f en -t ru
" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">Кот

Should be:

$ echo cat | translate-bin -s google -f en -t ru
Кот

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libtranslate-bin 0.99-0ubuntu9
ProcVersionSignature: Ubuntu 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Apr 21 13:41:02 2016
InstallationDate: Installed on 2016-04-15 (5 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Beta amd64 (20160415)
SourcePackage: libtranslate
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dmitry (dmitrymq) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libtranslate (Ubuntu):
status: New → Confirmed
Revision history for this message
Boyd (boyd-dyob) wrote :

Workaround is to trim all text before the ">"

as is we get the following:
 echo "hola" | translate-bin -s google -f es -t en
" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">Hello

use the following to get what you want:
$echo "hola" | translate-bin -s google -f es -t en | grep -oP ">$prefix\K.*"
Hello

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

Other bug subscribers

Remote bug watches

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