Skip to content

Commit 7e9efbf

Browse files
committed
i18n + l10n de
1 parent 14042a0 commit 7e9efbf

24 files changed

+426
-159
lines changed

froide/account/forms.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,15 @@ class NewUserBaseForm(AddressBaseForm):
141141
required=False,
142142
initial=False,
143143
widget=BootstrapRadioSelect,
144-
label=_("For journalists"),
144+
label=_("{site_name} for journalists").format(site_name=settings.SITE_NAME),
145145
help_text=_(
146-
"You work in journalism and would like to use this platform for your research? Shortly after your sign-up is completed, we will send you additional information about extra functionality for journalists."
146+
_(
147+
"You work in journalism and would like to use {site_name} for your research? Shortly after your sign-up is completed, we will send you additional information about extra functionality for journalists."
148+
).format(site_name=settings.SITE_NAME)
147149
),
148150
choices=[
149-
(False, _("No, I am not a journalist")),
150-
(True, _("Yes, I am a journalist")),
151+
(False, _("No, I am <strong>not a journalist</strong>")),
152+
(True, _("Yes, I am <strong>a journalist</strong>")),
151153
],
152154
coerce=lambda x: x and (x.lower() != "false"),
153155
)
@@ -160,11 +162,13 @@ class NewUserBaseForm(AddressBaseForm):
160162
widget=BootstrapRadioSelect,
161163
label=_("Hide my name from public view"),
162164
choices=[
163-
# TODO i18n
164-
# TODO <b>plain text
165-
(False, "My name may appear on the website in plain text"),
166-
# TODO <b>redacted
167-
(True, "My name must be redacted"),
165+
(
166+
False,
167+
_(
168+
"My name may appear on the website in <strong>plain text</strong>"
169+
),
170+
),
171+
(True, _("My name must be <strong>redacted</strong>")),
168172
],
169173
coerce=lambda x: x and (x.lower() != "false"),
170174
)

froide/foirequest/api_views/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.contrib.auth import get_user_model
22
from django.db.models import Q
3+
from django.utils.translation import gettext_lazy as _
34

45
from django_filters import rest_framework as filters
56
from rest_framework import mixins, permissions, status, throttling, viewsets
@@ -79,11 +80,10 @@ class FoiRequestFilter(filters.FilterSet):
7980
queryset=filter_by_authenticated_user_queryset, method="follower_filter"
8081
)
8182
costs = filters.RangeFilter()
82-
# TODO i18n
8383
campaign = filters.ModelChoiceFilter(
8484
queryset=Campaign.objects.filter(public=True),
8585
null_value="-",
86-
null_label="No Campaign",
86+
null_label=_("no campaign"),
8787
lookup_expr="isnull",
8888
method="campaign_filter",
8989
)

froide/foirequest/forms/request.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,15 @@ class RequestForm(JSONMixin, forms.Form):
6868
choices=[
6969
(
7070
True,
71-
# TODO i18n
72-
"Die Anfrage soll sofort öffentlich auf dieser Website erscheinen. (Standardeinstellung)",
71+
_(
72+
"I want the request to be immediately accessible to the <strong>public</strong> on this website. (Default)"
73+
),
7374
),
7475
(
7576
False,
76-
"Die Anfrage soll vorerst nicht öffentlich auf dieser Website erscheinen, sondern erst später veröffentlicht werden.",
77+
_(
78+
"I want the request to remain <strong>not public</strong> for now, and publish it later."
79+
),
7780
),
7881
],
7982
coerce=lambda x: x and (x.lower() != "false"),

