Make user-facing strings translatable

Statistics labels, shop help text, and the confirm/form modal defaults
were plain strings; wrap them per CLAUDE.md's i18n convention so the
app stays translation-ready as it's written.
This commit is contained in:
2026-08-03 17:03:49 +02:00
parent 8598fd2b46
commit d5f45c9404
5 changed files with 40 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
{% load lucide %}
{% load i18n lucide %}
{% comment %}
A daisyUI native <dialog> confirmation modal for a destructive POST action with no
@@ -8,6 +8,7 @@
`_modal_form.html`, so it can share the `modal-action` row with the dialog-closing
Cancel button without nesting one <form> inside another.
{% endcomment %}
{% trans "Confirm" as default_submit_label %}
<dialog id="{{ modal_id }}" class="modal">
<div class="modal-box">
<h3 class="text-lg font-bold">{{ title }}</h3>
@@ -17,9 +18,9 @@
</form>
<div class="modal-action">
<form method="dialog">
<button class="btn btn-outline gap-2">{% lucide "x" size=16 %} Cancel</button>
<button class="btn btn-outline btn-neutral gap-2">{% lucide "x" size=16 %} {% trans "Cancel" %}</button>
</form>
<button class="btn btn-error gap-2" type="submit" form="{{ modal_id }}-form">{% lucide submit_icon|default:"trash-2" size=16 %} {{ submit_label|default:"Confirm" }}</button>
<button class="btn btn-error gap-2" type="submit" form="{{ modal_id }}-form">{% lucide submit_icon|default:"trash-2" size=16 %} {{ submit_label|default:default_submit_label }}</button>
</div>
</div>
<form method="dialog" class="modal-backdrop">

View File

@@ -1,4 +1,4 @@
{% load lucide %}
{% load i18n lucide %}
{% comment %}
A daisyUI native <dialog> modal wrapping a Django form that posts straight to
@@ -7,6 +7,7 @@
tag (linked via the `form` attribute) so it can share the `modal-action` row with the
dialog-closing Cancel button without nesting one <form> inside another.
{% endcomment %}
{% trans "Save" as default_submit_label %}
<dialog id="{{ modal_id }}" class="modal">
<div class="modal-box">
<h3 class="text-lg font-bold">{{ title }}</h3>
@@ -17,9 +18,9 @@
</form>
<div class="modal-action">
<form method="dialog">
<button class="btn btn-outline gap-2">{% lucide "x" size=16 %} Cancel</button>
<button class="btn btn-outline btn-neutral gap-2">{% lucide "x" size=16 %} {% trans "Cancel" %}</button>
</form>
<button class="btn btn-primary gap-2" type="submit" form="{{ modal_id }}-form">{% lucide submit_icon|default:"check" size=16 %} {{ submit_label|default:"Save" }}</button>
<button class="btn btn-primary gap-2" type="submit" form="{{ modal_id }}-form">{% lucide submit_icon|default:"check" size=16 %} {{ submit_label|default:default_submit_label }}</button>
</div>
</div>
<form method="dialog" class="modal-backdrop">