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

@ -157,7 +157,7 @@ function auth_require_admin(): array
{
$user = auth_require_login();
if ($user['role'] !== 'admin') {
abort_page(403, 'Dieser Bereich ist nur für Administratoren.');
abort_page(403, t('auth.admin_only'));
}
return $user;
}
@ -190,7 +190,7 @@ function auth_attempt(string $login, string $password): array
$retry = max(60, (int) $first + $window - time());
return [
'ok' => false,
'error' => 'Zu viele Fehlversuche. Bitte in ' . max(1, (int) ceil($retry / 60)) . ' Minuten erneut versuchen.',
'error' => t('login.error.rate_limited', ['minutes' => max(1, (int) ceil($retry / 60))]),
'retry' => $retry,
];
}
@ -213,10 +213,10 @@ function auth_attempt(string $login, string $password): array
}
if (!$user || !$valid) {
return ['ok' => false, 'error' => 'Benutzername oder Passwort ist falsch.', 'retry' => 0];
return ['ok' => false, 'error' => t('login.error.credentials'), 'retry' => 0];
}
if ($user['status'] !== 'active') {
return ['ok' => false, 'error' => 'Dieses Konto ist deaktiviert.', 'retry' => 0];
return ['ok' => false, 'error' => t('login.error.disabled'), 'retry' => 0];
}
if (password_needs_upgrade((string) $user['password_hash'])) {
db()->prepare('UPDATE users SET password_hash = ? WHERE id = ?')