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)
|
translation = babelfish.translate(text, fromLang, toLang)
|
||||||
irc.reply(translation)
|
irc.reply(translation)
|
||||||
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
||||||
irc.error('%s is not a valid language. Valid languages '
|
languages = self.registryValue('languages', chan)
|
||||||
'include %s.' %
|
if languages:
|
||||||
(e, self.registryValue('languages', chan)))
|
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:
|
except babelfish.BabelizerIOError, e:
|
||||||
irc.error(str(e))
|
irc.error(str(e))
|
||||||
except babelfish.BabelfishChangedError, e:
|
except babelfish.BabelfishChangedError, e:
|
||||||
@ -155,9 +159,13 @@ class Babelfish(callbacks.Privmsg):
|
|||||||
translations = babelfish.babelize(text, fromLang, toLang)
|
translations = babelfish.babelize(text, fromLang, toLang)
|
||||||
irc.reply(utils.htmlToText(translations[-1]))
|
irc.reply(utils.htmlToText(translations[-1]))
|
||||||
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
except (KeyError, babelfish.LanguageNotAvailableError), e:
|
||||||
irc.reply('%s is not a valid language. Valid languages '
|
languages = self.registryValue('languages', chan)
|
||||||
'include %s.' % (e,
|
if languages:
|
||||||
self.registryValue('languages', chan)))
|
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:
|
except babelfish.BabelizerIOError, e:
|
||||||
irc.reply(e)
|
irc.reply(e)
|
||||||
except babelfish.BabelfishChangedError, e:
|
except babelfish.BabelfishChangedError, e:
|
||||||
|
Loading…
Reference in New Issue
Block a user