Skip to content

Commit a2ff929

Browse files
authored
[foundation] Marked all user-facing strings for translation
Refs #1648
1 parent c137adc commit a2ff929

File tree

9 files changed

+67
-51
lines changed

9 files changed

+67
-51
lines changed

djangoproject/templates/foundation/coreawardcohort_list.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{% extends "base_foundation.html" %}
2+
{% load i18n %}
23

3-
{% block og_title %}Django Core Developers{% endblock %}
4-
{% block og_description %}Former Django Core Team dissolved on March 12, 2020.{% endblock %}
4+
{% block og_title %}{% translate "Django Core Developers" %}{% endblock %}
5+
{% block og_description %}{% translate "Former Django Core Team dissolved on March 12, 2020." %}{% endblock %}
56

67
{% block content %}
7-
<h1>Django Core Developers</h1>
8+
<h1>{% translate "Django Core Developers" %}</h1>
89

910
<p>
10-
The title &ldquo;Django Core Developer&rdquo; is awarded to individuals
11-
who have made significant contributions, over an extended period of time,
12-
to Django or to major parts of its ecosystem. The title is awarded by the
13-
Board of Directors of the Django Software Foundation.
14-
A list of recipients is below.
11+
{% blocktranslate trimmed %}
12+
The title &ldquo;Django Core Developer&rdquo; is awarded to individuals
13+
who have made significant contributions, over an extended period of time,
14+
to Django or to major parts of its ecosystem. The title is awarded by the
15+
Board of Directors of the Django Software Foundation.
16+
A list of recipients is below.{% endblocktranslate %}
1517
</p>
1618
{% for cohort in object_list %}
1719
<h2>{{ cohort }}</h2>

djangoproject/templates/foundation/meeting_archive.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{% extends "base_foundation.html" %}
2+
{% load i18n %}
23

3-
{% block og_title %}Meeting minutes archive{% endblock %}
4-
{% block og_description %}View meeting minutes{% endblock %}
4+
{% block og_title %}{% translate "Meeting minutes archive" %}{% endblock %}
5+
{% block og_description %}{% translate "View meeting minutes" %}{% endblock %}
56

67
{% block head_extra %}
78
<link rel="alternate" type="application/rss+xml" title="RSS" href="{% url 'foundation-minutes-feed' %}" />
89
{% endblock %}
910

1011
{% block content %}
11-
<h1>Meeting minutes archive</h1>
12+
<h1>{% translate "Meeting minutes archive" %}</h1>
1213

13-
<p>Select a year to view meeting minutes:</p>
14+
<p>{% translate "Select a year to view meeting minutes:" %}</p>
1415

1516
<ul>
1617
{% for year in date_list %}

djangoproject/templates/foundation/meeting_archive_day.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{% extends "base_foundation.html" %}
2+
{% load i18n %}
23

3-
{% block og_title %}Meeting minutes archive{% endblock %}
4-
{% block og_description %}View meeting minutes for {{ day|date:"F j, Y" }}{% endblock %}
4+
{% block og_title %}{% translate "Meeting minutes archive" %}{% endblock %}
5+
{% block og_description %}{% blocktranslate trimmed with day=day|date:"DATE_FORMAT" %}
6+
View meeting minutes for {{ day }}{% endblocktranslate %}{% endblock %}
57

68
{% block content %}
7-
<h1>Meeting minutes archive: {{ day|date:"F j, Y" }}</h1>
9+
<h1>{% blocktranslate trimmed with day=day|date:"DATE_FORMAT" %}
10+
Meeting minutes archive: {{ day }}{% endblocktranslate %}</h1>
811

912
<ul>
1013
{% for meeting in object_list %}

djangoproject/templates/foundation/meeting_archive_month.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{% extends "base_foundation.html" %}
2+
{% load i18n %}
23

3-
{% block og_title %}Meeting minutes archive{% endblock %}
4-
{% block og_description %}View meeting minutes for {{ month|date:"F, Y" }}{% endblock %}
4+
{% block og_title %}{% translate "Meeting minutes archive" %}{% endblock %}
5+
{% block og_description %}{% blocktranslate with month=month|date:"F, Y" %}View meeting minutes for {{ month }}{% endblocktranslate %}{% endblock %}
56

67
{% block content %}
7-
<h1>Meeting minutes archive: {{ month|date:"F, Y" }}</h1>
8+
<h1>{% blocktranslate with month=month|date:"F, Y" %}Meeting minutes archive: {{ month }}{% endblocktranslate %}</h1>
89

910
<ul>
1011
{% for meeting in object_list %}

djangoproject/templates/foundation/meeting_archive_year.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{% extends "base_foundation.html" %}
2+
{% load i18n %}
23

