TranslateParty: strip formatting before translating, not after...

Really fixes #60.
This commit is contained in:
James Lu 2017-11-12 01:17:37 -08:00
parent afabf73705
commit ddc92142a2

View File

@ -196,13 +196,13 @@ class TranslateParty(callbacks.Plugin):
self.log.debug(format("TranslateParty: Using %i languages: %L " self.log.debug(format("TranslateParty: Using %i languages: %L "
"(outlang %s)", len(ll), ll, outlang)) "(outlang %s)", len(ll), ll, outlang))
text = ircutils.stripFormatting(text)
# For every language in this list, translate the text given from # For every language in this list, translate the text given from
# auto-detect into the target language, and replace the original text # auto-detect into the target language, and replace the original text
# with it. # with it.
for targetlang in ll: for targetlang in ll:
text = self.getTranslation(irc, "auto", targetlang, text) text = self.getTranslation(irc, "auto", targetlang, text)
text = self.getTranslation(irc, "auto", outlang, text) text = self.getTranslation(irc, "auto", outlang, text)
text = ircutils.stripFormatting(text)
text = text.strip() text = text.strip()
if self.registryValue("verbose", msg.args[0]): if self.registryValue("verbose", msg.args[0]):