Add i18n support for French and German with browser language detection
CI / test-and-package (push) Successful in 35s

This commit is contained in:
agentbox
2026-08-01 06:00:29 +00:00
parent 218e2b6fb0
commit b46691fee3
9 changed files with 519 additions and 78 deletions
+14 -14
View File
@@ -1,54 +1,54 @@
{% extends "base.html" %}
{% block title %}Register — Meal Tracker{% endblock %}
{% block title %}{{ t('Register — Meal Tracker') }}{% endblock %}
{% block content %}
<div class="form-card register-card">
<h2>Create Account</h2>
<h2>{{ t('Create Account') }}</h2>
<form method="POST">
<label for="username">Username</label>
<label for="username">{{ t('Username') }}</label>
<input type="text" id="username" name="username" required autofocus>
<label for="password">Password</label>
<label for="password">{{ t('Password') }}</label>
<input type="password" id="password" name="password" required>
<label for="confirm">Confirm Password</label>
<label for="confirm">{{ t('Confirm Password') }}</label>
<input type="password" id="confirm" name="confirm" required>
<fieldset class="household-section">
<legend>Household</legend>
<legend>{{ t('Household') }}</legend>
<label class="radio-label">
<input type="radio" name="household_action" value="join" id="radio-join" checked>
Join an existing household
{{ t('Join an existing household') }}
</label>
<div id="join-block" class="household-block">
<select name="household_id" class="select-input">
<option value="">— Select —</option>
<option value="">{{ t('— Select —') }}</option>
{% for h in households %}
<option value="{{ h.id }}">{{ h.name }}</option>
{% endfor %}
</select>
{% if not households %}
<p class="hint">No households yet. Create one below!</p>
<p class="hint">{{ t('No households yet. Create one below!') }}</p>
{% endif %}
</div>
<label class="radio-label">
<input type="radio" name="household_action" value="create" id="radio-create"
{% if not households %}checked{% endif %}>
Create a new household
{{ t('Create a new household') }}
</label>
<div id="create-block" class="household-block">
<input type="text" name="new_household_name"
placeholder="Household name (e.g. The Smiths)"
placeholder="{{ t('Household name (e.g. The Smiths)') }}"
class="text-input">
<p class="hint">You'll be the admin of this household.</p>
<p class="hint">{{ t("You'll be the admin of this household.") }}</p>
</div>
</fieldset>
<button type="submit" class="btn btn-primary">Register</button>
<button type="submit" class="btn btn-primary">{{ t('Register') }}</button>
</form>
<p class="form-footer">
Already have an account? <a href="{{ url_for('auth.login') }}">Log in</a>
{{ t('Already have an account?') }} <a href="{{ url_for('auth.login') }}">{{ t('Log in') }}</a>
</p>
</div>