i18n on the web - deepseek translations

This commit is contained in:
Priec
2026-08-14 20:35:37 +02:00
parent 2dc0d94ba0
commit 8f1bfdbe0c
91 changed files with 4679 additions and 1237 deletions

View File

@@ -2,31 +2,31 @@
{% extends "ui/form_page.html" %}
{% import "ui/alert.html" as alert %}
{% block title %}Add field validation{% endblock %}
{% block eyebrow %}Validation{% endblock %}
{% block heading %}Add field validation{% endblock %}
{% block lead %}<p>Attach validation to one column of one table.</p>{% endblock %}
{% block title %}{{ nav.tr("validation-field-title") }}{% endblock %}
{% block eyebrow %}{{ nav.tr("validation-eyebrow") }}{% endblock %}
{% block heading %}{{ nav.tr("validation-field-title") }}{% endblock %}
{% block lead %}<p>{{ nav.tr("validation-field-lead") }}</p>{% endblock %}
{% block form %}
<form hx-post="/admin/validation" hx-target="#submission-status" hx-swap="innerHTML">
<div class="form-grid">
<label>Profile<input name="profile_name" list="profiles" value="{{ page.form.profile_name }}" required></label>
<label>Table<input name="table_name" list="tables" value="{{ page.form.table_name }}" required></label>
<label>Column<input name="data_key" value="{{ page.form.data_key }}" required></label>
<label class="wide">Apply named validation set instead
<label>{{ nav.tr("validation-profile") }}<input name="profile_name" list="profiles" value="{{ page.form.profile_name }}" required></label>
<label>{{ nav.tr("validation-table") }}<input name="table_name" list="tables" value="{{ page.form.table_name }}" required></label>
<label>{{ nav.tr("validation-column") }}<input name="data_key" value="{{ page.form.data_key }}" required></label>
<label class="wide">{{ nav.tr("validation-apply-set") }}
<input name="validation_set_name" value="{{ page.form.validation_set_name }}"
placeholder="Leave empty to save the rules below">
placeholder="{{ nav.tr("validation-apply-set-placeholder") }}">
</label>
{% include "pages/add_validation/shared_fields.html" %}
</div>
<datalist id="profiles">{% for profile in page.profiles %}<option value="{{ profile }}"></option>{% endfor %}</datalist>
<datalist id="tables">{% for table in page.tables %}<option value="{{ table }}"></option>{% endfor %}</datalist>
<div id="submission-status" aria-live="polite">
{%- if let Some(message) = page.error %}{% call alert::error("Could not save validation", message) %}{% endcall %}{% endif -%}
{%- if let Some(message) = page.error %}{% call alert::error(nav.locale, nav.tr("validation-error-title"), message) %}{% endcall %}{% endif -%}
</div>
<div class="form-actions">
<a href="/admin">Cancel</a>
<button type="submit">Save validation</button>
<a href="/admin">{{ nav.tr("common-cancel") }}</a>
<button type="submit">{{ nav.tr("validation-save") }}</button>
</div>
</form>
{% endblock %}

View File

@@ -2,24 +2,24 @@
{% extends "ui/form_page.html" %}
{% import "ui/alert.html" as alert %}
{% block title %}Add reusable validation rule{% endblock %}
{% block eyebrow %}Global validation library{% endblock %}
{% block heading %}Add reusable validation rule{% endblock %}
{% block lead %}<p>A named rule that validation sets can compose, independent of any table.</p>{% endblock %}
{% block title %}{{ nav.tr("validation-rule-title") }}{% endblock %}
{% block eyebrow %}{{ nav.tr("validation-library-eyebrow") }}{% endblock %}
{% block heading %}{{ nav.tr("validation-rule-title") }}{% endblock %}
{% block lead %}<p>{{ nav.tr("validation-rule-lead") }}</p>{% endblock %}
{% block form %}
<form hx-post="/admin/validation/rules" hx-target="#submission-status" hx-swap="innerHTML">
<div class="form-grid">
<label>Rule name<input name="rule_name" value="{{ page.form.rule_name }}" required></label>
<label>Description<input name="description" value="{{ page.form.description }}"></label>
<label>{{ nav.tr("validation-rule-name") }}<input name="rule_name" value="{{ page.form.rule_name }}" required></label>
<label>{{ nav.tr("validation-description") }}<input name="description" value="{{ page.form.description }}"></label>
{% include "pages/add_validation/shared_fields.html" %}
</div>
<div id="submission-status" aria-live="polite">
{%- if let Some(message) = page.error %}{% call alert::error("Could not save validation", message) %}{% endcall %}{% endif -%}
{%- if let Some(message) = page.error %}{% call alert::error(nav.locale, nav.tr("validation-error-title"), message) %}{% endcall %}{% endif -%}
</div>
<div class="form-actions">
<a href="/admin">Cancel</a>
<button type="submit">Save rule</button>
<a href="/admin">{{ nav.tr("common-cancel") }}</a>
<button type="submit">{{ nav.tr("validation-save-rule") }}</button>
</div>
</form>
{% endblock %}

