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

@ -17,26 +17,34 @@ $linkFor = static function (int $targetPage) use ($query): string {
?>
<div class="page-head">
<div>
<h1>Verwaltung</h1>
<p class="muted"><?= (int) $total ?> Küren insgesamt, auch versteckte.</p>
<h1><?= e(t('admin.title')) ?></h1>
<p class="muted"><?= e(t('admin_routines.lede', ['total' => (int) $total])) ?></p>
</div>
</div>
<?php $active = 'routines'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
<div class="toolbar">
<form method="get" action="<?= e(url('/admin/routines')) ?>" class="search">
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="Titel, Skater, Benutzer …">
<button type="submit">Suchen</button>
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="<?= e_attr(t('admin_routines.search_placeholder')) ?>">
<button type="submit"><?= e(t('dashboard.search')) ?></button>
</form>
</div>
<?php if (!$items): ?>
<div class="empty"><p>Keine Küren gefunden.</p></div>
<div class="empty"><p><?= e(t('admin_routines.empty')) ?></p></div>
<?php else: ?>
<div class="table-wrap">
<table class="list compact">
<thead>
<tr><th>Titel</th><th>Von</th><th>Status</th><th>Rev.</th><th>Aktualisiert</th><th>Downloads</th><th>Aktionen</th></tr>
<tr>
<th><?= e(t('table.title')) ?></th>
<th><?= e(t('table.by')) ?></th>
<th><?= e(t('table.status')) ?></th>
<th><?= e(t('table.revision')) ?></th>
<th><?= e(t('table.updated')) ?></th>
<th><?= e(t('table.downloads')) ?></th>
<th><?= e(t('table.actions')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $item): ?>
@ -53,19 +61,19 @@ $linkFor = static function (int $targetPage) use ($query): string {
<?= csrf_field() ?>
<input type="hidden" name="routine_id" value="<?= (int) $item['id'] ?>">
<input type="hidden" name="action" value="<?= $item['status'] === 'published' ? 'hide' : 'publish' ?>">
<button class="link-button" type="submit"><?= $item['status'] === 'published' ? 'verstecken' : 'veröffentlichen' ?></button>
<button class="link-button" type="submit"><?= e($item['status'] === 'published' ? t('admin_routines.hide') : t('admin_routines.publish')) ?></button>
</form>
<details class="danger-zone">
<summary>löschen</summary>
<summary><?= e(t('admin_routines.delete')) ?></summary>
<form method="post" action="<?= e(url('/admin/routines/action')) ?>" class="stack-tight">
<?= csrf_field() ?>
<input type="hidden" name="routine_id" value="<?= (int) $item['id'] ?>">
<input type="hidden" name="action" value="delete">
<label class="check small">
<input type="checkbox" name="confirm" value="1" required>
endgültig löschen
<?= e(t('admin_routines.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_routines.delete_submit')) ?></button>
</form>
</details>
</div>
@ -78,9 +86,9 @@ $linkFor = static function (int $targetPage) use ($query): string {
<?php if ($pages > 1): ?>
<nav class="pagination">
<?php if ($page > 1): ?><a href="<?= e($linkFor($page - 1)) ?>">← Zurück</a><?php endif; ?>
<span>Seite <?= (int) $page ?> von <?= (int) $pages ?></span>
<?php if ($page < $pages): ?><a href="<?= e($linkFor($page + 1)) ?>">Weiter →</a><?php endif; ?>
<?php if ($page > 1): ?><a href="<?= e($linkFor($page - 1)) ?>"><?= e(t('pagination.back')) ?></a><?php endif; ?>
<span><?= e(t('pagination.page', ['page' => (int) $page, 'pages' => (int) $pages])) ?></span>
<?php if ($page < $pages): ?><a href="<?= e($linkFor($page + 1)) ?>"><?= e(t('pagination.next')) ?></a><?php endif; ?>
</nav>
<?php endif; ?>
<?php endif; ?>