3-
{% block og_title %}Meeting minutes archive{% endblock %}
4-
{% block og_description %}View meeting minutes for {{ year|date:"Y" }}{% endblock %}
4+
{% block og_title %}{% translate "Meeting minutes archive" %}{% endblock %}
5+
{% block og_description %}{% blocktranslate with year=year|date:"Y" %}View meeting minutes for {{ year }}{% endblocktranslate %}{% endblock %}
56

67
{% block content %}
7-
<h1>Meeting minutes archive: {{ year|date:"Y" }}</h1>
8+
<h1>{% blocktranslate with year=year|date:"Y" %}Meeting minutes archive: {{ year }}{% endblocktranslate %}</h1>
89

910
<ul>
1011
{% for meeting in object_list %}

djangoproject/templates/foundation/meeting_detail.html

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
{% extends "base_foundation.html" %}
2+
{% load i18n %}
23

3-
{% block og_title %}Meeting minutes: {{ meeting }}{% endblock %}
4-
{% block og_description %}Meeting minutes for {{ meeting }}{% endblock %}
4+
{% block og_title %}{% blocktranslate %}Meeting minutes: {{ meeting }}{% endblocktranslate %}{% endblock %}
5+
{% block og_description %}{% blocktranslate %}Meeting minutes for {{ meeting }}{% endblocktranslate %}{% endblock %}
56

67
{% block content %}
78
{% load djmoney %}
89

910
<h1>{{ meeting }}</h1>
1011

11-
<p>The meeting was led by {{ meeting.leader.account.get_full_name }}.</p>
12+
<p>
13+
{% blocktranslate trimmed with name=meeting.leader.account.get_full_name %}
14+
The meeting was led by {{ name }}.
15+
{% endblocktranslate %}
16+
</p>
1217

13-
<p>Board members in attendance were:</p>
18+
<p>{% translate "Board members in attendance were:" %}</p>
1419

1520
<ul>
1621
{% for attendee in meeting.board_attendees.all %}
@@ -19,7 +24,7 @@ <h1>{{ meeting }}</h1>
1924
</ul>
2025

2126
{% if meeting.non_board_attendees.all %}
22-
<p>Also in attendance were:</p>
27+
<p>{% translate "Also in attendance were:" %}</p>
2328

2429
<ul>
2530
{% for attendee in meeting.non_board_attendees.all %}
@@ -28,19 +33,19 @@ <h1>{{ meeting }}</h1>
2833
</ul>
2934
{% endif %}
3035

31-
<h2>Finances</h2>
36+
<h2>{% translate "Finances" %}</h2>
3237

33-
<h3>Balance</h3>
38+
<h3>{% translate "Balance" %}</h3>
3439

3540
<p>{{ meeting.treasurer_balance.currency.code }} {% money_localize meeting.treasurer_balance %}</p>
3641

3742
{% if meeting.treasurer_report %}
38-
<h3>Treasurer&#8217;s report</h3>
43+
<h3>{% translate "Treasurer&#8217;s report" %}</h3>
3944
{{ meeting.treasurer_report_html|safe }}
4045
{% endif %}
4146

4247
{% if meeting.grants_approved.all %}
43-
<h2>Grants approved </h2>
48+
<h2>{% translate "Grants approved" %}</h2>
4449

4550
<ul>
4651
{% for grant in meeting.grants_approved.all %}
@@ -50,7 +55,7 @@ <h2>Grants approved </h2>
5055
{% endif %}
5156

5257
{% if meeting.individual_members_approved.all %}
53-
<h2>Individual members approved</h2>
58+
<h2>{% translate "Individual members approved" %}</h2>
5459

5560
<ul>
5661
{% for member in meeting.individual_members_approved.all %}
@@ -60,7 +65,7 @@ <h2>Individual members approved</h2>
6065
{% endif %}
6166

6267
{% if meeting.corporate_members_approved.all %}
63-
<h2>Corporate members approved</h2>
68+
<h2>{% translate "Corporate members approved" %}</h2>
6469

6570
<ul>
6671
{% for member in meeting.corporate_members_approved.all %}
@@ -70,27 +75,27 @@ <h2>Corporate members approved</h2>
7075
{% endif %}
7176

7277
{% if ongoing_business %}
73-
<h2>Ongoing business</h2>
78+
<h2>{% translate "Ongoing business" %}</h2>
7479

7580
{% for business in ongoing_business %}
76-
<h3>{{ business.title }}</h2>
81+
<h3>{{ business.title }}</h3>
7782

7883
{{ business.body_html|safe }}
7984
{% endfor %}
8085
{% endif %}
8186

8287
{% if new_business %}
83-
<h2>New business</h2>
88+
<h2>{% translate "New business" %}</h2>
8489

