Added error to babelize in case one language isn't english.

This commit is contained in:
Jeremy Fincher 2003-08-21 15:49:06 +00:00
parent 70c43fdc7f
commit 526e5b613b

View File

@ -390,6 +390,9 @@ class Http(callbacks.Privmsg):
try:
fromLang = self._abbrevs[fromLang.lower()]
toLang = self._abbrevs[toLang.lower()]
if fromLang != 'english' and toLang != 'english':
irc.error(msg, 'One language must be English.')
return
translations = babelfish.babelize(text, fromLang, toLang)
irc.reply(msg, translations[-1])
except (KeyError, babelfish.LanguageNotAvailableError), e: