Pocket Translator

Pocket Translator by FineLineLabs


(5 stars)


Download for Android

10 - 50 downloads

Add this app to your lists
View bigger - Pocket Translator for Android screenshot
View bigger - Pocket Translator for Android screenshot
View bigger - Pocket Translator for Android screenshot
View bigger - Pocket Translator for Android screenshot
Translate English into Any and Every Language. Speak it or Type it!!!

Translate from English to any language, supports all alphabetical languages (50+).

Ideal for traveling, taking taxi, finding restaurants, getting around anywhere from Europe to Russia to Iceland to Africa to Anywhere!!!!

I'm inspired to create technologies that help people, and like always here is the code, originally written in Python, for anyone so inclined to play around with it and make it better:)
import httplib, mimetypes, mimetools, urllib2, android, sys, time, os, re
from urllib import urlretrieve
from urlparse import urljoin
import os.path
import urllib
import urlparse
import gzip as gzip_
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import simplejson as json
except ImportError:
import json

API_URL = 'http://SomeTranslationAPI eg: translate.foofleapis.com/translate_a/t'
DEFAULT_USER_AGENT = ('Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 '
'(KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6')

def translate(text, target_language='en', source_language=None, html=True,
user_agent=DEFAULT_USER_AGENT, referer=None, origin=None,
timeout=None, flat=False, urlopen=urllib2.urlopen, gzip=True):
if isinstance(text, basestring):
text = (text,)
headers = {
'User-Agent': user_agent,
'Accept-Charset': 'utf-8',
if gzip:
headers['Accept-Encoding'] = 'gzip'
if referer:
headers['Referer'] = referer
headers['Origin'] = '%s://%s/' % urlparse.urlsplit(referer)[:2]
if origin and origin != headers['Origin']:
raise ValueError('Origin and referer not matched', origin,
elif origin:
headers['Origin'] = origin
qs = (
('client', 'te_lib'),
('format', html and 'html' or ''),
('v', '1.0'),
('logld', 'v10'),
data = []
for block in text:
if isinstance(block, unicode):
block = block.encode('utf8')
except UnicodeDecodeError:
raise ValueError('Text must be utf8 or unicode')
data.append(('q', block))
data += [
('sl', source_language or ''),
('tl', target_language),
('tc', '1'),
req = urllib2.Request(API_URL + '?' + urllib.urlencode(qs),
urllib.urlencode(data), headers=headers)
resp = urlopen(req, **(timeout and {'timeout': timeout} or {}))
if gzip:
resp_cont = gzip_.GzipFile(fileobj=StringIO(resp.read()), mode='r').read()
resp_cont = resp.read()
result = json.loads(resp_cont.decode('string-escape'),strict=False)
if not source_language:
result, source_language = result[:-1], result[-1]
elif len(text) == 1:
result = (result,)
if flat:
return u' '.join(result)
return result

languageCode=droid.dialogGetInput('Input','Language Code').result
message=droid.dialogGetInput('Message','Type or push Microphone button to speak').result
droid.dialogCreateSpinnerProgress('Translating', 'Please Wait')
def ExtractAlphaNumeric(InputString):
from string import ascii_letters,digits
return "".join([ch for ch in InputString if ch in(ascii_letters+digits+' '+'.'+','+'\n'+'!'+'?'+'@'+'$'+'%'+'&'+';')])

Tags: pocket translator, pocket translator test.

Recently changed in this version

More Languages supported!

Comments and ratings for Pocket Translator

  • There aren't any comments yet, be the first to comment!