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:
parent
6c8dc942e8
commit
9819311403
41 changed files with 2801 additions and 326 deletions
|
|
@ -3,16 +3,18 @@
|
|||
/** @var string $content */
|
||||
/** @var array|null $user */
|
||||
$flashes = flash_pull();
|
||||
$locale = hub_locale();
|
||||
$next = (string) ($_SERVER['REQUEST_URI'] ?? '/');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<html lang="<?= e($locale) ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= e($title) ?> · Rinkplanner-Hub</title>
|
||||
<title><?= e($title) ?> · <?= e(t('app.name')) ?></title>
|
||||
<link rel="icon" type="image/png" href="<?= e(url('/assets/logo-icon.png')) ?>">
|
||||
<link rel="apple-touch-icon" href="<?= e(url('/assets/logo-icon.png')) ?>">
|
||||
<link rel="stylesheet" href="<?= e(url('/assets/hub.css')) ?>">
|
||||
<link rel="stylesheet" href="<?= e(url('/assets/hub.css') . '?v=' . HUB_ASSET_VERSION) ?>">
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
|
|
@ -22,19 +24,25 @@ $flashes = flash_pull();
|
|||
</a>
|
||||
<nav class="nav">
|
||||
<?php if ($user !== null): ?>
|
||||
<a href="<?= e(url('/')) ?>">Küren</a>
|
||||
<a href="<?= e(url('/upload')) ?>">Hochladen</a>
|
||||
<a href="<?= e(url('/')) ?>"><?= e(t('nav.routines')) ?></a>
|
||||
<a href="<?= e(url('/upload')) ?>"><?= e(t('nav.upload')) ?></a>
|
||||
<a href="<?= e(url('/account')) ?>"><?= e($user['display_name']) ?></a>
|
||||
<?php if (($user['role'] ?? '') === 'admin'): ?>
|
||||
<a class="nav-admin" href="<?= e(url('/admin/invites')) ?>">Verwaltung</a>
|
||||
<a class="nav-admin" href="<?= e(url('/admin/invites')) ?>"><?= e(t('nav.admin')) ?></a>
|
||||
<?php endif; ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/logout')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="link-button" type="submit">Abmelden</button>
|
||||
<button class="link-button" type="submit"><?= e(t('nav.logout')) ?></button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<a href="<?= e(url('/login')) ?>">Anmelden</a>
|
||||
<a href="<?= e(url('/login')) ?>"><?= e(t('nav.login')) ?></a>
|
||||
<?php endif; ?>
|
||||
<div class="lang-switch" role="group" aria-label="<?= e(t('nav.language')) ?>">
|
||||
<?php foreach (['de' => 'DE', 'en' => 'EN'] as $code => $label): ?>
|
||||
<a href="<?= e(url('/language') . '?lang=' . $code . '&next=' . rawurlencode($next)) ?>"
|
||||
lang="<?= e($code) ?>" hreflang="<?= e($code) ?>"<?= $locale === $code ? ' aria-current="true"' : '' ?>><?= $label ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
|
@ -44,7 +52,7 @@ $flashes = flash_pull();
|
|||
<?php foreach ($flashes as $flash): ?>
|
||||
<?php if (($flash['type'] ?? '') === 'secret'): ?>
|
||||
<div class="flash flash-secret">
|
||||
<strong><?= e($flash['label'] ?? 'Geheimnis') ?></strong>
|
||||
<strong><?= e($flash['label'] ?? t('flash.secret')) ?></strong>
|
||||
<code><?= e($flash['value'] ?? '') ?></code>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
|
@ -60,8 +68,8 @@ $flashes = flash_pull();
|
|||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<span>Geschlossene Beta · Rinkplanner-Hub</span>
|
||||
<a href="https://rinkplanner.programmschmiede.de/">Zur Rinkplanner-Seite</a>
|
||||
<span><?= e(t('footer.beta')) ?></span>
|
||||
<a href="https://rinkplanner.programmschmiede.de/"><?= e(t('footer.website')) ?></a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue