mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Babelize wasn't properly setting the language when it terminated early
This commit is contained in:
parent
5633b9d46b
commit
32f39e0980
@ -143,6 +143,7 @@ def babelize(phrase, from_language, through_language, limit = 12, callback = Non
|
|||||||
for i in range(limit):
|
for i in range(limit):
|
||||||
phrase = translate(phrase, next, flip[next])
|
phrase = translate(phrase, next, flip[next])
|
||||||
if seen.has_key(phrase):
|
if seen.has_key(phrase):
|
||||||
|
next = flip[next]
|
||||||
break
|
break
|
||||||
seen[phrase] = 1
|
seen[phrase] = 1
|
||||||
if callback:
|
if callback:
|
||||||
|
@ -45,6 +45,7 @@ if network:
|
|||||||
def testBabelize(self):
|
def testBabelize(self):
|
||||||
self.assertNotError('babelize en sp foo')
|
self.assertNotError('babelize en sp foo')
|
||||||
self.assertError('babelize sp fr foo')
|
self.assertError('babelize sp fr foo')
|
||||||
|
self.assertResponse('babelize german english sprache', 'language')
|
||||||
|
|
||||||
def testRandomlanguage(self):
|
def testRandomlanguage(self):
|
||||||
self.assertNotError('randomlanguage')
|
self.assertNotError('randomlanguage')
|
||||||
|
Loading…
Reference in New Issue
Block a user