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
234
web/template.php
Normal file
234
web/template.php
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
// Gemeinsames Markup für /de/ und /en/. Texte kommen aus i18n.php.
|
||||
// Erwartet: $lang ('de'|'en'), $alt (andere Sprache), $t (Texte dieser Sprache).
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$site = 'https://rinkplanner.programmschmiede.de';
|
||||
|
||||
$features = [
|
||||
['icon' => '✎', 'title' => 'feature.editor.title', 'body' => 'feature.editor.body'],
|
||||
['icon' => '✦', 'title' => 'feature.elements.title', 'body' => 'feature.elements.body'],
|
||||
['icon' => '▶', 'title' => 'feature.preview.title', 'body' => 'feature.preview.body'],
|
||||
['icon' => '☁', 'title' => 'feature.sync.title', 'body' => 'feature.sync.body'],
|
||||
['icon' => '⇩', 'title' => 'feature.export.title', 'body' => 'feature.export.body'],
|
||||
['icon' => '★', 'title' => 'feature.tablet.title', 'body' => 'feature.tablet.body'],
|
||||
];
|
||||
|
||||
$releases = [];
|
||||
for ($i = 0; isset($t["release.$i.version"]); $i++) {
|
||||
$items = [];
|
||||
for ($j = 0; isset($t["release.$i.item.$j"]); $j++) {
|
||||
$items[] = $t["release.$i.item.$j"];
|
||||
}
|
||||
$releases[] = [
|
||||
'version' => $t["release.$i.version"],
|
||||
'date' => $t["release.$i.date"],
|
||||
'badge' => $t["release.$i.badge"] ?? null,
|
||||
'items' => $items,
|
||||
];
|
||||
}
|
||||
|
||||
$langLabels = ['de' => 'DE', 'en' => 'EN'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= $lang ?>">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#050d19" />
|
||||
<title><?= $t['meta.title'] ?></title>
|
||||
<meta name="description" content="<?= $t['meta.description'] ?>" />
|
||||
<link rel="canonical" href="<?= $site ?>/<?= $lang ?>/" />
|
||||
<link rel="alternate" hreflang="de" href="<?= $site ?>/de/" />
|
||||
<link rel="alternate" hreflang="en" href="<?= $site ?>/en/" />
|
||||
<link rel="alternate" hreflang="x-default" href="<?= $site ?>/" />
|
||||
<link rel="stylesheet" href="/fonts/fonts.css" />
|
||||
<link rel="stylesheet" href="/assets/site.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="bg-media" aria-hidden="true">
|
||||
<video class="bg-video" autoplay muted loop playsinline preload="auto" poster="/media/hero-poster.jpg">
|
||||
<source src="/media/hero.mp4" type="video/mp4" />
|
||||
</video>
|
||||
<div class="bg-shade"></div>
|
||||
<div class="bg-aurora"></div>
|
||||
</div>
|
||||
|
||||
<div class="trail" aria-hidden="true">
|
||||
<svg viewBox="0 0 1440 900" preserveAspectRatio="none">
|
||||
<path class="trail-line one" d="M-80,720 C220,540 350,780 620,630 S980,340 1180,470 S1320,690 1520,540" />
|
||||
<path class="trail-line two" d="M-60,300 C180,180 360,400 600,250 S980,120 1200,260 S1380,430 1520,300" />
|
||||
<path class="trail-line three" d="M-40,820 C300,700 520,860 760,700 S1100,560 1260,660 S1400,780 1520,700" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="grain" aria-hidden="true"></div>
|
||||
|
||||
<header class="site-header">
|
||||
<a class="brand" href="https://programmschmiede.de/">programmschmiede<span>.de</span></a>
|
||||
<nav class="site-nav" aria-label="<?= $t['nav.label'] ?>">
|
||||
<a href="#features"><?= $t['nav.features'] ?></a>
|
||||
<a href="#downloads"><?= $t['nav.downloads'] ?></a>
|
||||
<a href="#neu"><?= $t['nav.news'] ?></a>
|
||||
<a class="nav-back" href="https://programmschmiede.de/"><?= $t['nav.home'] ?></a>
|
||||
<div class="lang-switch">
|
||||
<?php foreach ($langLabels as $code => $label): ?>
|
||||
<a href="/index.php?lang=<?= $code ?>" lang="<?= $code ?>" hreflang="<?= $code ?>"<?= $code === $lang ? ' aria-current="page"' : '' ?>><?= $label ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section class="hero">
|
||||
<p class="eyebrow"><?= $t['hero.eyebrow'] ?></p>
|
||||
<h1>Rinkplanner</h1>
|
||||
<p class="lede">
|
||||
<?= $t['hero.lede'] ?>
|
||||
</p>
|
||||
<div class="hero-actions">
|
||||
<a class="button button-primary" href="#downloads"><?= $t['hero.cta_download'] ?></a>
|
||||
<a class="button button-ghost" href="#features"><?= $t['hero.cta_features'] ?></a>
|
||||
</div>
|
||||
<p class="hero-meta"><?= $t['hero.meta'] ?></p>
|
||||
</section>
|
||||
|
||||
<section id="features" class="section">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['features.kicker'] ?></p>
|
||||
<h2><?= $t['features.title'] ?></h2>
|
||||
<p class="section-lede">
|
||||
<?= $t['features.lede'] ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="feature-grid">
|
||||
<?php foreach ($features as $feature): ?>
|
||||
<article class="feature-card">
|
||||
<div class="feature-icon" aria-hidden="true"><?= $feature['icon'] ?></div>
|
||||
<h3><?= $t[$feature['title']] ?></h3>
|
||||
<p><?= $t[$feature['body']] ?></p>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="downloads" class="section downloads">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['downloads.kicker'] ?></p>
|
||||
<h2><?= $t['downloads.title'] ?></h2>
|
||||
<p class="section-lede">
|
||||
<?= $t['downloads.lede'] ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="download-grid">
|
||||
<article class="download-card">
|
||||
<span class="os-badge">macOS</span>
|
||||
<h3><?= $t['downloads.mac.title'] ?></h3>
|
||||
<p><?= $t['downloads.mac.body'] ?></p>
|
||||
<a class="button button-primary" href="https://programmschmiede.de/rinkplanner/download/rinkplanner-setup.dmg" download>
|
||||
<?= $t['downloads.mac.cta'] ?> <span>65 MB</span>
|
||||
</a>
|
||||
<p class="hint">
|
||||
<?= $t['downloads.mac.hint'] ?>
|
||||
</p>
|
||||
</article>
|
||||
|
||||
<article class="download-card">
|
||||
<span class="os-badge">Windows</span>
|
||||
<h3><?= $t['downloads.windows.title'] ?></h3>
|
||||
<p><?= $t['downloads.windows.body'] ?></p>
|
||||
<a class="button button-primary" href="https://programmschmiede.de/rinkplanner/download/rinkplanner-setup.exe" download>
|
||||
<?= $t['downloads.windows.cta'] ?> <span>29 MB</span>
|
||||
</a>
|
||||
<p class="hint">
|
||||
<?= $t['downloads.windows.hint'] ?>
|
||||
</p>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<p class="download-note">
|
||||
<?= $t['downloads.note'] ?>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section id="neu" class="section">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['news.kicker'] ?></p>
|
||||
<h2><?= $t['news.title'] ?></h2>
|
||||
<p class="section-lede">
|
||||
<?= $t['news.lede'] ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="release-list">
|
||||
<?php foreach ($releases as $release): ?>
|
||||
<article class="release-card">
|
||||
<div class="release-head">
|
||||
<span class="release-version"><?= $release['version'] ?></span>
|
||||
<span class="release-date"><?= $release['date'] ?></span>
|
||||
<?php if ($release['badge'] !== null): ?>
|
||||
<span class="release-badge"><?= $release['badge'] ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<ul>
|
||||
<?php foreach ($release['items'] as $item): ?>
|
||||
<li><?= $item ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['rights.kicker'] ?></p>
|
||||
<h2><?= $t['rights.title'] ?></h2>
|
||||
</div>
|
||||
<div class="notes-grid">
|
||||
<article class="note-card">
|
||||
<h3><?= $t['rights.cloud.title'] ?></h3>
|
||||
<p><?= $t['rights.cloud.body'] ?></p>
|
||||
</article>
|
||||
<article class="note-card">
|
||||
<h3><?= $t['rights.music.title'] ?></h3>
|
||||
<p><?= $t['rights.music.body'] ?></p>
|
||||
</article>
|
||||
<article class="note-card">
|
||||
<h3><?= $t['rights.care.title'] ?></h3>
|
||||
<p><?= $t['rights.care.body'] ?></p>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<span><?= $t['footer.copyright'] ?></span>
|
||||
<a href="https://programmschmiede.de/"><?= $t['footer.home'] ?></a>
|
||||
<a href="mailto:kontakt@programmschmiede.de"><?= $t['footer.contact'] ?></a>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
const video = document.querySelector(".bg-video");
|
||||
if (!video) {
|
||||
return;
|
||||
}
|
||||
const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
|
||||
const updateMotion = () => {
|
||||
if (reduceMotion.matches) {
|
||||
video.pause();
|
||||
} else {
|
||||
video.play().catch(() => {});
|
||||
}
|
||||
};
|
||||
video.addEventListener("error", () => document.body.classList.add("no-video"));
|
||||
if (reduceMotion.addEventListener) {
|
||||
reduceMotion.addEventListener("change", updateMotion);
|
||||
}
|
||||
updateMotion();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue