summaryrefslogtreecommitdiff
path: root/foundation
diff options
context:
space:
mode:
authorMark Walker <mark@marksweb.co.uk>2024-10-25 17:16:28 +0100
committerGitHub <noreply@github.com>2024-10-25 18:16:28 +0200
commita2ff92996480c90a71e7278b12ac24c721e0be69 (patch)
tree857845bba7e4ba60dbb80bfaef27069b5253fed5 /foundation
parentc137adc6ad19ab13adc7b16dcdc23da435600f17 (diff)
[foundation] Marked all user-facing strings for translation
Refs #1648
Diffstat (limited to 'foundation')
-rw-r--r--foundation/admin.py3
-rw-r--r--foundation/feeds.py7
-rw-r--r--foundation/models.py21
3 files changed, 17 insertions, 14 deletions
diff --git a/foundation/admin.py b/foundation/admin.py
index 9ad01e77..1c905040 100644
--- a/foundation/admin.py
+++ b/foundation/admin.py
@@ -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
@@ -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),
diff --git a/foundation/feeds.py b/foundation/feeds.py
index 59706f3b..072a9c8e 100644
--- a/foundation/feeds.py
+++ b/foundation/feeds.py
@@ -2,14 +2,15 @@ from datetime import datetime, time
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]
@@ -18,7 +19,7 @@ class FoundationMinutesFeed(Feed):
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)
diff --git a/foundation/models.py b/foundation/models.py
index ddbb4517..598ee211 100644
--- a/foundation/models.py
+++ b/foundation/models.py
@@ -4,6 +4,7 @@ from django.conf import settings
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
@@ -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})"
@@ -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)
@@ -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
@@ -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):
@@ -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"
),