diff --git a/locales/en/LC_MESSAGES/django.po b/locales/en/LC_MESSAGES/django.po index 53c8ccb1f..48bbd11c3 100644 --- a/locales/en/LC_MESSAGES/django.po +++ b/locales/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 21:56+0000\n" +"POT-Creation-Date: 2020-06-08 10:07+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -72,6 +72,11 @@ msgstr "" msgid "Passwords do not match!" msgstr "" +#: project/password_reset.py:65 +#, python-format +msgid "%(site_name)s here! Your verification code is %(code)s." +msgstr "" + #: project/tests/test_compilemessages.py:6 msgid "Hello world" msgstr "" diff --git a/locales/es/LC_MESSAGES/django.po b/locales/es/LC_MESSAGES/django.po index 7e6455d90..4420b22b7 100644 --- a/locales/es/LC_MESSAGES/django.po +++ b/locales/es/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: tenants2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-27 21:56+0000\n" +"POT-Creation-Date: 2020-06-08 10:07+0000\n" "PO-Revision-Date: 2020-06-06 17:48\n" "Last-Translator: FULL NAME \n" "Language-Team: Spanish\n" @@ -69,6 +69,11 @@ msgstr "Ya existe un usuario con esa dirección de correo electrónico." msgid "Passwords do not match!" msgstr "¡Las contraseñas no coinciden!" +#: project/password_reset.py:65 +#, python-format +msgid "%(site_name)s here! Your verification code is %(code)s." +msgstr "" + #: project/tests/test_compilemessages.py:6 msgid "Hello world" msgstr "Hola mundo" @@ -98,4 +103,3 @@ msgstr "%(areacode)s no es un prefijo telefónico válido." #: project/util/phone_number.py:68 msgid "This does not look like a U.S. phone number. Please include the area code, e.g. (555) 123-4567." msgstr "Ese no parece un número de teléfono de los Estados Unidos de América. Por favor, incluye el prefijo telefónico, por ejemplo, (555) 123-4567." - diff --git a/project/password_reset.py b/project/password_reset.py index 664673c72..85ac55ea8 100644 --- a/project/password_reset.py +++ b/project/password_reset.py @@ -3,6 +3,7 @@ from typing import Optional from django.utils.crypto import get_random_string, constant_time_compare from django.http import HttpRequest +from django.utils.translation import gettext as _ from . import slack from .util.site_util import get_site_name @@ -61,7 +62,10 @@ def create_verification_code(request: HttpRequest, phone_number: str): request.session[TIMESTAMP_SESSION_KEY] = time.time() twilio.send_sms_async( phone_number, - f"{get_site_name()} here! Your verification code is {vcode}.", + _("%(site_name)s here! Your verification code is %(code)s.") % { + "site_name": get_site_name(), + "code": vcode, + } ) slack.sendmsg_async( f"{slack.hyperlink(text=user.first_name, href=user.admin_url)} "