Skip to content

Commit

Permalink
[foundation] Marked all user-facing strings for translation
Browse files Browse the repository at this point in the history
  • Loading branch information
marksweb authored Oct 25, 2024
1 parent c137adc commit a2ff929
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 51 deletions.
18 changes: 10 additions & 8 deletions djangoproject/templates/foundation/coreawardcohort_list.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{% extends "base_foundation.html" %}
{% load i18n %}

{% block og_title %}Django Core Developers{% endblock %}
{% block og_description %}Former Django Core Team dissolved on March 12, 2020.{% endblock %}
{% block og_title %}{% translate "Django Core Developers" %}{% endblock %}
{% block og_description %}{% translate "Former Django Core Team dissolved on March 12, 2020." %}{% endblock %}

{% block content %}
<h1>Django Core Developers</h1>
<h1>{% translate "Django Core Developers" %}</h1>

<p>
The title &ldquo;Django Core Developer&rdquo; is awarded to individuals
who have made significant contributions, over an extended period of time,
to Django or to major parts of its ecosystem. The title is awarded by the
Board of Directors of the Django Software Foundation.
A list of recipients is below.
{% blocktranslate trimmed %}
The title &ldquo;Django Core Developer&rdquo; is awarded to individuals
who have made significant contributions, over an extended period of time,
to Django or to major parts of its ecosystem. The title is awarded by the
Board of Directors of the Django Software Foundation.
A list of recipients is below.{% endblocktranslate %}
</p>
{% for cohort in object_list %}
<h2>{{ cohort }}</h2>
Expand Down
9 changes: 5 additions & 4 deletions djangoproject/templates/foundation/meeting_archive.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{% extends "base_foundation.html" %}
{% load i18n %}

{% block og_title %}Meeting minutes archive{% endblock %}
{% block og_description %}View meeting minutes{% endblock %}
{% block og_title %}{% translate "Meeting minutes archive" %}{% endblock %}
{% block og_description %}{% translate "View meeting minutes" %}{% endblock %}

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

{% block content %}
<h1>Meeting minutes archive</h1>
<h1>{% translate "Meeting minutes archive" %}</h1>

<p>Select a year to view meeting minutes:</p>
<p>{% translate "Select a year to view meeting minutes:" %}</p>

<ul>
{% for year in date_list %}
Expand Down
9 changes: 6 additions & 3 deletions djangoproject/templates/foundation/meeting_archive_day.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{% extends "base_foundation.html" %}
{% load i18n %}

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

{% block content %}
<h1>Meeting minutes archive: {{ day|date:"F j, Y" }}</h1>
<h1>{% blocktranslate trimmed with day=day|date:"DATE_FORMAT" %}
Meeting minutes archive: {{ day }}{% endblocktranslate %}</h1>

<ul>
{% for meeting in object_list %}
Expand Down
7 changes: 4 additions & 3 deletions djangoproject/templates/foundation/meeting_archive_month.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% extends "base_foundation.html" %}
{% load i18n %}

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

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

<ul>
{% for meeting in object_list %}
Expand Down
7 changes: 4 additions & 3 deletions djangoproject/templates/foundation/meeting_archive_year.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% extends "base_foundation.html" %}
{% load i18n %}

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

{% block content %}
<h1>Meeting minutes archive: {{ year|date:"Y" }}</h1>
<h1>{% blocktranslate with year=year|date:"Y" %}Meeting minutes archive: {{ year }}{% endblocktranslate %}</h1>

<ul>
{% for meeting in object_list %}
Expand Down
37 changes: 21 additions & 16 deletions djangoproject/templates/foundation/meeting_detail.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{% extends "base_foundation.html" %}
{% load i18n %}

{% block og_title %}Meeting minutes: {{ meeting }}{% endblock %}
{% block og_description %}Meeting minutes for {{ meeting }}{% endblock %}
{% block og_title %}{% blocktranslate %}Meeting minutes: {{ meeting }}{% endblocktranslate %}{% endblock %}
{% block og_description %}{% blocktranslate %}Meeting minutes for {{ meeting }}{% endblocktranslate %}{% endblock %}

{% block content %}
{% load djmoney %}

<h1>{{ meeting }}</h1>

<p>The meeting was led by {{ meeting.leader.account.get_full_name }}.</p>
<p>
{% blocktranslate trimmed with name=meeting.leader.account.get_full_name %}
The meeting was led by {{ name }}.
{% endblocktranslate %}
</p>

<p>Board members in attendance were:</p>
<p>{% translate "Board members in attendance were:" %}</p>

<ul>
{% for attendee in meeting.board_attendees.all %}
Expand All @@ -19,7 +24,7 @@ <h1>{{ meeting }}</h1>
</ul>

{% if meeting.non_board_attendees.all %}
<p>Also in attendance were:</p>
<p>{% translate "Also in attendance were:" %}</p>

