feat: Website und Hub zweisprachig (Deutsch/Englisch)

Website (rinkplanner.programmschmiede.de) liegt jetzt im Repo unter web/:
Sprachweiche nach Accept-Language (der User-Agent enthält keine Sprache),
/de/ und /en/ als eigene URLs mit hreflang, Cookie für die manuelle Wahl,
Texte in web/i18n.php, Markup in web/template.php. Deployment über
tools/deploy_web.sh (--sync, --check, --all); /index.html leitet weiter.

Hub: optionale englische Oberfläche über den DE/EN-Umschalter, Cookie
RHUB_LANG, Route /language. Alle Texte (Views, Meldungen, Validierung,
API-messages) stehen in hub/app/i18n_strings.php und laufen über t();
Datum und Zahlen folgen der Sprache. Die API behält ihre code-Felder und
antwortet ohne Cookie weiter deutsch.

deploy_hub.sh --check prüft jetzt Schlüsselparität und fehlende t()-Schlüssel.
Doku: docs/website.md neu, docs/hub.md und AGENTS.md ergänzt.
This commit is contained in:
torsten 2026-11-12 22:38:32 +01:00
parent 6c8dc942e8
commit 9819311403
41 changed files with 2801 additions and 326 deletions

View file

@ -2,18 +2,26 @@
<?php $me = auth_user(); ?>
<div class="page-head">
<div>
<h1>Verwaltung</h1>
<p class="muted">Beta-Konten verwalten.</p>
<h1><?= e(t('admin.title')) ?></h1>
<p class="muted"><?= e(t('admin_users.lede')) ?></p>
</div>
</div>
<?php $active = 'users'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
<section class="panel">
<h2>Benutzer</h2>
<h2><?= e(t('admin.tab_users')) ?></h2>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr><th>Benutzer</th><th>Rolle</th><th>Status</th><th>Küren</th><th>Registriert</th><th>Letzte Anmeldung</th><th>Aktionen</th></tr>
<tr>
<th><?= e(t('admin.tab_users')) ?></th>
<th><?= e(t('table.role')) ?></th>
<th><?= e(t('table.status')) ?></th>
<th><?= e(t('table.routines')) ?></th>
<th><?= e(t('table.registered')) ?></th>
<th><?= e(t('table.last_login')) ?></th>
<th><?= e(t('table.actions')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user): ?>
@ -25,10 +33,10 @@
<div class="muted small"><?= e($user['email']) ?></div>
<?php endif; ?>
</td>
<td><?= $user['role'] === 'admin' ? 'Admin' : 'Nutzer' ?></td>
<td><?= e($user['role'] === 'admin' ? t('admin_users.role_admin') : t('admin_users.role_user')) ?></td>
<td>
<span class="status status-<?= $user['status'] === 'active' ? 'open' : 'expired' ?>">
<?= $user['status'] === 'active' ? 'aktiv' : 'gesperrt' ?>
<?= e($user['status'] === 'active' ? t('status.active') : t('status.blocked')) ?>
</span>
</td>
<td><?= (int) $user['routine_count'] ?></td>
@ -36,7 +44,7 @@
<td><?= e(fmt_dt($user['last_login_at'])) ?></td>
<td>
<?php if ((int) $user['id'] === (int) $me['id']): ?>
<span class="muted small">eigenes Konto</span>
<span class="muted small"><?= e(t('admin_users.self')) ?></span>
<?php else: ?>
<div class="row-actions">
<?php if ($user['status'] === 'active'): ?>
@ -44,33 +52,33 @@
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="disable">
<button class="link-button danger" type="submit">sperren</button>
<button class="link-button danger" type="submit"><?= e(t('admin_users.block')) ?></button>
</form>
<?php else: ?>
<form class="inline" method="post" action="<?= e(url('/admin/users/action')) ?>">
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="enable">
<button class="link-button" type="submit">entsperren</button>
<button class="link-button" type="submit"><?= e(t('admin_users.unblock')) ?></button>
</form>
<?php endif; ?>
<form class="inline" method="post" action="<?= e(url('/admin/users/action')) ?>">
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="reset">
<button class="link-button" type="submit">Passwort zurücksetzen</button>
<button class="link-button" type="submit"><?= e(t('admin_users.reset')) ?></button>
</form>
<details class="danger-zone">
<summary>löschen</summary>
<summary><?= e(t('admin_users.delete')) ?></summary>
<form method="post" action="<?= e(url('/admin/users/action')) ?>" class="stack-tight">
<?= csrf_field() ?>
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
<input type="hidden" name="action" value="delete">
<label class="check small">
<input type="checkbox" name="confirm" value="1" required>
mit allen Küren löschen
<?= e(t('admin_users.delete_confirm')) ?>
</label>
<button class="link-button danger" type="submit">Löschen bestätigen</button>
<button class="link-button danger" type="submit"><?= e(t('admin_users.delete_submit')) ?></button>
</form>
</details>
</div>