diff --git a/contact/forms.py b/contact/forms.py index ccdd056c2..b68211608 100644 --- a/contact/forms.py +++ b/contact/forms.py @@ -5,6 +5,7 @@ from django.conf import settings from django.contrib.sites.models import Site from django.utils.encoding import force_bytes +from django.utils.translation import gettext_lazy as _ from django_contact_form.forms import ContactForm from django_recaptcha.fields import ReCaptchaField from django_recaptcha.widgets import ReCaptchaV3 @@ -17,19 +18,19 @@ class BaseContactForm(ContactForm): message_subject = forms.CharField( max_length=100, widget=forms.TextInput( - attrs={"class": "required", "placeholder": "Message subject"} + attrs={"class": "required", "placeholder": _("Message subject")} ), - label="Message subject", + label=_("Message subject"), ) email = forms.EmailField( - widget=forms.TextInput(attrs={"class": "required", "placeholder": "E-mail"}) + widget=forms.TextInput(attrs={"class": "required", "placeholder": _("E-mail")}) ) name = forms.CharField( - widget=forms.TextInput(attrs={"class": "required", "placeholder": "Name"}) + widget=forms.TextInput(attrs={"class": "required", "placeholder": _("Name")}) ) body = forms.CharField( widget=forms.Textarea( - attrs={"class": "required", "placeholder": "Your message"} + attrs={"class": "required", "placeholder": _("Your message")} ) ) captcha = ReCaptchaField(widget=ReCaptchaV3) diff --git a/djangoproject/templates/contact/coc.html b/djangoproject/templates/contact/coc.html index 482eb540e..db307a7f8 100644 --- a/djangoproject/templates/contact/coc.html +++ b/djangoproject/templates/contact/coc.html @@ -1,8 +1,9 @@ {% extends "base_3col.html" %} +{% load i18n %} -{% block title %}Django Code of Conduct Feedback{% endblock %} +{% block title %}{% translate "Django Code of Conduct Feedback" %}{% endblock %} {% block content %} -

Django Code of Conduct Feedback

+

{% translate "Django Code of Conduct Feedback" %}

{% include "contact/coc_form.html" %} {% endblock %} diff --git a/djangoproject/templates/contact/coc_form.html b/djangoproject/templates/contact/coc_form.html index 3282fff98..05d1aa4c1 100644 --- a/djangoproject/templates/contact/coc_form.html +++ b/djangoproject/templates/contact/coc_form.html @@ -1,22 +1,23 @@ +{% load i18n %}
{% csrf_token %} {# hardcoding inputs because they'll be included on the CoC page itself #}

- + {% if form.name.errors %}

{{ form.name.errors.as_text }}

{% endif %}

- + {% if form.email.errors %}

{{ form.email.errors.as_text }}

{% endif %}

- + {% if form.body.errors %}

{{ form.body.errors.as_text }}

{% endif %}

-

+

diff --git a/djangoproject/templates/contact/foundation.html b/djangoproject/templates/contact/foundation.html index ce1e17699..396fa1464 100644 --- a/djangoproject/templates/contact/foundation.html +++ b/djangoproject/templates/contact/foundation.html @@ -1,17 +1,34 @@ {% extends "base_foundation.html" %} +{% load i18n %} -{% block title %}Contact the Django Software Foundation{% endblock %} +{% block title %}{% translate "Contact the Django Software Foundation" %}{% endblock %} {% block content %} -

Contact the Django Software Foundation

-

This contact form is for the Django Software Foundation - the legal and - fundraising arm of the Django project.

-

If you want to report a bug, feature request, or documentation issue in Django, - use the ticket tracker.

-

If you want to report a problem with this website, use the - GitHub repo.

-

If you've got questions about how to use Django, use the - django-users mailing list.

+

{% translate "Contact the Django Software Foundation" %}

+

+ {% blocktranslate trimmed %} + This contact form is for the Django Software Foundation - the legal and + fundraising arm of the Django project. + {% endblocktranslate %} +

+

+ {% blocktranslate trimmed %} + If you want to report a bug, feature request, or documentation issue in Django, + use the ticket tracker. + {% endblocktranslate %} +

+

+ {% blocktranslate trimmed %} + If you want to report a problem with this website, use the + GitHub repo. + {% endblocktranslate %} +

+

+ {% blocktranslate trimmed %} + If you've got questions about how to use Django, use the + django-users mailing list. + {% endblocktranslate %} +

{% csrf_token %}

@@ -31,6 +48,6 @@

Contact the Django Software Foundation

{{ form.body }}

{{ form.captcha }}

-

+

{% endblock %} diff --git a/djangoproject/templates/contact/sent.html b/djangoproject/templates/contact/sent.html index 7706e7c80..9cc57be47 100644 --- a/djangoproject/templates/contact/sent.html +++ b/djangoproject/templates/contact/sent.html @@ -1,18 +1,23 @@ {% extends "base_foundation.html" %} +{% load i18n %} -{% block title %}Message sent{% endblock %} +{% block title %}{% translate "Message sent" %}{% endblock %} {% block content %} -

Message sent

-

Your message has been sent; thanks!

+

{% translate "Message sent" %}

+

{% translate "Your message has been sent; thanks!" %}

- Your mail will be read by a real, live human being. We can't - guarantee when or whether you'll get a reply, but your message - will be read, generally within the next couple of days. + {% blocktranslate trimmed %} + Your mail will be read by a real, live human being. We can't + guarantee when or whether you'll get a reply, but your message + will be read, generally within the next couple of days. + {% endblocktranslate %}

- If you're expecting a reply and don't get one, please feel free - to send a reminder. Please wait a few days, however, unless - it's an emergency. + {% blocktranslate trimmed %} + If you're expecting a reply and don't get one, please feel free + to send a reminder. Please wait a few days, however, unless + it's an emergency. + {% endblocktranslate %}

{% endblock %}