View File

@@ -2,27 +2,27 @@
{% extends "ui/form_page.html" %}
{% import "ui/alert.html" as alert %}
{% block title %}Add validation set{% endblock %}
{% block eyebrow %}Global validation library{% endblock %}
{% block heading %}Add validation set{% endblock %}
{% block lead %}<p>Compose an ordered set from existing reusable rule names.</p>{% endblock %}
{% block title %}{{ nav.tr("validation-set-title") }}{% endblock %}
{% block eyebrow %}{{ nav.tr("validation-library-eyebrow") }}{% endblock %}
{% block heading %}{{ nav.tr("validation-set-title") }}{% endblock %}
{% block lead %}<p>{{ nav.tr("validation-set-lead") }}</p>{% endblock %}
{% block form %}
<form hx-post="/admin/validation/sets" hx-target="#submission-status" hx-swap="innerHTML">
<div class="form-grid">
<label>Set name<input name="name" value="{{ form.name }}" required></label>
<label>Description<input name="description" value="{{ form.description }}"></label>
<label class="wide">Reusable rules
<label>{{ nav.tr("validation-set-name") }}<input name="name" value="{{ form.name }}" required></label>
<label>{{ nav.tr("validation-description") }}<input name="description" value="{{ form.description }}"></label>
<label class="wide">{{ nav.tr("validation-reusable-rules") }}
<input name="global_rules" value="{{ form.global_rules }}" required placeholder="required, invoice-number, max-length">
<small>Comma-separated and applied in this order.</small>
<small>{{ nav.tr("validation-reusable-rules-hint") }}</small>
</label>
</div>
<div id="submission-status" aria-live="polite">
{%- if let Some(message) = error %}{% call alert::error("Could not save validation", message) %}{% endcall %}{% endif -%}
{%- if let Some(message) = error %}{% call alert::error(nav.locale, nav.tr("validation-error-title"), message) %}{% endcall %}{% endif -%}
</div>
<div class="form-actions">
<a href="/admin">Cancel</a>
<button type="submit">Save set</button>
<a href="/admin">{{ nav.tr("common-cancel") }}</a>
<button type="submit">{{ nav.tr("validation-save-set") }}</button>
</div>
</form>
{% endblock %}

View File

