mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Added error to babelize in case one language isn't english.
This commit is contained in:
parent
70c43fdc7f
commit
526e5b613b
@ -390,6 +390,9 @@ class Http(callbacks.Privmsg):
|
|||||||
try:
|
try:
|
||||||
fromLang = self._abbrevs[fromLang.lower()]
|
fromLang = self._abbrevs[fromLang.lower()]
|
||||||
toLang = self._abbrevs[toLang.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)
|
translations = babelfish.babelize(text, fromLang, toLang)
|
||||||
irc.reply(msg, translations[-1])
|
irc.reply(msg, translations[-1])
|
||||||
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
||||||
|
Loading…
Reference in New Issue
Block a user