<ul>
{% for attendee in meeting.non_board_attendees.all %}
Expand All @@ -28,19 +33,19 @@ <h1>{{ meeting }}</h1>
</ul>
{% endif %}

<h2>Finances</h2>
<h2>{% translate "Finances" %}</h2>

<h3>Balance</h3>
<h3>{% translate "Balance" %}</h3>

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

{% if meeting.treasurer_report %}
<h3>Treasurer&#8217;s report</h3>
<h3>{% translate "Treasurer&#8217;s report" %}</h3>
{{ meeting.treasurer_report_html|safe }}
{% endif %}

{% if meeting.grants_approved.all %}
<h2>Grants approved </h2>
<h2>{% translate "Grants approved" %}</h2>

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

{% if meeting.individual_members_approved.all %}
<h2>Individual members approved</h2>
<h2>{% translate "Individual members approved" %}</h2>

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

{% if meeting.corporate_members_approved.all %}
<h2>Corporate members approved</h2>
<h2>{% translate "Corporate members approved" %}</h2>

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

{% if ongoing_business %}
<h2>Ongoing business</h2>
<h2>{% translate "Ongoing business" %}</h2>

{% for business in ongoing_business %}
<h3>{{ business.title }}</h2>
<h3>{{ business.title }}</h3>

{{ business.body_html|safe }}
{% endfor %}
{% endif %}

{% if new_business %}
<h2>New business</h2>
<h2>{% translate "New business" %}</h2>

{% for business in new_business %}
<h3>{{ business.title }}</h2>
<h3>{{ business.title }}</h3>

{{ business.body_html|safe }}
{% endfor %}
{% endif %}

{% if meeting.action_items.all %}
<h2>Action items</h2>
<h2>{% translate "Action items" %}</h2>

<ul>
{% for action_item in meeting.action_items.all %}
Expand Down
3 changes: 2 additions & 1 deletion foundation/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.contrib import admin
from django.utils.text import slugify
from django.utils.translation import gettext as _

from . import models

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

def get_changeform_initial_data(self, request):
title = "DSF Board monthly meeting"
title = _("DSF Board monthly meeting")
return {
"title": title,
"slug": slugify(title),
Expand Down
7 changes: 4 additions & 3 deletions foundation/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

from django.contrib.syndication.views import Feed
from django.utils.timezone import make_aware
from django.utils.translation import gettext_lazy as _

from .models import Meeting


class FoundationMinutesFeed(Feed):
title = "The DSF meeting minutes"
title = _("The DSF meeting minutes")
link = "https://www.djangoproject.com/foundation/minutes/"
description = "The meeting minutes of the Django Software Foundation's board."
description = _("The meeting minutes of the Django Software Foundation's board.")

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

def item_author_name(self, item):
return "DSF Board"
return _("DSF Board")

def item_title(self, item):
return str(item)
21 changes: 11 additions & 10 deletions foundation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.db import models
from django.urls import reverse
from django.utils.dateformat import format as date_format
from django.utils.translation import gettext_lazy as _
from djmoney.models.fields import MoneyField
from djmoney.settings import CURRENCIES
from docutils.core import publish_parts
Expand Down Expand Up @@ -61,8 +62,8 @@ class NonBoardAttendee(models.Model):
role = models.CharField(max_length=100)

class Meta:
verbose_name = "Non-board attendee"
verbose_name_plural = "Non-board attendees"
verbose_name = _("Non-board attendee")
verbose_name_plural = _("Non-board attendees")

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

TYPE_CHOICES = (
(NEW, "New"),
(ONGOING, "Ongoing"),
(NEW, _("New")),
(ONGOING, _("Ongoing")),
)

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

class Meta:
ordering = ("title",)
verbose_name_plural = "Business"
verbose_name_plural = _("Business")

def __str__(self):
return self.title
Expand Down Expand Up @@ -248,11 +249,11 @@ class CoreAwardCohort(models.Model):
name = models.CharField(
max_length=255,
unique=True,
help_text="Name for the group being inducted, e.g. 'Q1 2021'",
help_text=_("Name for the group being inducted, e.g. 'Q1 2021'"),
)
description = models.TextField(blank=True)
cohort_date = models.DateField(
help_text="Date this cohort was approved by the DSF Board",
help_text=_("Date this cohort was approved by the DSF Board"),
)

def __str__(self):
Expand All @@ -268,16 +269,16 @@ class CoreAward(models.Model):
on_delete=models.CASCADE,
)
recipient = models.CharField(
help_text="Recipient's name", max_length=1023, unique=True
help_text=_("Recipient's name"), max_length=1023, unique=True
)
link = models.URLField(
blank=True,
null=True,
help_text="Optional link for this recipient",
help_text=_("Optional link for this recipient"),
)
description = models.TextField(
blank=True,
help_text=(
help_text=_(
"Optional one-paragraph description/bio of why this person "
"received the award"
),
Expand Down

0 comments on commit a2ff929

Please sign in to comment.