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:
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user