commit 2f3c4aeccf5846dffddbc873b1a51720707be2c1 Author: meskio meskio@torproject.org Date: Tue May 11 13:05:07 2021 +0200
Get the right language for translations
installTranslations expects a list, not a string.
Fixes #15404 --- bridgedb/distributors/email/autoresponder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bridgedb/distributors/email/autoresponder.py b/bridgedb/distributors/email/autoresponder.py index 1632258..12f0ae1 100644 --- a/bridgedb/distributors/email/autoresponder.py +++ b/bridgedb/distributors/email/autoresponder.py @@ -93,7 +93,7 @@ def createResponseBody(lines, context, client, lang='en'): email response which we should send out and the qrcode image of the bridges if we provide bridges. """ - translator = translations.installTranslations(lang) + translator = translations.installTranslations([lang]) bridges = None try: bridgeRequest = request.determineBridgeRequestOptions(lines) @@ -237,7 +237,7 @@ class SMTPAutoresponder(smtp.SMTPClient): # The string EMAIL_MISC_TEXT[1] shows up in an email if BridgeDB # responds with bridges. Everything else we count as an invalid # request. - translator = translations.installTranslations(lang) + translator = translations.installTranslations([lang]) if body is not None and translator.gettext(strings.EMAIL_MISC_TEXT[1]) in body: emailMetrix.recordValidEmailRequest(self) else:
tor-commits@lists.torproject.org