@@ -2,33 +2,32 @@
Validation inputs shared by the field-validation and reusable-rule pages.
Reads `page.form` (crate::pages::add_validation::state::ValidationForm).
#}
<label class="wide">Position rules
<label class="wide">{{ nav.tr("validation-position-rules") }}
<textarea name="pattern_rules" rows="6"
placeholder="0-3 | alphabetic&#10;4,5 | one-of=-,+&#10;6+ | regex=[0-9]">{{ page.form.pattern_rules }}</textarea>
<small>One per line: position | constraint. Positions: 0, 0-3, 4+, or 1,3,5.
Constraints: alphabetic, numeric, alphanumeric, exact=x, one-of=a,b, regex=…</small>
<small>{{ nav.tr("validation-position-rules-hint") }}</small>
</label>
<label class="wide">Pattern description<input name="pattern_description" value="{{ page.form.pattern_description }}"></label>
<label class="wide">{{ nav.tr("validation-pattern-description") }}<input name="pattern_description" value="{{ page.form.pattern_description }}"></label>
<label>Minimum length<input name="minimum" type="number" min="0" value="{{ page.form.minimum }}"></label>
<label>Maximum length<input name="maximum" type="number" min="0" value="{{ page.form.maximum }}"></label>
<label>Warning threshold<input name="warn_at" type="number" min="0" value="{{ page.form.warn_at }}"></label>
<label>Count mode
<label>{{ nav.tr("validation-min-length") }}<input name="minimum" type="number" min="0" value="{{ page.form.minimum }}"></label>
<label>{{ nav.tr("validation-max-length") }}<input name="maximum" type="number" min="0" value="{{ page.form.maximum }}"></label>
<label>{{ nav.tr("validation-warn-at") }}<input name="warn_at" type="number" min="0" value="{{ page.form.warn_at }}"></label>
<label>{{ nav.tr("validation-count-mode") }}
<select name="count_mode">
<option value="chars">Characters</option>
<option value="bytes" {% if page.form.count_mode == "bytes" %}selected{% endif %}>Bytes</option>
<option value="display-width" {% if page.form.count_mode == "display-width" %}selected{% endif %}>Display width</option>
<option value="chars">{{ nav.tr("validation-count-chars") }}</option>
<option value="bytes" {% if page.form.count_mode == "bytes" %}selected{% endif %}>{{ nav.tr("validation-count-bytes") }}</option>
<option value="display-width" {% if page.form.count_mode == "display-width" %}selected{% endif %}>{{ nav.tr("validation-count-display-width") }}</option>
</select>
</label>
<label class="wide">Allowed values<input name="allowed_values" value="{{ page.form.allowed_values }}" placeholder="draft, issued, paid"></label>
<label>Display mask<input name="mask_pattern" value="{{ page.form.mask_pattern }}" placeholder="####-##-##"></label>
<label>Mask input character<input name="mask_input_char" value="{{ page.form.mask_input_char }}" placeholder="#"></label>
<label>Mask template character<input name="mask_template_char" value="{{ page.form.mask_template_char }}" placeholder="_"></label>
<label class="wide">{{ nav.tr("validation-allowed-values") }}<input name="allowed_values" value="{{ page.form.allowed_values }}" placeholder="draft, issued, paid"></label>
<label>{{ nav.tr("validation-display-mask") }}<input name="mask_pattern" value="{{ page.form.mask_pattern }}" placeholder="####-##-##"></label>
<label>{{ nav.tr("validation-mask-input-char") }}<input name="mask_input_char" value="{{ page.form.mask_input_char }}" placeholder="#"></label>
<label>{{ nav.tr("validation-mask-template-char") }}<input name="mask_template_char" value="{{ page.form.mask_template_char }}" placeholder="_"></label>
<div class="check-group">
<label class="check"><input type="checkbox" name="required" value="true" {% if page.form.required %}checked{% endif %}>Required</label>
<label class="check"><input type="checkbox" name="allow_empty" value="true" {% if page.form.allow_empty %}checked{% endif %}>Allow empty</label>
<label class="check"><input type="checkbox" name="case_insensitive" value="true" {% if page.form.case_insensitive %}checked{% endif %}>Case insensitive</label>
<label class="check"><input type="checkbox" name="external_validation_enabled" value="true" {% if page.form.external_validation_enabled %}checked{% endif %}>External validation</label>
<label class="check"><input type="checkbox" name="locked" value="true" {% if page.form.locked %}checked{% endif %}>Lock configuration</label>
<label class="check"><input type="checkbox" name="required" value="true" {% if page.form.required %}checked{% endif %}>{{ nav.tr("validation-required") }}</label>
<label class="check"><input type="checkbox" name="allow_empty" value="true" {% if page.form.allow_empty %}checked{% endif %}>{{ nav.tr("validation-allow-empty") }}</label>
<label class="check"><input type="checkbox" name="case_insensitive" value="true" {% if page.form.case_insensitive %}checked{% endif %}>{{ nav.tr("validation-case-insensitive") }}</label>
<label class="check"><input type="checkbox" name="external_validation_enabled" value="true" {% if page.form.external_validation_enabled %}checked{% endif %}>{{ nav.tr("validation-external") }}</label>
<label class="check"><input type="checkbox" name="locked" value="true" {% if page.form.locked %}checked{% endif %}>{{ nav.tr("validation-lock") }}</label>
</div>