8590
{% for business in new_business %}
86-
<h3>{{ business.title }}</h2>
91+
<h3>{{ business.title }}</h3>
8792

8893
{{ business.body_html|safe }}
8994
{% endfor %}
9095
{% endif %}
9196

9297
{% if meeting.action_items.all %}
93-
<h2>Action items</h2>
98+
<h2>{% translate "Action items" %}</h2>
9499

95100
<ul>
96101
{% for action_item in meeting.action_items.all %}

foundation/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.contrib import admin
22
from django.utils.text import slugify
3+
from django.utils.translation import gettext as _
34

45
from . import models
56

@@ -87,7 +88,7 @@ class MeetingAdmin(admin.ModelAdmin):
8788
prepopulated_fields = {"slug": ("title",)}
8889

8990
def get_changeform_initial_data(self, request):
90-
title = "DSF Board monthly meeting"
91+
title = _("DSF Board monthly meeting")
9192
return {
9293
"title": title,
9394
"slug": slugify(title),

foundation/feeds.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
from django.contrib.syndication.views import Feed
44
from django.utils.timezone import make_aware
5+
from django.utils.translation import gettext_lazy as _
56

67
from .models import Meeting
78

89

910
class FoundationMinutesFeed(Feed):
10-
title = "The DSF meeting minutes"
11+
title = _("The DSF meeting minutes")
1112
link = "https://www.djangoproject.com/foundation/minutes/"
12-
description = "The meeting minutes of the Django Software Foundation's board."
13+
description = _("The meeting minutes of the Django Software Foundation's board.")
1314

1415
def items(self):
1516
return Meeting.objects.order_by("-date")[:10]
@@ -18,7 +19,7 @@ def item_pubdate(self, item):
1819
return make_aware(datetime.combine(item.date, time.min))
1920

2021
def item_author_name(self, item):
21-
return "DSF Board"
22+
return _("DSF Board")
2223

2324
def item_title(self, item):
2425
return str(item)

foundation/models.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django.db import models
55
from django.urls import reverse
66
from django.utils.dateformat import format as date_format
7+
from django.utils.translation import gettext_lazy as _
78
from djmoney.models.fields import MoneyField
89
from djmoney.settings import CURRENCIES
910
from docutils.core import publish_parts
@@ -61,8 +62,8 @@ class NonBoardAttendee(models.Model):
6162
role = models.CharField(max_length=100)
6263

6364
class Meta:
64-
verbose_name = "Non-board attendee"
65-
verbose_name_plural = "Non-board attendees"
65+
verbose_name = _("Non-board attendee")
66+
verbose_name_plural = _("Non-board attendees")
6667

6768
def __str__(self):
6869
return f"{self.name} ({self.role})"
@@ -195,8 +196,8 @@ class Business(models.Model):
195196
ONGOING = "ongoing"
196197

197198
TYPE_CHOICES = (
198-
(NEW, "New"),
199-
(ONGOING, "Ongoing"),
199+
(NEW, _("New")),
200+
(ONGOING, _("Ongoing")),
200201
)
201202

202203
title = models.CharField(max_length=255)
@@ -209,7 +210,7 @@ class Business(models.Model):
209210

210211
class Meta:
211212
ordering = ("title",)
212-
verbose_name_plural = "Business"
213+
verbose_name_plural = _("Business")
213214

214215
def __str__(self):
215216
return self.title
@@ -248,11 +249,11 @@ class CoreAwardCohort(models.Model):
248249
name = models.CharField(
249250
max_length=255,
250251
unique=True,
251-
help_text="Name for the group being inducted, e.g. 'Q1 2021'",
252+
help_text=_("Name for the group being inducted, e.g. 'Q1 2021'"),
252253
)
253254
description = models.TextField(blank=True)
254255
cohort_date = models.DateField(
255-
help_text="Date this cohort was approved by the DSF Board",
256+
help_text=_("Date this cohort was approved by the DSF Board"),
256257
)
257258

258259
def __str__(self):
@@ -268,16 +269,16 @@ class CoreAward(models.Model):
268269
on_delete=models.CASCADE,
269270
)
270271
recipient = models.CharField(
271-
help_text="Recipient's name", max_length=1023, unique=True
272+
help_text=_("Recipient's name"), max_length=1023, unique=True
272273
)
273274
link = models.URLField(
274275
blank=True,
275276
null=True,
276-
help_text="Optional link for this recipient",
277+
help_text=_("Optional link for this recipient"),
277278
)
278279
description = models.TextField(
279280
blank=True,
280-
help_text=(
281+
help_text=_(
281282
"Optional one-paragraph description/bio of why this person "
282283
"received the award"
283284
),

0 commit comments

Comments
 (0)