froide/foirequest/templates/foirequest/request.html

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@
6868
alt=""
6969
class="campaign-logo d-block object-fit-contain w-100 mb-3" />
7070
{% endif %}
71-
<h2 class="fs-4">
72-
Mitmachen bei {# TODO i18n #}
73-
{{ campaign.name }}
74-
</h2>
71+
<h2 class="fs-4">{% blocktrans with name=campaign.name %}Participate in {{ name }}{% endblocktrans %}</h2>
7572
{% if campaign.short_description %}<div class="fs-6">{{ campaign.short_description|markdown }}</div>{% endif %}
7673
<div class="mt-auto">
7774
<a href="{{ campaign.url }}" class="btn btn-primary w-100">{% trans "Make a request" %}</a>
@@ -114,23 +111,18 @@ <h2>{% blocktrans %}Write the request{% endblocktrans %}</h2>
114111
<template data-slot="loginlink">
115112
<a href="{% url 'account-login' %}?next={{ request.get_full_path|urlencode }}">{% trans "Zum Login" %}</a>
116113
</template>
114+
<template data-slot="user-public-preamble">
115+
{% blocktrans %}<p>Your name will be sent to public bodies. If you want to remain anonymous to the public, you can choose to not display your name on the website. Your name will then be redacted.</p>{% endblocktrans %}
116+
</template>
117117
<template data-slot="request-public-preamble">
118-
{% blocktrans %}
119-
<p>Ihre Anfrage ist für alle auf dieser Website sichtbar.
120-
Denn Sie tragen mit Ihrer Anfrage zu einem öffentlichen Archiv amtlicher Informationen bei und sorgen so mit einer wachsenden Community für Transparenz in Politik und Verwaltung.</p>
121-
<p>Auf Wunsch können Sie Ihre Anfrage aber erst später öffentlich machen, z.B. nach Veröffentlichung Ihrer investigativen Recherche.</p>
122-
{% endblocktrans %}
118+
{% blocktrans %}<p>Your request is accesible for everybody on this website. With your request, you contribute to a public archive of official information. You are part of a growing community that strives for transparency in politics and adminstration.</p><p>You can opt into publishing your request later, e.g. after the disclosure of your investigation or research.</p>{% endblocktrans %}
123119
</template>
124120
<template data-slot="request-public-postamble">
125121
{% if request.user.is_authenticated %}
126122
{% url 'account-settings' as profile_url %}
127-
{% blocktrans with profilelink=profile_url %}
128-
Ob Ihr Name im Klartext erscheinen sollen, können Sie <a target="_blank" href="{{ profile_url }}">in ihrem Profil</a> anpassen.
129-
{% endblocktrans %}
123+
{% blocktrans with profilelink=profile_url %}In your <a target="_blank" href="{{ profile_url }}">profile settings</a> you can decide whether to your name should be redacted.{% endblocktrans %}
130124
{% else %}
131-
{% blocktrans %}
132-
Ihre Entscheidung hier hat keinen Einfluss darauf ob ihr Name im Klartext erscheinen soll (wie zuvor festgelegt).
133-
{% endblocktrans %}
125+
{% blocktrans %}Your decision here does not affect whether your name will appear in plain text or redacted (as you have decided previously).{% endblocktrans %}
134126
{% endif %}
135127
</template>
136128
</request-page>
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
{% load i18n %}
2-
{# TODO i18n #}
3-
{% blocktrans %}
4-
Ich versichere, dass ich <strong>keine persönlichen Informationen über mich selbst anfrage.</strong>
5-
{% endblocktrans %}
2+
{% blocktrans %}I confirm that I am <strong>not requesting personal information</strong> about myself.{% endblocktrans %}

froide/foirequest/views/make_request.py

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,14 @@ def get_js_context(self):
203203
"requests": _("requests"),
204204
"close": _("close"),
205205
"back": _("Back"),
206-
# TODO i18n
207-
"stepNext": _("Next"), # pgettext("Make request", "Next"),
206+
"stepNext": _("Next"),
208207
"step": _("Step"),
209208
"introduction": _("Introduction"),
210209
"similarRequests": _("Similar requests"),
210+
"findSimilarRequests": _("Find similar requests"),
211+
"currentlyChosen": _("Currently chosen:"),
212+
"requestVisibility": _("Public visibility of the request"),
213+
"previewAndSubmit": _("Preview & submit"),
211214
"address": _("Address"),
212215
"account": pgettext("Make request breadcrumbs/stepper", "Account"),
213216
"writeMessage": _("Write message"),
@@ -229,6 +232,7 @@ def get_js_context(self):
229232
),
230233
"selectPublicBodies": _("Select public bodies"),
231234
"continue": _("continue"),
235+
"continueWithSelected": _("Continue with selected"),
232236
"selectAll": [_("select one"), _("select all")],
233237
"selectingAll": _("Selecting all public bodies, please wait..."),
234238
"name": _("Name"),
@@ -346,6 +350,65 @@ def get_js_context(self):
346350
count="${count}"
347351
),
348352
],
353+
"results": [
354+
_("One result"),
355+
_("{count} results").format(count="${count}"),
356+
],
357+
"createAccount": _("Create account"),
358+
"createAccountPreamble": _(
359+
"You need to create an account at {site_name} so you will be able to manage your request."
360+
).format(site_name=settings.SITE_NAME),
361+
"skipIntroHowto": _(
362+
"Skip this part next time and start at “Choose public body” (optional)"
363+
),
364+
"error": _("Error"),
365+
"none": _("None chosen"),
366+
"toPb": _("To:"),
367+
"to": _("to"),
368+
"requestTo": _("Request to:"),
369+
"correct": _("Correct"),
370+
"fixPlaceholder": _("Fix placeholders automatically"),
371+
"updatePostalAddress": _("Update my postal address"),
372+
"subjectMeaningful": _("Please write a meaningful subject"),
373+
"containsPlaceholderMarker": _(
374+
"The body contains an illegal placeholder ({placeholder})."
375+
).format(placeholder="${placeholder}"),
376+
"pagination": _("Pagination"),
377+
"publicbody": _("Public body"),
378+
"requestBody": _("Request body"),
379+
"request": _("request"),
380+
"visibility": _("Visibility"),
381+
"notConfirmed": _("Not confirmed"),
382+
"notAgreed": _("Not agreed"),
383+
"publishNow": _("Publish request now"),
384+
"publishLater": _("Publish request later"),
385+
"help": _("Help"),
386+
"privacy": _("Privacy"),
387+
"privacyMoreInfo": _("More information about privacy on this website"),
388+
"nameRedact": _("My name must be <strong>redacted</strong>"),
389+
"namePlainText": _(
390+
"My name may appear on the website in <strong>plain text</strong>"
391+
),
392+
"email": _("Email"),
393+
"notSentToPb": _("(not sent to public body)"),
394+
"terms": _("Terms of Use"),
395+
"searchToPbName": _("to %(name)s") % {"name": "${name}"},
396+
"searchToProject": _(
397+
'to <a href="%(url)s">%(name)s</a> and <a href="%(urlp)s">%(count)s other public bodies</a>'
398+
)
399+
% {
400+
"name": "${name}",
401+
"url": "${url}",
402+
"urlp": "${urlp}",
403+
"count": "${count}",
404+
},
405+
"notYetSet": _("Not yet set"),
406+
"searchSelectThisPb": _("Select this public body"),
407+
"dateRange": _("Date range"),
408+
"dateRangeFrom": _("From"),
409+
"dateRangeTo": _("Until"),
410+
"campaign": _("Campaign"),
411+
"toggleCollapse": _("Toggle collapse"),
349412
},
350413
"regex": {
351414
"greetings": [_("Dear Sir or Madam")],

0 commit comments

Comments
 (0)