mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Fix for bug #1028749, bad listing of babelfish languages.
This commit is contained in:
parent
8f8a97261d
commit
105c371f6c
@ -120,9 +120,13 @@ class Babelfish(callbacks.Privmsg):
|
||||
translation = babelfish.translate(text, fromLang, toLang)
|
||||
irc.reply(translation)
|
||||
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
||||
irc.error('%s is not a valid language. Valid languages '
|
||||
'include %s.' %
|
||||
(e, self.registryValue('languages', chan)))
|
||||
languages = self.registryValue('languages', chan)
|
||||
if languages:
|
||||
languages = 'Valid languages include %s' % \
|
||||
utils.commaAndify(sorted(languages))
|
||||
else:
|
||||
languages = 'I do not speak any other languages.'
|
||||
irc.errorInvalid('language', str(e), languages)
|
||||
except babelfish.BabelizerIOError, e:
|
||||
irc.error(str(e))
|
||||
except babelfish.BabelfishChangedError, e:
|
||||
@ -155,9 +159,13 @@ class Babelfish(callbacks.Privmsg):
|
||||
translations = babelfish.babelize(text, fromLang, toLang)
|
||||
irc.reply(utils.htmlToText(translations[-1]))
|
||||
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
||||
irc.reply('%s is not a valid language. Valid languages '
|
||||
'include %s.' % (e,
|
||||
self.registryValue('languages', chan)))
|
||||
languages = self.registryValue('languages', chan)
|
||||
if languages:
|
||||
languages = 'Valid languages include %s' % \
|
||||
utils.commaAndify(sorted(languages))
|
||||
else:
|
||||
languages = 'I do not speak any other languages.'
|
||||
irc.errorInvalid('language', str(e), languages)
|
||||
except babelfish.BabelizerIOError, e:
|
||||
irc.reply(e)
|
||||
except babelfish.BabelfishChangedError, e:
|
||||
|
Loading…
Reference in New Issue
Block a user