diff --git a/AGENTS.md b/AGENTS.md index 3ddecf3..6453615 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,15 +12,29 @@ Benutzer als Admin. `storage/.installed` verhindert einen zweiten Lauf. - Uploads liegen in `storage/uploads/` (gesperrt); nur `web/` ist öffentlich. - API v1 mit Bearer-Tokens für die App; Web-UI nutzt Session + CSRF. +- Web-UI ist zweisprachig (Deutsch Standard, Englisch optional): Texte in + `hub/app/i18n_strings.php`, Zugriff über `t('schlüssel')`, Sprache im Cookie + `RHUB_LANG` über den DE/EN-Umschalter (`/language`). Keine Texte direkt in + Views oder Meldungen – `./tools/deploy_hub.sh --check` meldet fehlende + Schlüssel. - App-Anbindung: `src/core/hub/` (`HubSettings`, `HubClient`, `HubJob`); Token liegt getrennt von `sync.cfg` unter `user://hub.cfg`. Der Menüpunkt `Datei → Kür-Hub…` erscheint nur bei geprüfter Verbindung. ## Website und Downloads -- Die Rinkplanner-Seite liegt nur noch unter - `rinkplanner.programmschmiede.de/index.html`. `programmschmiede.de/rinkplanner.html` - leitet per Root-`.htaccess` (301) dorthin um; keine zweite Kopie anlegen. +- Die Rinkplanner-Seite liegt unter `rinkplanner.programmschmiede.de/`, + Quelle im Repo unter `web/`. `programmschmiede.de/rinkplanner.html` leitet + per Root-`.htaccess` (301) dorthin um; keine zweite Kopie anlegen. +- Deployment mit `./tools/deploy_web.sh` (`--sync`, `--check`, `--all`). + Nicht direkt per FTP editieren – der nächste Sync überschreibt es. Nur + `web/` wird hochgeladen; `media/`, `fonts/` und `version.json` liegen + weiterhin nur auf dem Server. +- Zweisprachig: `/de/` und `/en/`, `/` leitet anhand von `Accept-Language` + weiter (der User-Agent enthält keine Sprache). Die Wahl aus dem DE/EN- + Umschalter merkt sich das Cookie `lang`. Texte: `web/i18n.php`, Markup: + `web/template.php`, Stile: `web/assets/site.css`. +- Details und Host-Eigenheiten: `docs/website.md`. - Builds liegen unter `programmschmiede.de/rinkplanner/download/`. Die Download-Links in der Subdomain-Seite sind absolut (`https://programmschmiede.de/rinkplanner/download/...`). diff --git a/README.md b/README.md index e37eb5d..335f75f 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,5 @@ Planner for Figure Skating free skate - **Kür-Sync (Dropbox):** [`docs/sync.md`](docs/sync.md) - **Cloud-Sync einrichten:** [`docs/cloud-setup.md`](docs/cloud-setup.md) - **Kür-Hub:** [`docs/hub.md`](docs/hub.md) +- **Website:** [`docs/website.md`](docs/website.md) - **Updates und Versions-Endpunkt:** [`docs/updates.md`](docs/updates.md) diff --git a/docs/credentials.example.txt b/docs/credentials.example.txt index 92521be..5411e29 100644 --- a/docs/credentials.example.txt +++ b/docs/credentials.example.txt @@ -4,7 +4,8 @@ # Format: KEY=WERT, eine Zuweisung pro Zeile. '#' startet einen Kommentar. # # --------------------------------------------------------------------------- -# FTP: nur noch für tools/sync_assets.sh --publish (Asset-Verteilung). +# FTP: für tools/sync_assets.sh --publish (Asset-Verteilung) und +# tools/deploy_web.sh (Website rinkplanner.programmschmiede.de). # Der Kür-Sync der App nutzt FTP nicht mehr. # --------------------------------------------------------------------------- # FTP_URL: Hostname oder URL des FTP-Servers, z. B. ftp.example.org diff --git a/docs/hub.md b/docs/hub.md index cf84402..656ed7f 100644 --- a/docs/hub.md +++ b/docs/hub.md @@ -207,6 +207,34 @@ Statuscodes: `401` Token fehlt/ungültig, `403` keine Berechtigung oder Passwortwechsel nötig, `404`, `409` Duplikat, `422` Validierung, `429` Limit. +### Sprache der API-Meldungen + +Die `message`-Felder sind übersetzt, das `code`-Feld bleibt maschinenlesbar +und unverändert. Die Sprache folgt dem Cookie `RHUB_LANG`; ohne Cookie +antwortet die API deutsch. Die App sollte sich auf `code` verlassen, nicht auf +den Text. + +## Sprache der Web-Oberfläche + +Die Oberfläche ist deutsch und englisch. Standard ist Deutsch; umgeschaltet +wird ausschließlich über den DE/EN-Umschalter in der Kopfzeile, der das +Cookie `RHUB_LANG` (ein Jahr, `SameSite=Lax`) setzt. Es gibt keine +automatische Erkennung – der Hub ist eine geschlossene Beta, und die +Deutschfassung bleibt die Vorgabe. + +- Alle Texte stehen in `hub/app/i18n_strings.php` unter `de` und `en`, + Zugriff über `t('schlüssel', ['platzhalter' => …])`. +- `hub_locale()` liest das Cookie, `hub_locale_set()` schreibt es; die Route + `/language?lang=de|en&next=…` setzt es und leitet zurück. +- Datum und Zahlen folgen der Sprache: deutsch `12.11.2026 10:30` und + `5,0 MB`, englisch `2026-11-12 10:30` und `5.0 MB`. +- In den Texten steht kein HTML; sie werden an der Ausgabestelle mit `e()` + maskiert. +- `./tools/deploy_hub.sh --check` prüft, dass beide Sprachblöcke dieselben + Schlüssel haben und dass jeder in `t()` verwendete Schlüssel existiert. +- Neuer Text gehört immer in beide Blöcke; fehlt eine Übersetzung, zeigt + `t()` den Schlüssel an, und der Check schlägt an. + ## Deployment `tools/deploy_hub.sh` liest die Zugänge aus `docs/credentials.txt` diff --git a/docs/updates.md b/docs/updates.md index af296ba..a8fc590 100644 --- a/docs/updates.md +++ b/docs/updates.md @@ -218,18 +218,20 @@ kein Netzwerkzugriff statt. ## „Was ist neu“ auf der Website -Die Rinkplanner-Seite (`https://rinkplanner.programmschmiede.de/index.html`) -hat seit dem 2026-11-12 einen Abschnitt **Was ist neu** mit den letzten -Releases. Es gibt bewusst keine zweite Kopie im Repo: Die Seite liegt nur auf -dem Webserver (siehe `AGENTS.md`). Für eine neue Version: +Die Rinkplanner-Seite (`https://rinkplanner.programmschmiede.de/`) hat seit +dem 2026-11-12 einen Abschnitt **Was ist neu** mit den letzten Releases. Sie +ist zweisprachig (`/de/`, `/en/`), Quelle im Repo unter `web/` (siehe +`docs/website.md`). Für eine neue Version: -1. `index.html` per FTP holen, den Block `.release-list` ergänzen (neue - `article.release-card` oben, Badge „Aktuell“ wandert mit) und wieder - hochladen. -2. Download-Texte mitziehen: Datum in `.hero-meta` und `.section-lede`, - Dateigröße in der Windows-/macOS-Karte. +1. In `web/i18n.php` einen neuen Block `release.N.*` oben einfügen (beide + Sprachen!), die Zähler der bestehenden Blöcke nach unten verschieben und + das Badge „Aktuell“/„Current“ zum neuen Block wandern lassen. +2. Download-Texte mitziehen: Datum in `hero.meta` und `downloads.lede`, + Dateigröße in der Windows-/macOS-Karte (steht direkt in + `web/template.php`). 3. Stichpunkte knapp halten und nur belegen, was wirklich drin ist – die Formulierungen sollen zur `notes`-Zeile in `version.json` passen. +4. `./tools/deploy_web.sh --sync` und danach `--check` laufen lassen. ## Checkliste für das nächste Release diff --git a/docs/website.md b/docs/website.md new file mode 100644 index 0000000..9d03cfd --- /dev/null +++ b/docs/website.md @@ -0,0 +1,87 @@ +# Website + +Die Rinkplanner-Seite liegt unter . +Die Quelle steht im Repo unter `web/`, hochgeladen wird mit +`./tools/deploy_web.sh`. Sie ist zweisprachig: Deutsch unter `/de/`, Englisch +unter `/en/`. + +## Aufbau + +``` +web/ +├── index.php # Sprachweiche: leitet auf /de/ oder /en/ weiter +├── index.html # Weiterleitung für die alte Adresse /index.html +├── bootstrap.php # Spracherkennung, Cookie, Rendern +├── i18n.php # alle Texte, de und en +├── template.php # gemeinsames Markup +├── assets/site.css # Stile +├── de/index.php # rendert die deutsche Seite +└── en/index.php # rendert die englische Seite +``` + +Nicht im Repo, weil nur auf dem Server: `media/` (Hero-Video und Poster), +`fonts/` und `version.json` (schreibt `tools/publish_version.sh`). + +## Spracherkennung + +Der User-Agent enthält keine Sprachinformation, deshalb entscheidet +`Accept-Language`. Reihenfolge in `bootstrap.php`: + +1. `?lang=de|en` – explizite Wahl, wird ein Jahr lang als Cookie `lang` + gespeichert. +2. Cookie `lang` – frühere Wahl über den DE/EN-Umschalter. Der Umschalter + verlinkt auf `/index.php?lang=…`, damit die Wahl auch bei späteren + Aufrufen von `/` gilt. +3. `Accept-Language` mit q-Werten; nicht unterstützte Sprachen fallen auf + Deutsch zurück. +4. `DEFAULT_LANG` (`de`). + +`/` antwortet mit `302` und `Vary: Accept-Language, Cookie`. Wichtig: kein +`301`, sonst würden Browser und Proxys die Weiterleitung dauerhaft cachen und +die Sprachwahl wäre nicht mehr änderbar. + +## URLs und Suchmaschinen + +- Kanonisch ist je Sprache `/de/` bzw. `/en/`, gesetzt per `rel="canonical"`. +- `hreflang` verweist auf beide Fassungen und `x-default` auf `/`. +- `/index.html` ist nur noch eine Weiterleitungsseite auf `/` (siehe unten). + +## Texte ändern + +Alle Texte stehen in `web/i18n.php` unter `'de'` und `'en'`. Beide Blöcke +müssen dieselben Schlüssel haben; `./tools/deploy_web.sh --check` meldet +Abweichungen. Mehrere Releases im Abschnitt „Was ist neu“ sind durchnummeriert +(`release.0.*`, `release.1.*`, …) – das Template liest sie, bis der nächste +Schlüssel fehlt. + +Markup und Struktur stehen in `web/template.php`, Stile in +`web/assets/site.css`. Beide Sprachen teilen sich beides, Abweichungen gibt es +nur im Text. + +## Deployment + +```bash +./tools/deploy_web.sh --sync # web/ per FTPS hochladen +./tools/deploy_web.sh --check # Texte und Live-Seite prüfen +./tools/deploy_web.sh --all # beides +``` + +Der Docroot der Subdomain ist das FTP-Verzeichnis +`rinkplanner.programmschmiede.de`. Zugangsdaten kommen aus +`docs/credentials.txt`. `--check` prüft die Schlüsselparität, die +Sprachweiche (`de-DE`, `en-US`, Fallback, q-Werte), beide Seiten, die Assets +und ob leere Überschriften auf fehlende Textschlüssel hindeuten. + +## Eigenheiten des Hosts + +Geprüft am 2026-11-12: + +- PHP 8.5.12 läuft im Docroot der Subdomain. +- `.htaccess` wird gelesen (`AddType` wirkt), aber weder `mod_alias` noch + `mod_rewrite` stehen zur Verfügung: `RedirectMatch` und `RewriteRule` haben + keine Wirkung. Die Weiterleitung von `/index.html` macht deshalb die + statische Seite `web/index.html` per `meta refresh`. +- `DirectoryIndex index.php index.html` in `web/.htaccess` sorgt dafür, dass + `/` die Sprachweiche ausführt und nicht die Weiterleitungsseite ausliefert. +- Die Website nutzt absolute Pfade (`/assets/…`, `/media/…`), weil die Seiten + eine Ebene tiefer unter `/de/` und `/en/` liegen. diff --git a/hub/app/api.php b/hub/app/api.php index f11d549..769ab01 100644 --- a/hub/app/api.php +++ b/hub/app/api.php @@ -90,7 +90,7 @@ function api_handle(string $method, string $path): void if ($path === '/api/v1/tokens') { if ($method !== 'POST') { - abort_api(405, 'method_not_allowed', 'Nur POST ist erlaubt.'); + abort_api(405, 'method_not_allowed', t('api.post_only')); } api_create_token(); return; @@ -100,7 +100,7 @@ function api_handle(string $method, string $path): void if ($path === '/api/v1/me') { if ($method !== 'GET') { - abort_api(405, 'method_not_allowed', 'Nur GET ist erlaubt.'); + abort_api(405, 'method_not_allowed', t('api.get_only')); } json_response([ 'id' => (int) $user['id'], @@ -128,7 +128,7 @@ function api_handle(string $method, string $path): void if ($method === 'POST') { api_upload($user, null); } - abort_api(405, 'method_not_allowed', 'Nur GET oder POST ist erlaubt.'); + abort_api(405, 'method_not_allowed', t('api.get_or_post')); } if (preg_match('#^/api/v1/routines/(\d+)$#', $path, $matches) === 1) { @@ -137,20 +137,20 @@ function api_handle(string $method, string $path): void } if (preg_match('#^/api/v1/routines/(\d+)/(download|audio)$#', $path, $matches) === 1) { if ($method !== 'GET') { - abort_api(405, 'method_not_allowed', 'Nur GET ist erlaubt.'); + abort_api(405, 'method_not_allowed', t('api.get_only')); } $routine = api_fetch_visible((int) $matches[1], $user); routine_send_file($routine, (string) $matches[2], $user, true); } if (preg_match('#^/api/v1/routines/(\d+)/revisions$#', $path, $matches) === 1) { if ($method !== 'POST') { - abort_api(405, 'method_not_allowed', 'Nur POST ist erlaubt.'); + abort_api(405, 'method_not_allowed', t('api.post_only')); } api_upload($user, (int) $matches[1]); return; } - abort_api(404, 'not_found', 'Unbekannter API-Pfad.'); + abort_api(404, 'not_found', t('api.unknown_path')); } function api_create_token(): void @@ -160,7 +160,7 @@ function api_create_token(): void $password = (string) ($input['password'] ?? ''); $name = trim((string) ($input['name'] ?? 'App')); if ($login === '' || $password === '') { - abort_api(422, 'invalid_credentials', 'Benutzername und Passwort sind erforderlich.'); + abort_api(422, 'invalid_credentials', t('api.credentials_required')); } $result = auth_attempt($login, $password); if (!$result['ok']) { @@ -172,7 +172,7 @@ function api_create_token(): void } $user = $result['user']; if ((int) ($user['must_change_password'] ?? 0) === 1) { - abort_api(403, 'password_change_required', 'Bitte zuerst im Web das Passwort ändern.'); + abort_api(403, 'password_change_required', t('api.change_password_web')); } $created = token_create((int) $user['id'], $name); json_response([ @@ -191,10 +191,10 @@ function api_fetch_visible(int $id, array $user): array { $routine = routine_fetch($id); if ($routine === null) { - abort_api(404, 'not_found', 'Kür nicht gefunden.'); + abort_api(404, 'not_found', t('routine.not_found_short')); } if (!routine_can_view($routine, $user)) { - abort_api(403, 'forbidden', 'Diese Kür ist nicht freigegeben.'); + abort_api(403, 'forbidden', t('routine.forbidden')); } return $routine; } @@ -207,26 +207,26 @@ function api_routine(int $id, string $method, array $user): void } if ($method === 'DELETE') { if (!routine_can_edit($routine, $user)) { - abort_api(403, 'forbidden', 'Nur der Eigentümer oder ein Admin darf die Kür ändern.'); + abort_api(403, 'forbidden', t('api.edit_forbidden')); } routine_set_status($id, 'hidden'); json_response(['id' => $id, 'status' => 'hidden']); } - abort_api(405, 'method_not_allowed', 'Nur GET oder DELETE ist erlaubt.'); + abort_api(405, 'method_not_allowed', t('api.get_or_delete')); } function api_upload(array $user, ?int $routineId): void { if (!api_truthy($_POST['rights'] ?? null)) { - abort_api(422, 'rights_required', 'Bitte bestätigen, dass Kür und Musik geteilt werden dürfen.'); + abort_api(422, 'rights_required', t('api.rights_required')); } if (!routine_upload_quota_ok((int) $user['id'])) { - abort_api(429, 'upload_limit', 'Stündliches Upload-Limit erreicht.'); + abort_api(429, 'upload_limit', t('api.upload_limit')); } $package = routine_validate_package($_POST); if (!$package['ok']) { json_response([ - 'error' => ['code' => 'validation_failed', 'message' => 'Die Dateien sind nicht gültig.'], + 'error' => ['code' => 'validation_failed', 'message' => t('api.invalid_files')], 'errors' => $package['errors'], ], 422); } @@ -234,22 +234,22 @@ function api_upload(array $user, ?int $routineId): void if ($routineId === null) { $duplicate = routine_duplicate_exists((int) $user['id'], $package); if ($duplicate !== null) { - abort_api(409, 'duplicate', 'Diese Kür ist bereits im Hub (ID ' . $duplicate . ').'); + abort_api(409, 'duplicate', t('api.duplicate', ['id' => $duplicate])); } $routineId = routine_create((int) $user['id'], $package); } else { $routine = routine_fetch($routineId); if ($routine === null) { - abort_api(404, 'not_found', 'Kür nicht gefunden.'); + abort_api(404, 'not_found', t('routine.not_found_short')); } if (!routine_can_edit($routine, $user)) { - abort_api(403, 'forbidden', 'Nur der Eigentümer oder ein Admin darf die Kür ändern.'); + abort_api(403, 'forbidden', t('api.edit_forbidden')); } routine_add_revision($routineId, (int) $user['id'], $package); } $created = routine_fetch($routineId); if ($created === null) { - abort_api(500, 'server_error', 'Kür konnte nicht geladen werden.'); + abort_api(500, 'server_error', t('api.routine_load_failed')); } json_response(api_routine_payload($created), 201); } diff --git a/hub/app/auth.php b/hub/app/auth.php index 17b80f8..5a1ce3c 100644 --- a/hub/app/auth.php +++ b/hub/app/auth.php @@ -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 = ?') diff --git a/hub/app/bootstrap.php b/hub/app/bootstrap.php index f128693..eacc4df 100644 --- a/hub/app/bootstrap.php +++ b/hub/app/bootstrap.php @@ -25,6 +25,7 @@ date_default_timezone_set('UTC'); ini_set('display_errors', '0'); ini_set('log_errors', '1'); +require HUB_APP . '/i18n.php'; require HUB_APP . '/util.php'; require HUB_APP . '/db.php'; require HUB_APP . '/auth.php'; @@ -42,14 +43,16 @@ if (is_dir($storage) && is_writable($storage)) { set_exception_handler(static function (Throwable $error): void { error_log('Hub: ' . $error::class . ': ' . $error->getMessage() . ' in ' . $error->getFile() . ':' . $error->getLine()); if (function_exists('wants_json') && wants_json()) { - json_response(['error' => ['code' => 'server_error', 'message' => 'Interner Fehler.']], 500); + json_response(['error' => ['code' => 'server_error', 'message' => t('api.server_error')]], 500); return; } http_response_code(500); header('Content-Type: text/html; charset=utf-8'); - echo 'Fehler' + $title = function_exists('t') ? t('page.title_error', ['status' => 500]) : 'Fehler 500'; + $hint = function_exists('t') ? t('api.server_error') : 'Interner Fehler.'; + echo '' . e($title) . '' . '' - . '

Interner Fehler

Bitte später erneut versuchen.

'; + . '

' . e($hint) . '

'; }); security_headers(); diff --git a/hub/app/i18n.php b/hub/app/i18n.php new file mode 100644 index 0000000..4c1e28c --- /dev/null +++ b/hub/app/i18n.php @@ -0,0 +1,71 @@ + time() + 365 * 86400, + 'path' => '/', + 'secure' => is_https(), + 'httponly' => false, + 'samesite' => 'Lax', + ]); + } + $_COOKIE[HUB_LOCALE_COOKIE] = $locale; +} + +function hub_strings(): array +{ + static $strings = null; + if ($strings === null) { + $strings = require HUB_APP . '/i18n_strings.php'; + } + return $strings; +} + +/** Text in der aktuellen Sprache; unbekannte Schlüssel geben den Schlüssel zurück. */ +function t(string $key, array $args = []): string +{ + $strings = hub_strings(); + $locale = hub_locale(); + $text = $strings[$locale][$key] ?? $strings[HUB_DEFAULT_LOCALE][$key] ?? $key; + if ($args !== []) { + $replace = []; + foreach ($args as $name => $value) { + $replace['{' . $name . '}'] = (string) $value; + } + $text = strtr($text, $replace); + } + return $text; +} diff --git a/hub/app/i18n_strings.php b/hub/app/i18n_strings.php new file mode 100644 index 0000000..928d568 --- /dev/null +++ b/hub/app/i18n_strings.php @@ -0,0 +1,664 @@ + [ + // Rahmen + 'app.name' => 'Rinkplanner-Hub', + 'nav.routines' => 'Küren', + 'nav.upload' => 'Hochladen', + 'nav.admin' => 'Verwaltung', + 'nav.logout' => 'Abmelden', + 'nav.login' => 'Anmelden', + 'nav.language' => 'Sprache', + 'footer.beta' => 'Geschlossene Beta · Rinkplanner-Hub', + 'footer.website' => 'Zur Rinkplanner-Seite', + 'flash.secret' => 'Geheimnis', + 'page.title_default' => 'Kür-Hub', + 'page.title_error' => 'Fehler {status}', + + // Seitentitel + 'page.login' => 'Anmelden', + 'page.register' => 'Registrieren', + 'page.dashboard' => 'Küren', + 'page.upload' => 'Kür hochladen', + 'page.revision' => 'Neue Revision', + 'page.account' => 'Konto', + 'page.admin_invites' => 'Einladungen', + 'page.admin_users' => 'Benutzer', + 'page.admin_routines' => 'Alle Küren', + 'page.admin_audit' => 'Audit-Log', + + // Anmeldung + 'login.title' => 'Anmelden', + 'login.lede' => 'Der Kür-Hub ist in einer geschlossenen Beta. Zugang gibt es per Einladungscode.', + 'login.login_label' => 'Benutzername oder E-Mail', + 'login.password' => 'Passwort', + 'login.remember' => 'Angemeldet bleiben (30 Tage)', + 'login.submit' => 'Anmelden', + 'login.no_access' => 'Noch keinen Zugang? Ein Beta-Code kommt von der Hub-Administration.', + + // Registrierung + 'register.title' => 'Beta-Zugang einlösen', + 'register.lede' => 'Ein Einladungscode legt genau ein Konto an. Der Code verliert danach seine Gültigkeit.', + 'register.code' => 'Einladungscode', + 'register.username' => 'Benutzername', + 'register.username_hint' => '3–32 Zeichen, nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich, Unterstrich.', + 'register.display_name' => 'Anzeigename', + 'register.email' => 'E-Mail (optional)', + 'register.email_bound' => 'Diese Einladung ist an {email} gebunden.', + 'register.password' => 'Passwort', + 'register.password_repeat' => 'Passwort wiederholen', + 'register.password_hint' => 'Mindestens 10 Zeichen.', + 'register.rights' => 'Ich akzeptiere die Beta-Regeln und teile keine Inhalte, an denen ich keine Rechte habe.', + 'register.submit' => 'Konto anlegen', + 'register.have_account' => 'Schon ein Konto?', + 'register.login_link' => 'Anmelden', + + // Übersicht + 'dashboard.eyebrow' => 'Viele Schlittschuhe, ein Netz', + 'dashboard.hero_title' => 'Küren teilen, Fassungen vergleichen, gemeinsam weiterentwickeln.', + 'dashboard.hero_sub' => 'Der Hub sammelt Küren, Musik und Revisionen deines Teams an einem Ort.', + 'dashboard.title' => 'Küren', + 'dashboard.count' => '{count} {label} im Hub', + 'dashboard.one_routine' => 'Kür', + 'dashboard.many_routines' => 'Küren', + 'dashboard.mine_suffix' => ' (nur deine)', + 'dashboard.upload' => 'Kür hochladen', + 'dashboard.search_placeholder' => 'Titel, Skater, Musik, Benutzer …', + 'dashboard.search' => 'Suchen', + 'dashboard.all' => 'Alle', + 'dashboard.mine' => 'Meine Küren', + 'dashboard.empty' => 'Keine Küren gefunden.', + 'dashboard.empty_hint' => 'Suche zurücksetzen oder', + 'dashboard.empty_upload' => 'selbst eine Kür hochladen', + 'dashboard.empty_first' => 'Der Hub ist noch leer.', + 'dashboard.empty_first_action' => 'Erste Kür hochladen', + 'badge.hidden' => 'versteckt', + + // Tabellen + 'table.title' => 'Titel', + 'table.skater' => 'Skater', + 'table.music' => 'Musik', + 'table.revision' => 'Rev.', + 'table.size' => 'Größe', + 'table.updated' => 'Aktualisiert', + 'table.by' => 'Von', + 'table.name' => 'Name', + 'table.prefix' => 'Prefix', + 'table.created' => 'Erstellt', + 'table.last_used' => 'Zuletzt', + 'table.status' => 'Status', + 'table.role' => 'Rolle', + 'table.routines' => 'Küren', + 'table.registered' => 'Registriert', + 'table.last_login' => 'Letzte Anmeldung', + 'table.actions' => 'Aktionen', + 'table.downloads' => 'Downloads', + 'table.email' => 'E-Mail', + 'table.note' => 'Notiz', + 'table.valid_until' => 'Gültig bis', + 'table.from_to' => 'Von / an', + 'table.time' => 'Zeit', + 'table.actor' => 'Akteur', + 'table.action' => 'Aktion', + 'table.subject' => 'Objekt', + 'table.detail' => 'Detail', + 'table.ip' => 'IP', + 'pagination.back' => '← Zurück', + 'pagination.next' => 'Weiter →', + 'pagination.page' => 'Seite {page} von {pages}', + + // Kür-Detail + 'routine.breadcrumb' => 'Küren', + 'routine.breadcrumb_current' => 'Kür', + 'routine.revision' => 'Revision {revision}', + 'routine.download' => 'Kür herunterladen', + 'routine.download_audio' => 'Musik herunterladen', + 'routine.owner_bar' => 'Du kannst diese Kür verwalten.', + 'routine.new_revision' => 'Neue Revision hochladen', + 'routine.hide' => 'Aus dem Hub nehmen', + 'routine.publish' => 'Wieder veröffentlichen', + 'routine.open_admin' => 'In der Verwaltung öffnen', + 'routine.description' => 'Beschreibung', + 'routine.music' => 'Musik', + 'routine.details' => 'Details', + 'routine.category' => 'Kategorie', + 'routine.music_title' => 'Musiktitel', + 'routine.music_artist' => 'Musik', + 'routine.routine_file' => 'Kür-Datei', + 'routine.audio_file' => 'Audio-Datei', + 'routine.checksums' => 'Prüfsummen', + 'routine.checksum_hint' => 'Beim Download prüfen, ob die SHA-256-Summe zur Kür passt.', + + // Upload + 'upload.title_new' => 'Kür hochladen', + 'upload.title_revision' => 'Neue Revision', + 'upload.revision_lede' => 'Neue Fassung von „{title}“. Die bisherige Revision bleibt erhalten.', + 'upload.lede' => 'Lade die Kür-JSON und – falls die Kür Musik nutzt – die zugehörige Audiodatei hoch. Beide gehören als Paket zusammen.', + 'upload.routine_file' => 'Kür-Datei (.json)', + 'upload.routine_hint' => 'Aus Rinkplanner gespeicherte Kür, max. {max}.', + 'upload.audio_file' => 'Musikdatei (MP3/OGG/WAV/M4A/AAC)', + 'upload.audio_hint' => 'Dateiname muss exakt dem Feld „music_file“ der Kür entsprechen.', + 'upload.description' => 'Beschreibung (optional)', + 'upload.music_title' => 'Musiktitel (optional)', + 'upload.artist' => 'Interpret (optional)', + 'upload.rights' => 'Ich habe die Rechte an Kür und Musik und darf sie im geschlossenen Beta-Hub teilen.', + 'upload.submit_new' => 'Kür veröffentlichen', + 'upload.submit_revision' => 'Revision veröffentlichen', + 'upload.cancel' => 'Abbrechen', + + // Konto + 'account.title' => 'Konto', + 'account.role_admin' => 'Administrator', + 'account.role_user' => 'Beta-Nutzer', + 'account.must_change' => 'Bitte ein neues Passwort setzen, bevor du den Hub weiter nutzt.', + 'account.change_password' => 'Passwort ändern', + 'account.current_password' => 'Aktuelles Passwort', + 'account.new_password' => 'Neues Passwort', + 'account.repeat_password' => 'Neues Passwort wiederholen', + 'account.password_hint' => 'Mindestens 10 Zeichen.', + 'account.save_password' => 'Passwort speichern', + 'account.tokens' => 'API-Tokens', + 'account.tokens_lede' => 'Für die Godot-App. Ein Token ersetzt Benutzername und Passwort im Client und lässt sich jederzeit widerrufen.', + 'account.token_placeholder' => 'Name, z. B. Büro-PC', + 'account.token_create' => 'Token erzeugen', + 'account.token_active' => 'aktiv', + 'account.token_revoked' => 'widerrufen', + 'account.token_revoke' => 'widerrufen', + 'account.no_tokens' => 'Noch kein Token erzeugt.', + + // Verwaltung + 'admin.title' => 'Verwaltung', + 'admin.tab_invites' => 'Einladungen', + 'admin.tab_users' => 'Benutzer', + 'admin.tab_routines' => 'Küren', + 'admin.tab_audit' => 'Audit-Log', + 'admin.audit_lede' => 'Die letzten {count} Ereignisse.', + 'admin.audit_empty' => 'Noch keine Einträge.', + 'admin_invites.lede' => 'Einladungen für die geschlossene Beta.', + 'admin_invites.new' => 'Neue Einladung', + 'admin_invites.new_lede' => 'Der Code wird nach dem Anlegen genau einmal angezeigt. Er gilt für ein Konto.', + 'admin_invites.note' => 'Notiz (intern)', + 'admin_invites.note_placeholder' => 'z. B. Verein Nord', + 'admin_invites.email' => 'E-Mail binden (optional)', + 'admin_invites.email_hint' => 'Nur diese Adresse kann den Code nutzen.', + 'admin_invites.days' => 'Gültig (Tage)', + 'admin_invites.days_hint' => '0 = unbegrenzt.', + 'admin_invites.create' => 'Einladung erzeugen', + 'admin_invites.list' => 'Einladungen', + 'admin_invites.empty' => 'Noch keine Einladungen.', + 'admin_invites.revoke' => 'widerrufen', + 'admin_users.lede' => 'Beta-Konten verwalten.', + 'admin_users.self' => 'eigenes Konto', + 'admin_users.block' => 'sperren', + 'admin_users.unblock' => 'entsperren', + 'admin_users.reset' => 'Passwort zurücksetzen', + 'admin_users.delete' => 'löschen', + 'admin_users.delete_confirm' => 'mit allen Küren löschen', + 'admin_users.delete_submit' => 'Löschen bestätigen', + 'admin_users.role_admin' => 'Admin', + 'admin_users.role_user' => 'Nutzer', + 'status.active' => 'aktiv', + 'status.blocked' => 'gesperrt', + 'admin_routines.lede' => '{total} Küren insgesamt, auch versteckte.', + 'admin_routines.search_placeholder' => 'Titel, Skater, Benutzer …', + 'admin_routines.empty' => 'Keine Küren gefunden.', + 'admin_routines.hide' => 'verstecken', + 'admin_routines.publish' => 'veröffentlichen', + 'admin_routines.delete' => 'löschen', + 'admin_routines.delete_confirm' => 'endgültig löschen', + 'admin_routines.delete_submit' => 'Löschen bestätigen', + + // Status einer Einladung + 'invite.status.open' => 'offen', + 'invite.status.used' => 'eingelöst', + 'invite.status.expired' => 'abgelaufen', + 'invite.status.revoked' => 'widerrufen', + + // Fehlerseite + 'error.label' => 'Fehler {status}', + 'error.back' => 'Zurück zur', + 'error.back_link' => 'Küren-Übersicht', + + // Meldungen + 'auth.admin_only' => 'Dieser Bereich ist nur für Administratoren.', + 'auth.change_password_first' => 'Bitte zuerst das Passwort ändern.', + 'auth.logged_out' => 'Abgemeldet.', + 'auth.welcome' => 'Willkommen im Kür-Hub!', + 'auth.session_expired' => 'Die Sitzung ist abgelaufen. Bitte die Seite neu laden.', + 'page.method_not_allowed' => 'Diese Methode ist nicht erlaubt.', + 'page.not_found' => 'Diese Seite gibt es nicht.', + 'username.length' => 'Der Benutzername muss 3 bis 32 Zeichen lang sein.', + 'username.charset' => 'Nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich und Unterstrich; Anfang und Ende alphanumerisch.', + 'username.reserved' => 'Dieser Benutzername ist reserviert.', + 'register.invalid_invite' => 'Dieser Einladungscode ist ungültig, abgelaufen oder bereits eingelöst.', + 'register.display_name_long' => 'Der Anzeigename darf höchstens 64 Zeichen lang sein.', + 'register.email_invalid' => 'Die E-Mail-Adresse ist nicht gültig.', + 'register.email_mismatch' => 'Diese Einladung ist an eine andere E-Mail-Adresse gebunden.', + 'register.password_mismatch' => 'Die Passwortwiederholung passt nicht.', + 'register.rights_required' => 'Bitte die Beta-Regeln akzeptieren.', + 'register.invite_taken' => 'Der Einladungscode wurde gerade eingelöst. Bitte einen neuen Code anfordern.', + 'register.username_taken' => 'Dieser Benutzername ist schon vergeben.', + 'register.email_taken' => 'Diese E-Mail-Adresse ist schon registriert.', + 'routine.not_found' => 'Diese Kür gibt es nicht.', + 'routine.forbidden' => 'Diese Kür ist nicht freigegeben.', + 'routine.edit_forbidden' => 'Nur der Eigentümer oder ein Admin kann diese Kür ändern.', + 'upload.quota' => 'Stündliches Upload-Limit erreicht. Bitte später erneut versuchen.', + 'upload.rights_confirm' => 'Bitte bestätigen, dass du Kür und Musik teilen darfst.', + 'upload.duplicate' => 'Diese Kür ist bereits im Hub.', + 'upload.published' => 'Kür veröffentlicht.', + 'upload.save_failed' => 'Die Kür konnte nicht gespeichert werden.', + 'revision.saved' => 'Neue Revision {revision} gespeichert.', + 'revision.save_failed' => 'Die Revision konnte nicht gespeichert werden.', + 'routine.published_again' => 'Kür ist wieder sichtbar.', + 'routine.hidden_now' => 'Kür wurde aus dem Hub genommen.', + 'account.current_wrong' => 'Das aktuelle Passwort ist falsch.', + 'account.password_changed' => 'Passwort geändert. Andere Sitzungen wurden abgemeldet.', + 'token.created' => 'Neuer API-Token – jetzt kopieren, er wird nicht erneut angezeigt', + 'token.revoked' => 'Token widerrufen.', + 'token.not_found' => 'Token nicht gefunden.', + 'invite.created' => 'Einladung erstellt.', + 'invite.created_label' => 'Einladungscode', + 'invite.revoked' => 'Einladung widerrufen.', + 'invite.revoke_failed' => 'Einladung konnte nicht widerrufen werden.', + 'user.not_found' => 'Benutzer nicht gefunden.', + 'user.self_change' => 'Das eigene Konto lässt sich hier nicht ändern.', + 'user.disabled' => 'Benutzer deaktiviert.', + 'user.enabled' => 'Benutzer aktiviert.', + 'user.temp_password' => 'Temporäres Passwort für {user}', + 'user.must_change' => 'Der Benutzer muss das Passwort bei der nächsten Anmeldung ändern.', + 'user.delete_confirm_required' => 'Löschen muss bestätigt werden.', + 'user.deleted' => 'Benutzer und zugehörige Küren gelöscht.', + 'action.unknown' => 'Unbekannte Aktion.', + 'routine.not_found_short' => 'Kür nicht gefunden.', + 'admin.status_changed' => 'Status geändert.', + 'routine.deleted' => 'Kür endgültig gelöscht.', + + // Anmeldung und Passwortregeln + 'login.error.rate_limited' => 'Zu viele Fehlversuche. Bitte in {minutes} Minuten erneut versuchen.', + 'login.error.credentials' => 'Benutzername oder Passwort ist falsch.', + 'login.error.disabled' => 'Dieses Konto ist deaktiviert.', + 'password.min' => 'Das Passwort muss mindestens 10 Zeichen lang sein.', + 'password.max' => 'Das Passwort darf höchstens 200 Zeichen lang sein.', + 'password.same_as_username' => 'Das Passwort darf nicht dem Benutzernamen entsprechen.', + + // Upload-Prüfung + 'upload.select_routine' => 'Bitte eine Kür-Datei (.json) auswählen.', + 'upload.invalid' => 'Ungültiger Upload.', + 'upload.routine_too_large' => 'Die Kür-Datei ist zu groß (max. {max}).', + 'upload.routine_not_json' => 'Kürdateien müssen im JSON-Format vorliegen (.json).', + 'upload.read_failed' => 'Die Kür-Datei konnte nicht gelesen werden.', + 'upload.invalid_json' => 'Die Kür-Datei ist kein gültiges JSON.', + 'upload.no_json_object' => 'Die Kür-Datei enthält kein JSON-Objekt.', + 'upload.not_rinkplanner' => 'Das ist keine Rinkplanner-Kür (format fehlt oder ist falsch).', + 'upload.unsupported_version' => 'Diese Kür-Formatversion wird nicht unterstützt.', + 'upload.no_sections' => 'Die Kür enthält keine Abschnittsliste.', + 'upload.too_many_sections' => 'Die Kür hat zu viele Abschnitte (max. 500).', + 'upload.title_required' => 'Die Kür braucht einen Titel.', + 'upload.bad_music_name' => 'Die Kür verweist auf einen ungültigen Musikdateinamen.', + 'upload.music_missing' => 'Die Kür verweist auf „{name}“. Bitte die passende Audiodatei mit hochladen.', + 'upload.music_unexpected' => 'Die Kür verweist auf keine Musikdatei; die Audiodatei passt nicht dazu.', + 'upload.audio_invalid' => 'Ungültiger Audio-Upload.', + 'upload.audio_too_large' => 'Die Audiodatei ist zu groß (max. {max}).', + 'upload.audio_name_mismatch' => 'Die Audiodatei heißt „{actual}“, die Kür verweist aber auf „{expected}“.', + 'upload.audio_format' => 'Die Audiodatei ist kein unterstütztes Format (MP3, OGG, WAV, M4A, AAC).', + 'upload.file_too_large' => 'Die Datei ist zu groß.', + 'upload.interrupted' => 'Der Upload wurde unterbrochen.', + 'upload.no_file_chosen' => 'Es wurde keine Datei ausgewählt.', + 'upload.store_failed' => 'Die Datei konnte nicht gespeichert werden.', + 'upload.unknown_error' => 'Unbekannter Upload-Fehler.', + 'routine.no_file_yet' => 'Diese Kür hat noch keine Datei.', + 'routine.file_missing' => 'Die Datei fehlt im Speicher.', + 'routine.file_unreadable' => 'Die Datei konnte nicht geöffnet werden.', + + // API + 'api.post_only' => 'Nur POST ist erlaubt.', + 'api.get_only' => 'Nur GET ist erlaubt.', + 'api.get_or_post' => 'Nur GET oder POST ist erlaubt.', + 'api.get_or_delete' => 'Nur GET oder DELETE ist erlaubt.', + 'api.unknown_path' => 'Unbekannter API-Pfad.', + 'api.bearer_missing' => 'Bearer-Token fehlt.', + 'api.token_invalid' => 'Token ist ungültig, abgelaufen oder widerrufen.', + 'api.credentials_required' => 'Benutzername und Passwort sind erforderlich.', + 'api.change_password_web' => 'Bitte zuerst im Web das Passwort ändern.', + 'api.edit_forbidden' => 'Nur der Eigentümer oder ein Admin darf die Kür ändern.', + 'api.rights_required' => 'Bitte bestätigen, dass Kür und Musik geteilt werden dürfen.', + 'api.upload_limit' => 'Stündliches Upload-Limit erreicht.', + 'api.invalid_files' => 'Die Dateien sind nicht gültig.', + 'api.duplicate' => 'Diese Kür ist bereits im Hub (ID {id}).', + 'api.server_error' => 'Interner Fehler.', + 'api.routine_load_failed' => 'Kür konnte nicht geladen werden.', + ], + + 'en' => [ + // Frame + 'app.name' => 'Rinkplanner Hub', + 'nav.routines' => 'Programmes', + 'nav.upload' => 'Upload', + 'nav.admin' => 'Administration', + 'nav.logout' => 'Sign out', + 'nav.login' => 'Sign in', + 'nav.language' => 'Language', + 'footer.beta' => 'Closed beta · Rinkplanner Hub', + 'footer.website' => 'To the Rinkplanner website', + 'flash.secret' => 'Secret', + 'page.title_default' => 'Programme hub', + 'page.title_error' => 'Error {status}', + + // Page titles + 'page.login' => 'Sign in', + 'page.register' => 'Register', + 'page.dashboard' => 'Programmes', + 'page.upload' => 'Upload programme', + 'page.revision' => 'New revision', + 'page.account' => 'Account', + 'page.admin_invites' => 'Invitations', + 'page.admin_users' => 'Users', + 'page.admin_routines' => 'All programmes', + 'page.admin_audit' => 'Audit log', + + // Sign in + 'login.title' => 'Sign in', + 'login.lede' => 'The programme hub is in a closed beta. Access is granted by invitation code.', + 'login.login_label' => 'Username or email', + 'login.password' => 'Password', + 'login.remember' => 'Stay signed in (30 days)', + 'login.submit' => 'Sign in', + 'login.no_access' => 'No access yet? A beta code comes from the hub administration.', + + // Registration + 'register.title' => 'Redeem beta access', + 'register.lede' => 'An invitation code creates exactly one account. The code expires once it has been used.', + 'register.code' => 'Invitation code', + 'register.username' => 'Username', + 'register.username_hint' => '3–32 characters, lowercase letters, digits, dot, hyphen and underscore only.', + 'register.display_name' => 'Display name', + 'register.email' => 'Email (optional)', + 'register.email_bound' => 'This invitation is bound to {email}.', + 'register.password' => 'Password', + 'register.password_repeat' => 'Repeat password', + 'register.password_hint' => 'At least 10 characters.', + 'register.rights' => 'I accept the beta rules and will not share content I have no rights to.', + 'register.submit' => 'Create account', + 'register.have_account' => 'Already have an account?', + 'register.login_link' => 'Sign in', + + // Overview + 'dashboard.eyebrow' => 'Many skates, one net', + 'dashboard.hero_title' => 'Share programmes, compare versions, develop them together.', + 'dashboard.hero_sub' => 'The hub collects your team’s programmes, music and revisions in one place.', + 'dashboard.title' => 'Programmes', + 'dashboard.count' => '{count} {label} in the hub', + 'dashboard.one_routine' => 'programme', + 'dashboard.many_routines' => 'programmes', + 'dashboard.mine_suffix' => ' (yours only)', + 'dashboard.upload' => 'Upload programme', + 'dashboard.search_placeholder' => 'Title, skater, music, user …', + 'dashboard.search' => 'Search', + 'dashboard.all' => 'All', + 'dashboard.mine' => 'My programmes', + 'dashboard.empty' => 'No programmes found.', + 'dashboard.empty_hint' => 'Clear the search or', + 'dashboard.empty_upload' => 'upload a programme yourself', + 'dashboard.empty_first' => 'The hub is still empty.', + 'dashboard.empty_first_action' => 'Upload the first programme', + 'badge.hidden' => 'hidden', + + // Tables + 'table.title' => 'Title', + 'table.skater' => 'Skater', + 'table.music' => 'Music', + 'table.revision' => 'Rev.', + 'table.size' => 'Size', + 'table.updated' => 'Updated', + 'table.by' => 'By', + 'table.name' => 'Name', + 'table.prefix' => 'Prefix', + 'table.created' => 'Created', + 'table.last_used' => 'Last used', + 'table.status' => 'Status', + 'table.role' => 'Role', + 'table.routines' => 'Programmes', + 'table.registered' => 'Registered', + 'table.last_login' => 'Last sign-in', + 'table.actions' => 'Actions', + 'table.downloads' => 'Downloads', + 'table.email' => 'Email', + 'table.note' => 'Note', + 'table.valid_until' => 'Valid until', + 'table.from_to' => 'From / to', + 'table.time' => 'Time', + 'table.actor' => 'Actor', + 'table.action' => 'Action', + 'table.subject' => 'Subject', + 'table.detail' => 'Detail', + 'table.ip' => 'IP', + 'pagination.back' => '← Back', + 'pagination.next' => 'Next →', + 'pagination.page' => 'Page {page} of {pages}', + + // Programme detail + 'routine.breadcrumb' => 'Programmes', + 'routine.breadcrumb_current' => 'Programme', + 'routine.revision' => 'Revision {revision}', + 'routine.download' => 'Download programme', + 'routine.download_audio' => 'Download music', + 'routine.owner_bar' => 'You can manage this programme.', + 'routine.new_revision' => 'Upload new revision', + 'routine.hide' => 'Remove from the hub', + 'routine.publish' => 'Publish again', + 'routine.open_admin' => 'Open in administration', + 'routine.description' => 'Description', + 'routine.music' => 'Music', + 'routine.details' => 'Details', + 'routine.category' => 'Category', + 'routine.music_title' => 'Music title', + 'routine.music_artist' => 'Artist', + 'routine.routine_file' => 'Programme file', + 'routine.audio_file' => 'Audio file', + 'routine.checksums' => 'Checksums', + 'routine.checksum_hint' => 'When downloading, check that the SHA-256 checksum matches the programme.', + + // Upload + 'upload.title_new' => 'Upload programme', + 'upload.title_revision' => 'New revision', + 'upload.revision_lede' => 'New version of “{title}”. The previous revision is kept.', + 'upload.lede' => 'Upload the programme JSON and, if the programme uses music, the matching audio file. They belong together as a package.', + 'upload.routine_file' => 'Programme file (.json)', + 'upload.routine_hint' => 'A programme saved from Rinkplanner, max. {max}.', + 'upload.audio_file' => 'Music file (MP3/OGG/WAV/M4A/AAC)', + 'upload.audio_hint' => 'The filename must match the “music_file” field of the programme exactly.', + 'upload.description' => 'Description (optional)', + 'upload.music_title' => 'Music title (optional)', + 'upload.artist' => 'Artist (optional)', + 'upload.rights' => 'I hold the rights to the programme and the music and may share them in the closed beta hub.', + 'upload.submit_new' => 'Publish programme', + 'upload.submit_revision' => 'Publish revision', + 'upload.cancel' => 'Cancel', + + // Account + 'account.title' => 'Account', + 'account.role_admin' => 'Administrator', + 'account.role_user' => 'Beta user', + 'account.must_change' => 'Please set a new password before using the hub further.', + 'account.change_password' => 'Change password', + 'account.current_password' => 'Current password', + 'account.new_password' => 'New password', + 'account.repeat_password' => 'Repeat new password', + 'account.password_hint' => 'At least 10 characters.', + 'account.save_password' => 'Save password', + 'account.tokens' => 'API tokens', + 'account.tokens_lede' => 'For the Godot app. A token replaces username and password in the client and can be revoked at any time.', + 'account.token_placeholder' => 'Name, e.g. office PC', + 'account.token_create' => 'Create token', + 'account.token_active' => 'active', + 'account.token_revoked' => 'revoked', + 'account.token_revoke' => 'revoke', + 'account.no_tokens' => 'No token created yet.', + + // Administration + 'admin.title' => 'Administration', + 'admin.tab_invites' => 'Invitations', + 'admin.tab_users' => 'Users', + 'admin.tab_routines' => 'Programmes', + 'admin.tab_audit' => 'Audit log', + 'admin.audit_lede' => 'The last {count} events.', + 'admin.audit_empty' => 'No entries yet.', + 'admin_invites.lede' => 'Invitations for the closed beta.', + 'admin_invites.new' => 'New invitation', + 'admin_invites.new_lede' => 'The code is shown exactly once after it is created. It is valid for one account.', + 'admin_invites.note' => 'Note (internal)', + 'admin_invites.note_placeholder' => 'e.g. Club North', + 'admin_invites.email' => 'Bind email (optional)', + 'admin_invites.email_hint' => 'Only this address can use the code.', + 'admin_invites.days' => 'Valid (days)', + 'admin_invites.days_hint' => '0 = unlimited.', + 'admin_invites.create' => 'Create invitation', + 'admin_invites.list' => 'Invitations', + 'admin_invites.empty' => 'No invitations yet.', + 'admin_invites.revoke' => 'revoke', + 'admin_users.lede' => 'Manage beta accounts.', + 'admin_users.self' => 'own account', + 'admin_users.block' => 'block', + 'admin_users.unblock' => 'unblock', + 'admin_users.reset' => 'Reset password', + 'admin_users.delete' => 'delete', + 'admin_users.delete_confirm' => 'delete including all programmes', + 'admin_users.delete_submit' => 'Confirm deletion', + 'admin_users.role_admin' => 'Admin', + 'admin_users.role_user' => 'User', + 'status.active' => 'active', + 'status.blocked' => 'blocked', + 'admin_routines.lede' => '{total} programmes in total, including hidden ones.', + 'admin_routines.search_placeholder' => 'Title, skater, user …', + 'admin_routines.empty' => 'No programmes found.', + 'admin_routines.hide' => 'hide', + 'admin_routines.publish' => 'publish', + 'admin_routines.delete' => 'delete', + 'admin_routines.delete_confirm' => 'delete permanently', + 'admin_routines.delete_submit' => 'Confirm deletion', + + // Invitation status + 'invite.status.open' => 'open', + 'invite.status.used' => 'redeemed', + 'invite.status.expired' => 'expired', + 'invite.status.revoked' => 'revoked', + + // Error page + 'error.label' => 'Error {status}', + 'error.back' => 'Back to the', + 'error.back_link' => 'programme overview', + + // Messages + 'auth.admin_only' => 'This area is for administrators only.', + 'auth.change_password_first' => 'Please change your password first.', + 'auth.logged_out' => 'Signed out.', + 'auth.welcome' => 'Welcome to the programme hub!', + 'auth.session_expired' => 'The session has expired. Please reload the page.', + 'page.method_not_allowed' => 'This method is not allowed.', + 'page.not_found' => 'This page does not exist.', + 'username.length' => 'The username must be 3 to 32 characters long.', + 'username.charset' => 'Lowercase letters, digits, dot, hyphen and underscore only; begin and end with a letter or digit.', + 'username.reserved' => 'This username is reserved.', + 'register.invalid_invite' => 'This invitation code is invalid, expired or already redeemed.', + 'register.display_name_long' => 'The display name may be at most 64 characters long.', + 'register.email_invalid' => 'The email address is not valid.', + 'register.email_mismatch' => 'This invitation is bound to a different email address.', + 'register.password_mismatch' => 'The passwords do not match.', + 'register.rights_required' => 'Please accept the beta rules.', + 'register.invite_taken' => 'The invitation code was just redeemed. Please request a new one.', + 'register.username_taken' => 'This username is already taken.', + 'register.email_taken' => 'This email address is already registered.', + 'routine.not_found' => 'This programme does not exist.', + 'routine.forbidden' => 'This programme is not shared with you.', + 'routine.edit_forbidden' => 'Only the owner or an admin can change this programme.', + 'upload.quota' => 'Hourly upload limit reached. Please try again later.', + 'upload.rights_confirm' => 'Please confirm that you may share the programme and its music.', + 'upload.duplicate' => 'This programme is already in the hub.', + 'upload.published' => 'Programme published.', + 'upload.save_failed' => 'The programme could not be saved.', + 'revision.saved' => 'New revision {revision} saved.', + 'revision.save_failed' => 'The revision could not be saved.', + 'routine.published_again' => 'The programme is visible again.', + 'routine.hidden_now' => 'The programme was removed from the hub.', + 'account.current_wrong' => 'The current password is wrong.', + 'account.password_changed' => 'Password changed. Other sessions were signed out.', + 'token.created' => 'New API token – copy it now, it will not be shown again', + 'token.revoked' => 'Token revoked.', + 'token.not_found' => 'Token not found.', + 'invite.created' => 'Invitation created.', + 'invite.created_label' => 'Invitation code', + 'invite.revoked' => 'Invitation revoked.', + 'invite.revoke_failed' => 'The invitation could not be revoked.', + 'user.not_found' => 'User not found.', + 'user.self_change' => 'Your own account cannot be changed here.', + 'user.disabled' => 'User disabled.', + 'user.enabled' => 'User enabled.', + 'user.temp_password' => 'Temporary password for {user}', + 'user.must_change' => 'The user must change the password at the next sign-in.', + 'user.delete_confirm_required' => 'Deletion must be confirmed.', + 'user.deleted' => 'User and their programmes deleted.', + 'action.unknown' => 'Unknown action.', + 'routine.not_found_short' => 'Programme not found.', + 'admin.status_changed' => 'Status changed.', + 'routine.deleted' => 'Programme permanently deleted.', + + // Sign-in and password rules + 'login.error.rate_limited' => 'Too many failed attempts. Please try again in {minutes} minutes.', + 'login.error.credentials' => 'Username or password is incorrect.', + 'login.error.disabled' => 'This account is disabled.', + 'password.min' => 'The password must be at least 10 characters long.', + 'password.max' => 'The password may be at most 200 characters long.', + 'password.same_as_username' => 'The password must not be the same as the username.', + + // Upload validation + 'upload.select_routine' => 'Please choose a programme file (.json).', + 'upload.invalid' => 'Invalid upload.', + 'upload.routine_too_large' => 'The programme file is too large (max. {max}).', + 'upload.routine_not_json' => 'Programme files must be in JSON format (.json).', + 'upload.read_failed' => 'The programme file could not be read.', + 'upload.invalid_json' => 'The programme file is not valid JSON.', + 'upload.no_json_object' => 'The programme file does not contain a JSON object.', + 'upload.not_rinkplanner' => 'This is not a Rinkplanner programme (missing or wrong format).', + 'upload.unsupported_version' => 'This programme format version is not supported.', + 'upload.no_sections' => 'The programme has no section list.', + 'upload.too_many_sections' => 'The programme has too many sections (max. 500).', + 'upload.title_required' => 'The programme needs a title.', + 'upload.bad_music_name' => 'The programme refers to an invalid music filename.', + 'upload.music_missing' => 'The programme refers to “{name}”. Please upload the matching audio file as well.', + 'upload.music_unexpected' => 'The programme refers to no music file; the audio file does not match.', + 'upload.audio_invalid' => 'Invalid audio upload.', + 'upload.audio_too_large' => 'The audio file is too large (max. {max}).', + 'upload.audio_name_mismatch' => 'The audio file is named “{actual}”, but the programme refers to “{expected}”.', + 'upload.audio_format' => 'The audio file is not a supported format (MP3, OGG, WAV, M4A, AAC).', + 'upload.file_too_large' => 'The file is too large.', + 'upload.interrupted' => 'The upload was interrupted.', + 'upload.no_file_chosen' => 'No file was selected.', + 'upload.store_failed' => 'The file could not be stored.', + 'upload.unknown_error' => 'Unknown upload error.', + 'routine.no_file_yet' => 'This programme has no file yet.', + 'routine.file_missing' => 'The file is missing from storage.', + 'routine.file_unreadable' => 'The file could not be opened.', + + // API + 'api.post_only' => 'Only POST is allowed.', + 'api.get_only' => 'Only GET is allowed.', + 'api.get_or_post' => 'Only GET or POST is allowed.', + 'api.get_or_delete' => 'Only GET or DELETE is allowed.', + 'api.unknown_path' => 'Unknown API path.', + 'api.bearer_missing' => 'Bearer token missing.', + 'api.token_invalid' => 'Token is invalid, expired or revoked.', + 'api.credentials_required' => 'Username and password are required.', + 'api.change_password_web' => 'Please change your password in the web interface first.', + 'api.edit_forbidden' => 'Only the owner or an admin may change the programme.', + 'api.rights_required' => 'Please confirm that the programme and its music may be shared.', + 'api.upload_limit' => 'Hourly upload limit reached.', + 'api.invalid_files' => 'The files are not valid.', + 'api.duplicate' => 'This programme is already in the hub (ID {id}).', + 'api.server_error' => 'Internal error.', + 'api.routine_load_failed' => 'The programme could not be loaded.', + ], +]; diff --git a/hub/app/invites.php b/hub/app/invites.php index 3e9a0dd..58dd74e 100644 --- a/hub/app/invites.php +++ b/hub/app/invites.php @@ -106,13 +106,13 @@ function invites_list(): array function invite_status(array $invite): string { if ($invite['revoked_at'] !== null) { - return 'widerrufen'; + return 'revoked'; } if ($invite['used_at'] !== null) { - return 'eingelöst'; + return 'used'; } if ($invite['expires_at'] !== null && $invite['expires_at'] <= utc_now()) { - return 'abgelaufen'; + return 'expired'; } - return 'offen'; + return 'open'; } diff --git a/hub/app/pages.php b/hub/app/pages.php index a543201..78b4640 100644 --- a/hub/app/pages.php +++ b/hub/app/pages.php @@ -12,7 +12,7 @@ function page_handle(string $method, string $path): void { $path = '/' . trim($path, '/'); if (!in_array($method, ['GET', 'POST'], true)) { - abort_page(405, 'Diese Methode ist nicht erlaubt.'); + abort_page(405, t('page.method_not_allowed')); } if ($path === '/health') { @@ -20,11 +20,20 @@ function page_handle(string $method, string $path): void return; } + // Sprachwahl über den DE/EN-Umschalter; muss auch ohne Anmeldung gehen. + if ($path === '/language') { + $lang = strtolower(substr(query_string('lang'), 0, 2)); + if (in_array($lang, HUB_LOCALES, true)) { + hub_locale_set($lang); + } + redirect(auth_next_url('/')); + } + $user = auth_user(); if ($user !== null && $user['must_change_password'] === 1 - && !in_array($path, ['/account', '/account/password', '/logout'], true) + && !in_array($path, ['/account', '/account/password', '/logout', '/language'], true) ) { - flash('info', 'Bitte zuerst das Passwort ändern.'); + flash('info', t('auth.change_password_first')); redirect('/account'); } @@ -41,7 +50,7 @@ function page_handle(string $method, string $path): void redirect('/'); } auth_logout(); - flash('success', 'Abgemeldet.'); + flash('success', t('auth.logged_out')); redirect('/login'); } if ($path === '/') { @@ -94,7 +103,7 @@ function page_handle(string $method, string $path): void } if ($path === '/admin/audit') { require_admin_page(); - render_page('admin_audit', ['entries' => audit_list(200)], 'Audit-Log'); + render_page('admin_audit', ['entries' => audit_list(200)], t('page.admin_audit')); return; } @@ -115,7 +124,7 @@ function page_handle(string $method, string $path): void return; } - abort_page(404, 'Diese Seite gibt es nicht.'); + abort_page(404, t('page.not_found')); } function health_check(): void @@ -163,19 +172,19 @@ function page_login(string $method): void 'error' => $error, 'login' => $login, 'next' => $next, - ], 'Anmelden'); + ], t('page.login')); } function username_error(string $username): ?string { if (mb_strlen($username, 'UTF-8') < 3 || mb_strlen($username, 'UTF-8') > 32) { - return 'Der Benutzername muss 3 bis 32 Zeichen lang sein.'; + return t('username.length'); } if (preg_match('/^[a-z0-9](?:[a-z0-9._-]{1,30}[a-z0-9])$/u', $username) !== 1) { - return 'Nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich und Unterstrich; Anfang und Ende alphanumerisch.'; + return t('username.charset'); } if (in_array($username, HUB_RESERVED_USERNAMES, true)) { - return 'Dieser Benutzername ist reserviert.'; + return t('username.reserved'); } return null; } @@ -209,7 +218,7 @@ function page_register(string $method): void $input['email'] = post_string('email'); if ($invite === null) { - $errors[] = 'Dieser Einladungscode ist ungültig, abgelaufen oder bereits eingelöst.'; + $errors[] = t('register.invalid_invite'); } elseif (!empty($invite['email']) && $input['email'] === '') { $input['email'] = (string) $invite['email']; } @@ -221,15 +230,15 @@ function page_register(string $method): void $input['display_name'] = $input['username']; } if (mb_strlen($input['display_name'], 'UTF-8') > 64) { - $errors[] = 'Der Anzeigename darf höchstens 64 Zeichen lang sein.'; + $errors[] = t('register.display_name_long'); } if ($input['email'] !== '' && filter_var($input['email'], FILTER_VALIDATE_EMAIL) === false) { - $errors[] = 'Die E-Mail-Adresse ist nicht gültig.'; + $errors[] = t('register.email_invalid'); } if ($invite !== null && !empty($invite['email']) && strcasecmp((string) $invite['email'], $input['email']) !== 0 ) { - $errors[] = 'Diese Einladung ist an eine andere E-Mail-Adresse gebunden.'; + $errors[] = t('register.email_mismatch'); } $password = (string) ($_POST['password'] ?? ''); $repeat = (string) ($_POST['password_repeat'] ?? ''); @@ -238,10 +247,10 @@ function page_register(string $method): void $errors[] = $policy; } if ($password !== $repeat) { - $errors[] = 'Die Passwortwiederholung passt nicht.'; + $errors[] = t('register.password_mismatch'); } if (($_POST['rights'] ?? '') !== '1') { - $errors[] = 'Bitte die Beta-Regeln akzeptieren.'; + $errors[] = t('register.rights_required'); } if (!$errors && $invite !== null) { @@ -268,7 +277,7 @@ function page_register(string $method): void $newId = (int) $pdo->lastInsertId(); if (!invite_consume((int) $invite['id'], $newId)) { $pdo->rollBack(); - $errors[] = 'Der Einladungscode wurde gerade eingelöst. Bitte einen neuen Code anfordern.'; + $errors[] = t('register.invite_taken'); } else { audit('invite.use', 'invite', (int) $invite['id'], $input['username'], $newId); audit('user.register', 'user', $newId, $input['username'], $newId); @@ -279,9 +288,9 @@ function page_register(string $method): void $pdo->rollBack(); } if (str_contains($exception->getMessage(), 'uq_users_username')) { - $errors[] = 'Dieser Benutzername ist schon vergeben.'; + $errors[] = t('register.username_taken'); } elseif (str_contains($exception->getMessage(), 'uq_users_email')) { - $errors[] = 'Diese E-Mail-Adresse ist schon registriert.'; + $errors[] = t('register.email_taken'); } else { throw $exception; } @@ -291,7 +300,7 @@ function page_register(string $method): void $user = auth_user_by_id($newId); if ($user !== null) { auth_login($user); - flash('success', 'Willkommen im Kür-Hub!'); + flash('success', t('auth.welcome')); redirect('/'); } } @@ -303,7 +312,7 @@ function page_register(string $method): void 'code' => $code, 'errors' => $errors, 'input' => $input, - ], 'Registrieren'); + ], t('page.register')); } function page_dashboard(string $method): void @@ -320,7 +329,7 @@ function page_dashboard(string $method): void 'pages' => $result['pages'], 'query' => $query, 'mine' => $mine, - ], 'Küren'); + ], t('page.dashboard')); } function page_routine_detail(int $id, string $method): void @@ -328,10 +337,10 @@ function page_routine_detail(int $id, string $method): void $user = auth_require_login(); $routine = routine_fetch($id); if ($routine === null) { - abort_page(404, 'Diese Kür gibt es nicht.'); + abort_page(404, t('routine.not_found')); } if (!routine_can_view($routine, $user)) { - abort_page(403, 'Diese Kür ist nicht freigegeben.'); + abort_page(403, t('routine.forbidden')); } render_page('routine', [ 'routine' => $routine, @@ -345,10 +354,10 @@ function page_routine_file(int $id, string $kind): void $user = auth_require_login(); $routine = routine_fetch($id); if ($routine === null) { - abort_page(404, 'Diese Kür gibt es nicht.'); + abort_page(404, t('routine.not_found')); } if (!routine_can_view($routine, $user)) { - abort_page(403, 'Diese Kür ist nicht freigegeben.'); + abort_page(403, t('routine.forbidden')); } routine_send_file($routine, $kind); } @@ -366,10 +375,10 @@ function page_upload(string $method): void if ($method === 'POST') { csrf_require(); if (!routine_upload_quota_ok((int) $user['id'])) { - $errors[] = 'Stündliches Upload-Limit erreicht. Bitte später erneut versuchen.'; + $errors[] = t('upload.quota'); } if (($_POST['rights'] ?? '') !== '1') { - $errors[] = 'Bitte bestätigen, dass du Kür und Musik teilen darfst.'; + $errors[] = t('upload.rights_confirm'); } if (!$errors) { $package = routine_validate_package($_POST); @@ -378,16 +387,16 @@ function page_upload(string $method): void } else { $duplicate = routine_duplicate_exists((int) $user['id'], $package); if ($duplicate !== null) { - flash('info', 'Diese Kür ist bereits im Hub.'); + flash('info', t('upload.duplicate')); redirect('/routines/' . $duplicate); } try { $routineId = routine_create((int) $user['id'], $package); - flash('success', 'Kür veröffentlicht.'); + flash('success', t('upload.published')); redirect('/routines/' . $routineId); } catch (Throwable $error) { hub_log('Upload fehlgeschlagen: ' . $error->getMessage()); - $errors[] = 'Die Kür konnte nicht gespeichert werden.'; + $errors[] = t('upload.save_failed'); } } } @@ -400,7 +409,7 @@ function page_upload(string $method): void 'errors' => $errors, 'input' => $input, 'routine' => null, - ], 'Kür hochladen'); + ], t('page.upload')); } function page_routine_revise(int $id, string $method): void @@ -408,10 +417,10 @@ function page_routine_revise(int $id, string $method): void $user = auth_require_login(); $routine = routine_fetch($id); if ($routine === null) { - abort_page(404, 'Diese Kür gibt es nicht.'); + abort_page(404, t('routine.not_found')); } if (!routine_can_edit($routine, $user)) { - abort_page(403, 'Nur der Eigentümer oder ein Admin kann diese Kür ändern.'); + abort_page(403, t('routine.edit_forbidden')); } $errors = []; $input = [ @@ -423,10 +432,10 @@ function page_routine_revise(int $id, string $method): void if ($method === 'POST') { csrf_require(); if (!routine_upload_quota_ok((int) $user['id'])) { - $errors[] = 'Stündliches Upload-Limit erreicht. Bitte später erneut versuchen.'; + $errors[] = t('upload.quota'); } if (($_POST['rights'] ?? '') !== '1') { - $errors[] = 'Bitte bestätigen, dass du Kür und Musik teilen darfst.'; + $errors[] = t('upload.rights_confirm'); } if (!$errors) { $package = routine_validate_package($_POST); @@ -435,11 +444,11 @@ function page_routine_revise(int $id, string $method): void } else { try { $revision = routine_add_revision($id, (int) $user['id'], $package); - flash('success', 'Neue Revision ' . $revision . ' gespeichert.'); + flash('success', t('revision.saved', ['revision' => $revision])); redirect('/routines/' . $id); } catch (Throwable $error) { hub_log('Revision fehlgeschlagen: ' . $error->getMessage()); - $errors[] = 'Die Revision konnte nicht gespeichert werden.'; + $errors[] = t('revision.save_failed'); } } } @@ -452,7 +461,7 @@ function page_routine_revise(int $id, string $method): void 'errors' => $errors, 'input' => $input, 'routine' => $routine, - ], 'Neue Revision'); + ], t('page.revision')); } function page_routine_status(int $id, string $action, string $method): void @@ -464,14 +473,14 @@ function page_routine_status(int $id, string $action, string $method): void csrf_require(); $routine = routine_fetch($id); if ($routine === null) { - abort_page(404, 'Diese Kür gibt es nicht.'); + abort_page(404, t('routine.not_found')); } if (!routine_can_edit($routine, $user)) { - abort_page(403, 'Nur der Eigentümer oder ein Admin kann diese Kür ändern.'); + abort_page(403, t('routine.edit_forbidden')); } $status = $action === 'publish' ? 'published' : 'hidden'; routine_set_status($id, $status); - flash('success', $status === 'published' ? 'Kür ist wieder sichtbar.' : 'Kür wurde aus dem Hub genommen.'); + flash('success', $status === 'published' ? t('routine.published_again') : t('routine.hidden_now')); redirect('/routines/' . $id); } @@ -480,7 +489,7 @@ function page_account(string $method): void $user = auth_require_login(); render_page('account', [ 'tokens' => tokens_list((int) $user['id']), - ], 'Konto'); + ], t('page.account')); } function page_account_password(string $method): void @@ -496,14 +505,14 @@ function page_account_password(string $method): void $errors = []; if (!password_verify($current, (string) $user['password_hash'])) { - $errors[] = 'Das aktuelle Passwort ist falsch.'; + $errors[] = t('account.current_wrong'); } $policy = password_policy_error($password, (string) $user['username']); if ($policy !== null) { $errors[] = $policy; } if ($password !== $repeat) { - $errors[] = 'Die Passwortwiederholung passt nicht.'; + $errors[] = t('register.password_mismatch'); } if ($errors) { foreach ($errors as $error) { @@ -517,7 +526,7 @@ function page_account_password(string $method): void )->execute([hash_password($password), utc_now(), (int) $user['id']]); auth_revoke_sessions((int) $user['id']); audit('user.password_change', 'user', (int) $user['id']); - flash('success', 'Passwort geändert. Andere Sitzungen wurden abgemeldet.'); + flash('success', t('account.password_changed')); redirect('/account'); } @@ -533,7 +542,7 @@ function page_account_token_create(string $method): void $name = 'App'; } $created = token_create((int) $user['id'], $name); - flash_secret('Neuer API-Token – jetzt kopieren, er wird nicht erneut angezeigt', $created['token']); + flash_secret(t('token.created'), $created['token']); redirect('/account'); } @@ -547,9 +556,9 @@ function page_account_token_revoke(string $method): void $tokenId = (int) post_string('token_id'); if (token_revoke($tokenId, (int) $user['id'])) { audit('token.revoke', 'token', $tokenId); - flash('success', 'Token widerrufen.'); + flash('success', t('token.revoked')); } else { - flash('error', 'Token nicht gefunden.'); + flash('error', t('token.not_found')); } redirect('/account'); } @@ -564,7 +573,7 @@ function page_admin_invites(string $method): void $days = (int) post_string('expires_days', '30'); $errors = []; if ($email !== '' && filter_var($email, FILTER_VALIDATE_EMAIL) === false) { - $errors[] = 'Die E-Mail-Adresse ist nicht gültig.'; + $errors[] = t('register.email_invalid'); } if ($errors) { foreach ($errors as $error) { @@ -574,14 +583,14 @@ function page_admin_invites(string $method): void $code = invite_create($note, $email, $days, (int) $admin['id']); $publicUrl = rtrim((string) config('app.public_url', ''), '/'); $link = $publicUrl . '/register?code=' . rawurlencode($code); - flash_secret('Einladungscode', $code . ' – Link: ' . $link); - flash('success', 'Einladung erstellt.'); + flash_secret(t('invite.created_label'), $code . ' – Link: ' . $link); + flash('success', t('invite.created')); } redirect('/admin/invites'); } render_page('admin_invites', [ 'invites' => invites_list(), - ], 'Einladungen'); + ], t('page.admin_invites')); } function page_admin_invite_revoke(string $method): void @@ -594,9 +603,9 @@ function page_admin_invite_revoke(string $method): void $inviteId = (int) post_string('invite_id'); if (invite_revoke($inviteId)) { audit('invite.revoke', 'invite', $inviteId); - flash('success', 'Einladung widerrufen.'); + flash('success', t('invite.revoked')); } else { - flash('error', 'Einladung konnte nicht widerrufen werden.'); + flash('error', t('invite.revoke_failed')); } redirect('/admin/invites'); } @@ -608,7 +617,7 @@ function page_admin_users(string $method): void 'SELECT u.*, (SELECT COUNT(*) FROM routines r WHERE r.owner_id = u.id) AS routine_count FROM users u ORDER BY u.created_at DESC, u.id DESC' )->fetchAll(); - render_page('admin_users', ['users' => $users], 'Benutzer'); + render_page('admin_users', ['users' => $users], t('page.admin_users')); } function page_admin_user_action(string $method): void @@ -622,11 +631,11 @@ function page_admin_user_action(string $method): void $action = post_string('action'); $target = auth_user_by_id($targetId); if ($target === null) { - flash('error', 'Benutzer nicht gefunden.'); + flash('error', t('user.not_found')); redirect('/admin/users'); } if ($targetId === (int) $admin['id']) { - flash('error', 'Das eigene Konto lässt sich hier nicht ändern.'); + flash('error', t('user.self_change')); redirect('/admin/users'); } @@ -634,11 +643,11 @@ function page_admin_user_action(string $method): void db()->prepare("UPDATE users SET status = 'disabled' WHERE id = ?")->execute([$targetId]); auth_revoke_sessions($targetId); audit('user.disable', 'user', $targetId, (string) $target['username']); - flash('success', 'Benutzer deaktiviert.'); + flash('success', t('user.disabled')); } elseif ($action === 'enable') { db()->prepare("UPDATE users SET status = 'active' WHERE id = ?")->execute([$targetId]); audit('user.enable', 'user', $targetId, (string) $target['username']); - flash('success', 'Benutzer aktiviert.'); + flash('success', t('user.enabled')); } elseif ($action === 'reset') { $alphabet = HUB_INVITE_ALPHABET; $temp = ''; @@ -650,11 +659,11 @@ function page_admin_user_action(string $method): void )->execute([hash_password($temp), utc_now(), $targetId]); auth_revoke_sessions($targetId); audit('user.password_reset', 'user', $targetId, (string) $target['username']); - flash_secret('Temporäres Passwort für ' . $target['username'], $temp); - flash('info', 'Der Benutzer muss das Passwort bei der nächsten Anmeldung ändern.'); + flash_secret(t('user.temp_password', ['user' => $target['username']]), $temp); + flash('info', t('user.must_change')); } elseif ($action === 'delete') { if (($_POST['confirm'] ?? '') !== '1') { - flash('error', 'Löschen muss bestätigt werden.'); + flash('error', t('user.delete_confirm_required')); redirect('/admin/users'); } $stmt = db()->prepare('SELECT id FROM routines WHERE owner_id = ?'); @@ -666,9 +675,9 @@ function page_admin_user_action(string $method): void ->execute([utc_now(), $targetId]); audit('user.delete', 'user', $targetId, (string) $target['username']); db()->prepare('DELETE FROM users WHERE id = ?')->execute([$targetId]); - flash('success', 'Benutzer und zugehörige Küren gelöscht.'); + flash('success', t('user.deleted')); } else { - flash('error', 'Unbekannte Aktion.'); + flash('error', t('action.unknown')); } redirect('/admin/users'); } @@ -685,7 +694,7 @@ function page_admin_routines(string $method): void 'page' => $result['page'], 'pages' => $result['pages'], 'query' => $query, - ], 'Alle Küren'); + ], t('page.admin_routines')); } function page_admin_routine_action(string $method): void @@ -699,21 +708,21 @@ function page_admin_routine_action(string $method): void $action = post_string('action'); $routine = routine_fetch($routineId); if ($routine === null) { - flash('error', 'Kür nicht gefunden.'); + flash('error', t('routine.not_found_short')); redirect('/admin/routines'); } if ($action === 'hide' || $action === 'publish') { routine_set_status($routineId, $action === 'publish' ? 'published' : 'hidden'); - flash('success', 'Status geändert.'); + flash('success', t('admin.status_changed')); } elseif ($action === 'delete') { if (($_POST['confirm'] ?? '') !== '1') { - flash('error', 'Löschen muss bestätigt werden.'); + flash('error', t('user.delete_confirm_required')); redirect('/admin/routines'); } routine_delete($routineId); - flash('success', 'Kür endgültig gelöscht.'); + flash('success', t('routine.deleted')); } else { - flash('error', 'Unbekannte Aktion.'); + flash('error', t('action.unknown')); } redirect('/admin/routines'); } diff --git a/hub/app/routines.php b/hub/app/routines.php index ce6dac7..1b98fd2 100644 --- a/hub/app/routines.php +++ b/hub/app/routines.php @@ -47,11 +47,11 @@ function routine_music_name_valid(string $name): bool function upload_error_message(int $code): string { return match ($code) { - UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE => 'Die Datei ist zu groß.', - UPLOAD_ERR_PARTIAL => 'Der Upload wurde unterbrochen.', - UPLOAD_ERR_NO_FILE => 'Es wurde keine Datei ausgewählt.', - UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION => 'Die Datei konnte nicht gespeichert werden.', - default => 'Unbekannter Upload-Fehler.', + UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE => t('upload.file_too_large'), + UPLOAD_ERR_PARTIAL => t('upload.interrupted'), + UPLOAD_ERR_NO_FILE => t('upload.no_file_chosen'), + UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION => t('upload.store_failed'), + default => t('upload.unknown_error'), }; } @@ -112,20 +112,20 @@ function routine_validate_package(array $post): array $routineFile = $_FILES['routine'] ?? null; if (!is_array($routineFile) || ($routineFile['error'] ?? UPLOAD_ERR_NO_FILE) !== UPLOAD_ERR_OK) { - $errors[] = 'Bitte eine Kür-Datei (.json) auswählen.'; + $errors[] = t('upload.select_routine'); return ['ok' => false, 'errors' => $errors]; } $routineTmp = (string) $routineFile['tmp_name']; $routineBytes = (int) $routineFile['size']; if (!is_uploaded_file($routineTmp)) { - return ['ok' => false, 'errors' => ['Ungültiger Upload.']]; + return ['ok' => false, 'errors' => [t('upload.invalid')]]; } if ($routineBytes <= 0 || $routineBytes > $maxRoutine) { - $errors[] = 'Die Kür-Datei ist zu groß (max. ' . human_bytes($maxRoutine) . ').'; + $errors[] = t('upload.routine_too_large', ['max' => human_bytes($maxRoutine)]); } $routineName = clean_filename((string) ($routineFile['name'] ?? 'kuer.json')); if (!str_ends_with(strtolower($routineName), '.json')) { - $errors[] = 'Kürdateien müssen im JSON-Format vorliegen (.json).'; + $errors[] = t('upload.routine_not_json'); } if ($errors) { return ['ok' => false, 'errors' => $errors]; @@ -133,28 +133,28 @@ function routine_validate_package(array $post): array $contents = file_get_contents($routineTmp); if (!is_string($contents)) { - return ['ok' => false, 'errors' => ['Die Kür-Datei konnte nicht gelesen werden.']]; + return ['ok' => false, 'errors' => [t('upload.read_failed')]]; } try { $json = json_decode($contents, true, 64, JSON_THROW_ON_ERROR); } catch (JsonException) { - return ['ok' => false, 'errors' => ['Die Kür-Datei ist kein gültiges JSON.']]; + return ['ok' => false, 'errors' => [t('upload.invalid_json')]]; } if (!is_array($json)) { - return ['ok' => false, 'errors' => ['Die Kür-Datei enthält kein JSON-Objekt.']]; + return ['ok' => false, 'errors' => [t('upload.no_json_object')]]; } if (($json['format'] ?? '') !== 'rinkplanner.routine') { - return ['ok' => false, 'errors' => ['Das ist keine Rinkplanner-Kür (format fehlt oder ist falsch).']]; + return ['ok' => false, 'errors' => [t('upload.not_rinkplanner')]]; } $formatVersion = (int) ($json['format_version'] ?? 0); if ($formatVersion !== 1) { - return ['ok' => false, 'errors' => ['Diese Kür-Formatversion wird nicht unterstützt.']]; + return ['ok' => false, 'errors' => [t('upload.unsupported_version')]]; } if (!is_array($json['sections'] ?? null)) { - return ['ok' => false, 'errors' => ['Die Kür enthält keine Abschnittsliste.']]; + return ['ok' => false, 'errors' => [t('upload.no_sections')]]; } if (count($json['sections']) > 500) { - return ['ok' => false, 'errors' => ['Die Kür hat zu viele Abschnitte (max. 500).']]; + return ['ok' => false, 'errors' => [t('upload.too_many_sections')]]; } $title = trim((string) ($json['title'] ?? '')); @@ -162,14 +162,14 @@ function routine_validate_package(array $post): array $title = (string) pathinfo($routineName, PATHINFO_FILENAME); } if ($title === '') { - return ['ok' => false, 'errors' => ['Die Kür braucht einen Titel.']]; + return ['ok' => false, 'errors' => [t('upload.title_required')]]; } $title = truncate_text($title, 190); $skater = truncate_text(trim((string) ($json['skater_name'] ?? '')), 190); $category = truncate_text(trim((string) ($json['adult_category'] ?? '')), 40); $musicFile = trim((string) ($json['music_file'] ?? '')); if ($musicFile !== '' && !routine_music_name_valid($musicFile)) { - return ['ok' => false, 'errors' => ['Die Kür verweist auf einen ungültigen Musikdateinamen.']]; + return ['ok' => false, 'errors' => [t('upload.bad_music_name')]]; } $fileRoutineId = trim((string) ($json['routine_id'] ?? '')); @@ -177,10 +177,10 @@ function routine_validate_package(array $post): array $audioFile = $_FILES['audio'] ?? null; $hasAudioUpload = is_array($audioFile) && ($audioFile['error'] ?? UPLOAD_ERR_NO_FILE) !== UPLOAD_ERR_NO_FILE; if ($musicFile !== '' && !$hasAudioUpload) { - $errors[] = 'Die Kür verweist auf „' . $musicFile . '“. Bitte die passende Audiodatei mit hochladen.'; + $errors[] = t('upload.music_missing', ['name' => $musicFile]); } if ($musicFile === '' && $hasAudioUpload) { - $errors[] = 'Die Kür verweist auf keine Musikdatei; die Audiodatei passt nicht dazu.'; + $errors[] = t('upload.music_unexpected'); } if ($hasAudioUpload) { if (($audioFile['error'] ?? UPLOAD_ERR_NO_FILE) !== UPLOAD_ERR_OK) { @@ -190,15 +190,15 @@ function routine_validate_package(array $post): array $audioBytes = (int) $audioFile['size']; $audioName = clean_filename((string) ($audioFile['name'] ?? '')); if (!is_uploaded_file($audioTmp)) { - $errors[] = 'Ungültiger Audio-Upload.'; + $errors[] = t('upload.audio_invalid'); } elseif ($audioBytes <= 0 || $audioBytes > $maxAudio) { - $errors[] = 'Die Audiodatei ist zu groß (max. ' . human_bytes($maxAudio) . ').'; + $errors[] = t('upload.audio_too_large', ['max' => human_bytes($maxAudio)]); } elseif ($audioName !== $musicFile) { - $errors[] = 'Die Audiodatei heißt „' . $audioName . '“, die Kür verweist aber auf „' . $musicFile . '“.'; + $errors[] = t('upload.audio_name_mismatch', ['actual' => $audioName, 'expected' => $musicFile]); } else { $sniffed = audio_sniff($audioTmp); if ($sniffed === null) { - $errors[] = 'Die Audiodatei ist kein unterstütztes Format (MP3, OGG, WAV, M4A, AAC).'; + $errors[] = t('upload.audio_format'); } else { $audio = [ 'tmp' => $audioTmp, @@ -542,9 +542,9 @@ function routine_send_file(array $routine, string $kind, ?array $user = null, bo $revision = routine_fetch((int) $routine['id']); if ($revision === null || $revision['revision_id'] === null) { if ($api) { - abort_api(404, 'no_file', 'Diese Kür hat noch keine Datei.'); + abort_api(404, 'no_file', t('routine.no_file_yet')); } - abort_page(404, 'Diese Kür hat noch keine Datei.'); + abort_page(404, t('routine.no_file_yet')); } if ($kind === 'audio') { $path = (string) ($revision['audio_path'] ?? ''); @@ -558,16 +558,16 @@ function routine_send_file(array $routine, string $kind, ?array $user = null, bo $absolute = storage_path($path); if ($path === '' || !is_file($absolute)) { if ($api) { - abort_api(404, 'file_missing', 'Die Datei fehlt im Speicher.'); + abort_api(404, 'file_missing', t('routine.file_missing')); } - abort_page(404, 'Die Datei fehlt im Speicher.'); + abort_page(404, t('routine.file_missing')); } $handle = fopen($absolute, 'rb'); if ($handle === false) { if ($api) { - abort_api(500, 'file_unreadable', 'Die Datei konnte nicht geöffnet werden.'); + abort_api(500, 'file_unreadable', t('routine.file_unreadable')); } - abort_page(500, 'Die Datei konnte nicht geöffnet werden.'); + abort_page(500, t('routine.file_unreadable')); } $user ??= auth_user(); diff --git a/hub/app/tokens.php b/hub/app/tokens.php index cc82c75..2db4f43 100644 --- a/hub/app/tokens.php +++ b/hub/app/tokens.php @@ -99,14 +99,14 @@ function api_require_user(): array { $token = bearer_token(); if ($token === '') { - abort_api(401, 'unauthorized', 'Bearer-Token fehlt.'); + abort_api(401, 'unauthorized', t('api.bearer_missing')); } $user = token_user($token); if ($user === null) { - abort_api(401, 'invalid_token', 'Token ist ungültig, abgelaufen oder widerrufen.'); + abort_api(401, 'invalid_token', t('api.token_invalid')); } if ($user['must_change_password'] === 1) { - abort_api(403, 'password_change_required', 'Bitte zuerst im Web das Passwort ändern.'); + abort_api(403, 'password_change_required', t('api.change_password_web')); } return $user; } diff --git a/hub/app/util.php b/hub/app/util.php index b89643e..753de0d 100644 --- a/hub/app/util.php +++ b/hub/app/util.php @@ -84,6 +84,9 @@ function url(string $path = '/'): string return $base . $path; } +/** Cache-Buster für /assets/: bei Änderungen an hub.css erhöhen. */ +const HUB_ASSET_VERSION = '3'; + function redirect(string $path, int $status = 303): never { header('Location: ' . url($path), true, $status); @@ -141,17 +144,27 @@ function fmt_dt(?string $utc): string } try { $date = new DateTimeImmutable($utc, new DateTimeZone('UTC')); - return $date->setTimezone(new DateTimeZone('Europe/Berlin'))->format('d.m.Y H:i'); + $format = hub_locale() === 'en' ? 'Y-m-d H:i' : 'd.m.Y H:i'; + return $date->setTimezone(new DateTimeZone('Europe/Berlin'))->format($format); } catch (Throwable) { return '–'; } } +/** Zahl mit den Trennzeichen der aktuellen Sprache. */ +function fmt_number(float $value, int $decimals = 1): string +{ + if (hub_locale() === 'en') { + return number_format($value, $decimals, '.', ','); + } + return number_format($value, $decimals, ',', '.'); +} + function human_bytes(int|float|null $bytes): string { $bytes = (float) ($bytes ?? 0); if ($bytes < 1024) { - return number_format($bytes, 0, ',', '.') . ' B'; + return fmt_number($bytes, 0) . ' B'; } $units = ['KB', 'MB', 'GB']; $index = -1; @@ -159,7 +172,7 @@ function human_bytes(int|float|null $bytes): string $bytes /= 1024; $index++; } while ($bytes >= 1024 && $index < count($units) - 1); - return number_format($bytes, 1, ',', '.') . ' ' . $units[$index]; + return fmt_number($bytes, 1) . ' ' . $units[$index]; } function truncate_text(string $value, int $length): string @@ -229,7 +242,7 @@ function csrf_valid(): bool function csrf_require(): void { if (!csrf_valid()) { - abort_page(419, 'Die Sitzung ist abgelaufen. Bitte die Seite neu laden.'); + abort_page(419, t('auth.session_expired')); } } @@ -272,11 +285,11 @@ function render(string $view, array $data = []): string return (string) ob_get_clean(); } -function render_page(string $view, array $data = [], string $title = 'Kür-Hub'): void +function render_page(string $view, array $data = [], ?string $title = null): void { $content = render($view, $data); echo render('layout', [ - 'title' => $title, + 'title' => $title ?? t('page.title_default'), 'content' => $content, 'user' => auth_user(), ]); @@ -287,7 +300,7 @@ function abort_page(int $status, string $message): never http_response_code($status); $content = render('error', ['status' => $status, 'message' => $message]); echo render('layout', [ - 'title' => 'Fehler ' . $status, + 'title' => t('page.title_error', ['status' => $status]), 'content' => $content, 'user' => auth_user(), ]); @@ -303,13 +316,13 @@ function password_policy_error(string $password, string $username = ''): ?string { $length = mb_strlen($password, 'UTF-8'); if ($length < 10) { - return 'Das Passwort muss mindestens 10 Zeichen lang sein.'; + return t('password.min'); } if ($length > 200) { - return 'Das Passwort darf höchstens 200 Zeichen lang sein.'; + return t('password.max'); } if ($username !== '' && mb_strtolower($password) === mb_strtolower($username)) { - return 'Das Passwort darf nicht dem Benutzernamen entsprechen.'; + return t('password.same_as_username'); } return null; } diff --git a/hub/views/_admin_nav.php b/hub/views/_admin_nav.php index 2644760..2ebbe83 100644 --- a/hub/views/_admin_nav.php +++ b/hub/views/_admin_nav.php @@ -1,7 +1,7 @@ diff --git a/hub/views/account.php b/hub/views/account.php index 272cd52..175f6eb 100644 --- a/hub/views/account.php +++ b/hub/views/account.php @@ -2,51 +2,58 @@
-

Konto

-

·

+

+

·

-
Bitte ein neues Passwort setzen, bevor du den Hub weiter nutzt.
+
-

Passwort ändern

+

- +
-

API-Tokens

-

Für die Godot-App. Ein Token ersetzt Benutzername und Passwort im Client und lässt sich jederzeit widerrufen.

+

+

- - + +
- + + + + + + + + @@ -55,13 +62,13 @@ - + @@ -71,7 +78,7 @@
NamePrefixErstelltZuletztStatus
…
- +
-

Noch kein Token erzeugt.

+

diff --git a/hub/views/admin_audit.php b/hub/views/admin_audit.php index bb7d79b..57d5496 100644 --- a/hub/views/admin_audit.php +++ b/hub/views/admin_audit.php @@ -1,20 +1,27 @@
-

Verwaltung

-

Die letzten Ereignisse.

+

+

count($entries)])) ?>

-

Noch keine Einträge.

+

- + + + + + + + + diff --git a/hub/views/admin_invites.php b/hub/views/admin_invites.php index a360248..949d2f9 100644 --- a/hub/views/admin_invites.php +++ b/hub/views/admin_invites.php @@ -1,63 +1,71 @@
-

Verwaltung

-

Einladungen für die geschlossene Beta.

+

+

-

Neue Einladung

-

Der Code wird nach dem Anlegen genau einmal angezeigt. Er gilt für ein Konto.

+

+

- +
-

Einladungen

+

-

Noch keine Einladungen.

+

ZeitAkteurAktionObjektDetailIP
- + + + + + + + + + 'open', - 'eingelöst' => 'used', - 'abgelaufen' => 'expired', - 'widerrufen' => 'revoked', + 'open' => 'open', + 'used' => 'used', + 'expired' => 'expired', + 'revoked' => 'revoked', ][$status] ?? 'expired'; ?> - + diff --git a/hub/views/admin_routines.php b/hub/views/admin_routines.php index 4d8f71c..31e23cf 100644 --- a/hub/views/admin_routines.php +++ b/hub/views/admin_routines.php @@ -17,26 +17,34 @@ $linkFor = static function (int $targetPage) use ($query): string { ?>
-

Verwaltung

-

Küren insgesamt, auch versteckte.

+

+

(int) $total])) ?>

- - + +
-

Keine Küren gefunden.

+

ErstelltNotizE-MailStatusVon / anGültig bis
@@ -66,11 +74,11 @@ - +
- +
- + + + + + + + + + @@ -53,19 +61,19 @@ $linkFor = static function (int $targetPage) use ($query): string { - +
- löschen +
- +
@@ -78,9 +86,9 @@ $linkFor = static function (int $targetPage) use ($query): string { 1): ?> diff --git a/hub/views/admin_users.php b/hub/views/admin_users.php index 174ac75..cede995 100644 --- a/hub/views/admin_users.php +++ b/hub/views/admin_users.php @@ -2,18 +2,26 @@
-

Verwaltung

-

Beta-Konten verwalten.

+

+

-

Benutzer

+

TitelVonStatusRev.AktualisiertDownloadsAktionen
- + + + + + + + + + @@ -25,10 +33,10 @@
- + @@ -36,7 +44,7 @@
BenutzerRolleStatusKürenRegistriertLetzte AnmeldungAktionen
- + - eigenes Konto +
@@ -44,33 +52,33 @@ - +
- +
- +
- löschen +
- +
diff --git a/hub/views/dashboard.php b/hub/views/dashboard.php index e556b85..5023ade 100644 --- a/hub/views/dashboard.php +++ b/hub/views/dashboard.php @@ -24,39 +24,42 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string { alt="Rinkplanner-Hub-Logo: drei Schlittschuhe, durch ein Netz verbunden" width="132" height="132">
-

Viele Schlittschuhe, ein Netz

-

Küren teilen, Fassungen vergleichen, gemeinsam weiterentwickeln.

-

Der Hub sammelt Küren, Musik und Revisionen deines Teams an einem Ort.

+

+

+

-

Küren

-

im Hub.

+

+

(int) $total, + 'label' => t($total === 1 ? 'dashboard.one_routine' : 'dashboard.many_routines'), + ])) ?>.

- Kür hochladen +
- Alle - Meine Küren + +
-

Keine Küren gefunden.

+

-

Suche zurücksetzen oder selbst eine Kür hochladen.

+

.

-

Der Hub ist noch leer. Erste Kür hochladen.

+

.

@@ -64,13 +67,13 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string { - - - - - - - + + + + + + + @@ -79,7 +82,7 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
TitelSkaterMusikRev.GrößeAktualisiertVon
- versteckt + @@ -110,11 +113,11 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string { 1): ?> diff --git a/hub/views/error.php b/hub/views/error.php index a2f999c..eb890df 100644 --- a/hub/views/error.php +++ b/hub/views/error.php @@ -1,7 +1,7 @@
-

Fehler

+

(int) $status])) ?>

-

Zurück zur Küren-Übersicht.

+

.

diff --git a/hub/views/layout.php b/hub/views/layout.php index 6d7e1ea..0c863f5 100644 --- a/hub/views/layout.php +++ b/hub/views/layout.php @@ -3,16 +3,18 @@ /** @var string $content */ /** @var array|null $user */ $flashes = flash_pull(); +$locale = hub_locale(); +$next = (string) ($_SERVER['REQUEST_URI'] ?? '/'); ?> - + - <?= e($title) ?> · Rinkplanner-Hub + <?= e($title) ?> · <?= e(t('app.name')) ?> - +
@@ -22,19 +24,25 @@ $flashes = flash_pull();
@@ -44,7 +52,7 @@ $flashes = flash_pull();
- +
@@ -60,8 +68,8 @@ $flashes = flash_pull(); diff --git a/hub/views/login.php b/hub/views/login.php index 161ed1c..79708dc 100644 --- a/hub/views/login.php +++ b/hub/views/login.php @@ -2,8 +2,8 @@
-

Anmelden

-

Der Kür-Hub ist in einer geschlossenen Beta. Zugang gibt es per Einladungscode.

+

+

@@ -13,19 +13,19 @@ - + -

Noch keinen Zugang? Ein Beta-Code kommt von der Hub-Administration.

+

diff --git a/hub/views/register.php b/hub/views/register.php index 006e388..396a608 100644 --- a/hub/views/register.php +++ b/hub/views/register.php @@ -3,8 +3,8 @@
-

Beta-Zugang einlösen

-

Ein Einladungscode legt genau ein Konto an. Der Code verliert danach seine Gültigkeit.

+

+

@@ -19,44 +19,44 @@
- +
-

Schon ein Konto? Anmelden

+

diff --git a/hub/views/routine.php b/hub/views/routine.php index 012c5a1..398be5f 100644 --- a/hub/views/routine.php +++ b/hub/views/routine.php @@ -1,93 +1,93 @@ - +
-

Küren / Kür

+

/

- · Revision + · (int) ($routine['revision'] ?? 0)])) ?> · - · versteckt + ·

- Du kannst diese Kür verwalten. - Neue Revision hochladen + +
- +
- +
- In der Verwaltung öffnen +
-

Beschreibung

+

-

Musik

+

·

-

Details

+

-
Skater
-
Kategorie
-
Musiktitel
-
Musik
-
Kür-Datei
·
-
Audio-Datei
-
Downloads
-
Eingestellt
+
+
+
+
+
·
+
+
+
-

Prüfsummen

+

- Kür +
- Musik +
-

Beim Download prüfen, ob die SHA-256-Summe zur Kür passt.

+

diff --git a/hub/views/upload.php b/hub/views/upload.php index 01e1fe7..bbc4f1b 100644 --- a/hub/views/upload.php +++ b/hub/views/upload.php @@ -3,11 +3,11 @@
-

+

-

Neue Fassung von „“. Die bisherige Revision bleibt erhalten.

+

$routine['title']])) ?>

-

Lade die Kür-JSON und – falls die Kür Musik nutzt – die zugehörige Audiodatei hoch. Beide gehören als Paket zusammen.

+

@@ -26,41 +26,41 @@
- - Abbrechen + +
diff --git a/hub/web/assets/hub.css b/hub/web/assets/hub.css index 9846f68..2077ed9 100644 --- a/hub/web/assets/hub.css +++ b/hub/web/assets/hub.css @@ -141,6 +141,30 @@ code { color: var(--gold) !important; } +.lang-switch { + align-items: center; + background: rgba(11, 32, 54, 0.7); + border: 1px solid var(--line); + border-radius: 999px; + display: inline-flex; + gap: 2px; + padding: 2px; +} + +.lang-switch a { + border-radius: 999px; + font-size: 0.75rem; + font-weight: 600; + letter-spacing: 0.06em; + padding: 0.15rem 0.55rem; + text-transform: uppercase; +} + +.lang-switch a[aria-current="true"] { + background: linear-gradient(135deg, var(--blue), var(--deep-blue)); + color: var(--ink); +} + .page { margin: 0 auto; max-width: 1180px; diff --git a/tools/deploy_hub.sh b/tools/deploy_hub.sh index d3098e3..7e63171 100755 --- a/tools/deploy_hub.sh +++ b/tools/deploy_hub.sh @@ -221,11 +221,77 @@ do_check() { [[ "$config_code" == "403" || "$config_code" == "404" ]] && echo "Konfiguration gesperrt: OK" || { echo "Konfiguration erreichbar: HTTP $config_code" >&2; ok=1; } [[ "$storage_code" == "403" || "$storage_code" == "404" ]] && echo "Storage gesperrt: OK" || { echo "Storage erreichbar: HTTP $storage_code" >&2; ok=1; } [[ "$install_code" == "404" ]] && echo "Installer entfernt: OK" || echo "Hinweis: Installer liefert HTTP $install_code" >&2 + + check_hub_texts || ok=1 + + local de_page en_page + de_page="$(curl -sS --max-time 30 -H 'Cookie: RHUB_LANG=de' "$PUBLIC_URL/login" || true)" + en_page="$(curl -sS --max-time 30 -H 'Cookie: RHUB_LANG=en' "$PUBLIC_URL/login" || true)" + [[ "$de_page" == *''* ]] && echo "Login deutsch: OK" || { echo "Login deutsch: html lang fehlt" >&2; ok=1; } + [[ "$en_page" == *''* ]] && echo "Login englisch: OK" || { echo "Login englisch: html lang fehlt" >&2; ok=1; } + [[ "$en_page" == *'Sign in'* ]] && echo "Englische Texte: OK" || { echo "Englische Texte fehlen" >&2; ok=1; } + + local switch_headers + switch_headers="$(curl -sS -o /dev/null -D - --max-time 30 "$PUBLIC_URL/language?lang=en&next=%2Flogin" || true)" + if [[ "$switch_headers" == *'RHUB_LANG=en'* ]]; then + echo "Sprachwechsel: OK" + else + echo "Sprachwechsel setzt kein Cookie" >&2 + ok=1 + fi + if [[ "$ok" -ne 0 ]]; then exit 1 fi } +# Prüft, dass de und en dieselben Schlüssel haben und dass jeder in t() +# verwendete Schlüssel im Katalog steht. +check_hub_texts() { + echo "Prüfe Texte (hub/app/i18n_strings.php) …" + python3 - "$HUB_DIR" <<'PY' +import re +import sys +from pathlib import Path + +root = Path(sys.argv[1]) +catalog = (root / 'app' / 'i18n_strings.php').read_text(encoding='utf-8') +blocks = re.split(r"\n '(de|en)' => \[", catalog) +if len(blocks) != 5: + print(' FEHLER: de/en-Blöcke nicht gefunden', file=sys.stderr) + sys.exit(1) + +def keys(block): + return set(re.findall(r"^\s+'([^']+)'\s*=>", block, re.M)) + +de, en = keys(blocks[2]), keys(blocks[4]) +status = 0 +for missing in sorted(de - en): + print(f' FEHLER: en fehlt "{missing}"', file=sys.stderr) + status = 1 +for extra in sorted(en - de): + print(f' FEHLER: de fehlt "{extra}"', file=sys.stderr) + status = 1 + +used = set() +for path in list((root / 'app').glob('*.php')) + list((root / 'views').glob('*.php')): + if path.name.startswith('i18n'): + continue + text = path.read_text(encoding='utf-8') + used.update(re.findall(r"\bt\('([a-z0-9_.]+)'", text)) + +for key in sorted(used - de): + if key.endswith('.'): + continue # dynamisch zusammengesetzt, z. B. t('invite.status.' . $status) + print(f' FEHLER: t(\'{key}\') fehlt im Katalog', file=sys.stderr) + status = 1 + +if status == 0: + print(f' ok: {len(de)} Schlüssel, deckungsgleich und vollständig') +sys.exit(status) +PY +} + case "$MODE" in sync) do_sync ;; install) install_if_needed ;; diff --git a/tools/deploy_web.sh b/tools/deploy_web.sh new file mode 100755 index 0000000..c62e8e7 --- /dev/null +++ b/tools/deploy_web.sh @@ -0,0 +1,180 @@ +#!/usr/bin/env bash +# Website von rinkplanner.programmschmiede.de (Quelle: web/). +# +# Aufruf: +# ./tools/deploy_web.sh --check # Standard: Texte und Live-Seite prüfen +# ./tools/deploy_web.sh --sync # web/ per FTPS hochladen +# ./tools/deploy_web.sh --all # sync + check +# +# Zugangsdaten kommen aus docs/credentials.txt (gitignored). +# Der Docroot der Subdomain ist das FTP-Verzeichnis +# rinkplanner.programmschmiede.de; media/, fonts/ und version.json bleiben +# unangetastet, weil sie nicht in web/ liegen. +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +WEB_DIR="$REPO_ROOT/web" +CREDENTIALS="$REPO_ROOT/docs/credentials.txt" +REMOTE_DIR="rinkplanner.programmschmiede.de" +PUBLIC_URL="https://rinkplanner.programmschmiede.de" + +MODE="check" +while [[ $# -gt 0 ]]; do + case "$1" in + --check) MODE="check" ;; + --sync) MODE="sync" ;; + --all) MODE="all" ;; + -h|--help) + sed -n '2,12p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//' + exit 0 + ;; + *) echo "Unbekannte Option: $1" >&2; exit 2 ;; + esac + shift +done + +[[ -d "$WEB_DIR" ]] || { echo "Fehlt: $WEB_DIR" >&2; exit 1; } + +cred() { + [[ -f "$CREDENTIALS" ]] || { echo "Fehlt: $CREDENTIALS" >&2; exit 1; } + grep -m1 "^$1=" "$CREDENTIALS" | cut -d= -f2- | tr -d '\r' +} + +FTP_URL="$(cred FTP_URL)" +FTP_USER="$(cred FTP_USER)" +FTP_PASSWORD="$(cred FTP_PASSWORD)" + +HOST="${FTP_URL#ftp://}" +HOST="${HOST#ftps://}" +HOST="${HOST%%/*}" +HOST="${HOST%%:*}" +[[ -n "$HOST" && -n "$FTP_USER" ]] || { echo "FTP-Zugang unvollständig." >&2; exit 1; } + +CURL=(curl --ssl-reqd --insecure --silent --show-error --connect-timeout 20 --max-time 300 --user "$FTP_USER:$FTP_PASSWORD") + +fail=0 +problem() { echo " FEHLER: $*" >&2; fail=1; } +ok() { echo " ok: $*"; } + +check_texts() { + echo "Prüfe Texte (web/i18n.php) …" + python3 - "$WEB_DIR/i18n.php" <<'PY' || fail=1 +import re +import sys + +text = open(sys.argv[1], encoding='utf-8').read() +blocks = re.split(r"\n '(de|en)' => \[", text) +if len(blocks) != 5: + print(' FEHLER: de/en-Blöcke nicht gefunden', file=sys.stderr) + sys.exit(1) + +def keys(block): + return re.findall(r"^\s+'([^']+)'\s*=>", block, re.M) + +de = set(keys(blocks[2])) +en = set(keys(blocks[4])) +status = 0 +for missing in sorted(de - en): + print(f' FEHLER: en fehlt "{missing}"', file=sys.stderr) + status = 1 +for extra in sorted(en - de): + print(f' FEHLER: de fehlt "{extra}"', file=sys.stderr) + status = 1 +if status == 0: + print(f' ok: {len(de)} Schlüssel in beiden Sprachen') +sys.exit(status) +PY + + if command -v php >/dev/null 2>&1; then + echo "Prüfe PHP-Syntax …" + while IFS= read -r file; do + php -l "$file" >/dev/null || fail=1 + done < <(find "$WEB_DIR" -name '*.php' | sort) + ok "php -l ohne Befund" + else + echo " Hinweis: kein lokales php; Syntax prüft erst der Server." + fi +} + +http_code() { curl -sS -o /dev/null -w '%{http_code}' --max-time 30 "$@" || true; } + +# Sprache, die / bei diesem Accept-Language-Header wählt. +detected_lang() { + curl -sS -o /dev/null -D - --max-time 30 -H "Accept-Language: $1" "$PUBLIC_URL/" \ + | tr -d '\r' | awk 'tolower($1)=="location:" {print $2}' +} + +check_live() { + echo "Prüfe ${PUBLIC_URL} …" + + [[ "$(detected_lang 'en-US,en;q=0.9')" == "/en/" ]] && ok "/ → /en/ (en-US)" || problem "/ leitet bei en-US nicht auf /en/" + [[ "$(detected_lang 'de-DE,de;q=0.9')" == "/de/" ]] && ok "/ → /de/ (de-DE)" || problem "/ leitet bei de-DE nicht auf /de/" + [[ "$(detected_lang 'fr-FR,fr;q=0.9')" == "/de/" ]] && ok "/ → /de/ (Fallback)" || problem "Fallback ist nicht /de/" + [[ "$(detected_lang 'en;q=0.2,de;q=0.9')" == "/de/" ]] && ok "q-Werte werden beachtet" || problem "q-Werte werden ignoriert" + + local code + code="$(http_code "$PUBLIC_URL/de/")" + [[ "$code" == "200" ]] && ok "/de/ → 200" || problem "/de/ liefert HTTP $code" + code="$(http_code "$PUBLIC_URL/en/")" + [[ "$code" == "200" ]] && ok "/en/ → 200" || problem "/en/ liefert HTTP $code" + + for asset in assets/site.css fonts/fonts.css media/hero-poster.jpg; do + code="$(http_code "$PUBLIC_URL/$asset")" + [[ "$code" == "200" ]] && ok "/$asset → 200" || problem "/$asset liefert HTTP $code" + done + + local legacy + legacy="$(http_code "$PUBLIC_URL/index.html")" + case "$legacy" in + 200|302) ok "/index.html → HTTP $legacy (Weiterleitung oder Altseite)" ;; + *) problem "/index.html liefert HTTP $legacy" ;; + esac + + local de en + de="$(curl -sS --max-time 30 "$PUBLIC_URL/de/" || true)" + en="$(curl -sS --max-time 30 "$PUBLIC_URL/en/" || true)" + + [[ "$de" == *''* ]] && ok "de: html lang=\"de\"" || problem "de: html lang fehlt oder falsch" + [[ "$en" == *''* ]] && ok "en: html lang=\"en\"" || problem "en: html lang fehlt oder falsch" + [[ "$de" == *'Kürplaner'* ]] && ok "de: deutsche Texte" || problem "de: deutsche Texte fehlen" + [[ "$en" == *'programme planner'* ]] && ok "en: englische Texte" || problem "en: englische Texte fehlen" + + if grep -qE '

|

\s*

' <<<"$de$en"; then + problem "leere Überschrift oder leeres Absatz-Element (fehlender Textschlüssel?)" + else + ok "keine leeren Textstellen" + fi + + local vary + vary="$(curl -sS -o /dev/null -D - --max-time 30 -H 'Accept-Language: en' "$PUBLIC_URL/" | tr -d '\r' | awk 'tolower($1)=="vary:" {print}')" + [[ "$vary" == *Accept-Language* ]] && ok "Vary: Accept-Language gesetzt" || problem "Vary: Accept-Language fehlt" +} + +do_sync() { + echo "Lade web/ nach $REMOTE_DIR …" + while IFS= read -r file; do + local relative="${file#"$WEB_DIR"/}" + case "$relative" in + *.swp|.DS_Store) continue ;; + esac + "${CURL[@]}" --ftp-create-dirs -T "$file" "ftp://$HOST/$REMOTE_DIR/$relative" + echo " $relative" + done < <(find "$WEB_DIR" -type f | sort) + echo "Sync fertig." +} + +do_check() { + check_texts + check_live + if [[ "$fail" -ne 0 ]]; then + echo "Prüfung mit Fehlern beendet." >&2 + exit 1 + fi + echo "Alle Prüfungen bestanden." +} + +case "$MODE" in + sync) do_sync ;; + check) do_check ;; + all) do_sync; do_check ;; +esac diff --git a/web/.htaccess b/web/.htaccess new file mode 100644 index 0000000..f61b4d1 --- /dev/null +++ b/web/.htaccess @@ -0,0 +1,7 @@ +# Rinkplanner-Website: Sprachweiche vor den statischen Seiten. +# +# index.php entscheidet anhand von Accept-Language, welche Sprache ausgeliefert +# wird. Der Host erlaubt weder mod_alias noch mod_rewrite, deshalb liegt die +# alte Adresse /index.html als kleine Weiterleitungsseite daneben – sie wird +# nur ausgeliefert, wenn index.php nicht gefunden wird. +DirectoryIndex index.php index.html diff --git a/web/assets/site.css b/web/assets/site.css new file mode 100644 index 0000000..a29bd03 --- /dev/null +++ b/web/assets/site.css @@ -0,0 +1,682 @@ +:root { + --ink: #050d19; + --navy: #071a30; + --ice: #c9f0ff; + --frost: #eefaff; + --sky: #7dd3fc; + --blue: #38bdf8; + --deep-blue: #185a86; + --gold: #f3d7a3; + --text: #f4fbff; + --muted: rgba(224, 244, 255, 0.68); + --line: rgba(190, 230, 255, 0.17); + --glass: rgba(7, 24, 43, 0.58); + --glass-strong: rgba(8, 29, 51, 0.82); + --shadow: 0 30px 80px rgba(0, 0, 0, 0.35); + --radius: 24px; +} + +* { + box-sizing: border-box; +} + +html { + scroll-behavior: smooth; +} + +body { + margin: 0; + min-height: 100vh; + overflow-x: hidden; + background: var(--ink); + color: var(--text); + font-family: "Manrope", "Segoe UI", system-ui, sans-serif; + -webkit-font-smoothing: antialiased; +} + +::selection { + background: rgba(125, 211, 252, 0.35); + color: #fff; +} + +a { + color: var(--ice); +} + +.bg-media { + position: fixed; + inset: 0; + z-index: -3; + overflow: hidden; + background: + radial-gradient(circle at 28% 18%, rgba(56, 189, 248, 0.18), transparent 38%), + radial-gradient(circle at 76% 44%, rgba(24, 90, 134, 0.34), transparent 44%), + linear-gradient(145deg, #050d19 0%, #071a30 48%, #0a2742 100%); +} + +.bg-video { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + object-fit: cover; + opacity: 0.58; + filter: saturate(1.08) contrast(1.04); +} + +body.no-video .bg-video { + display: none; +} + +.bg-shade { + position: absolute; + inset: 0; + background: + linear-gradient(180deg, rgba(3, 9, 18, 0.28) 0%, rgba(3, 9, 18, 0.62) 58%, var(--ink) 100%), + radial-gradient(circle at 50% 42%, transparent 0%, rgba(3, 9, 18, 0.46) 76%); +} + +.bg-aurora { + position: absolute; + inset: -20%; + background: + radial-gradient(ellipse at 18% 55%, rgba(125, 211, 252, 0.16), transparent 34%), + radial-gradient(ellipse at 82% 32%, rgba(243, 215, 163, 0.08), transparent 28%), + radial-gradient(ellipse at 54% 84%, rgba(56, 189, 248, 0.12), transparent 32%); + filter: blur(30px); + animation: aurora 16s ease-in-out infinite alternate; + pointer-events: none; +} + +.trail { + position: fixed; + inset: 0; + z-index: -2; + overflow: hidden; + pointer-events: none; + opacity: 0.58; +} + +.trail svg { + width: 100%; + height: 100%; +} + +.trail-line { + fill: none; + stroke: rgba(201, 240, 255, 0.34); + stroke-width: 1.4; + stroke-linecap: round; + stroke-dasharray: 3 22; + animation: trailDash 9s linear infinite; +} + +.trail-line.two { + stroke: rgba(125, 211, 252, 0.26); + animation-duration: 13s; + animation-direction: reverse; +} + +.trail-line.three { + stroke: rgba(243, 215, 163, 0.16); + animation-duration: 17s; +} + +.grain { + position: fixed; + inset: 0; + z-index: -1; + pointer-events: none; + opacity: 0.05; + background-image: radial-gradient(rgba(255, 255, 255, 0.9) 0.6px, transparent 0.6px); + background-size: 3px 3px; +} + +.site-header { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 20; + display: flex; + align-items: center; + justify-content: space-between; + gap: 24px; + padding: 20px clamp(20px, 5vw, 64px); + background: linear-gradient(180deg, rgba(3, 9, 18, 0.78), transparent); +} + +.brand { + color: var(--text); + text-decoration: none; + font-size: 0.92rem; + font-weight: 800; + letter-spacing: 0.08em; + text-transform: uppercase; + white-space: nowrap; +} + +.brand span { + color: var(--sky); +} + +.site-nav { + display: flex; + align-items: center; + gap: 8px; +} + +.site-nav a { + color: var(--muted); + text-decoration: none; + font-size: 0.82rem; + font-weight: 600; + padding: 9px 14px; + border-radius: 999px; + transition: color 0.2s ease, background 0.2s ease; +} + +.site-nav a:hover { + color: var(--text); + background: rgba(201, 240, 255, 0.08); +} + +.site-nav .nav-back { + color: var(--text); + border: 1px solid var(--line); + background: rgba(7, 24, 43, 0.42); + backdrop-filter: blur(12px); +} + +.lang-switch { + display: flex; + align-items: center; + gap: 2px; + padding: 3px; + border: 1px solid var(--line); + border-radius: 999px; + background: rgba(7, 24, 43, 0.42); + backdrop-filter: blur(12px); +} + +.site-nav .lang-switch a { + padding: 6px 10px; + border-radius: 999px; + font-size: 0.72rem; + font-weight: 800; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.site-nav .lang-switch a[aria-current="page"] { + color: #04111f; + background: linear-gradient(135deg, var(--frost), var(--sky)); +} + +main { + position: relative; + z-index: 1; + width: min(1180px, 100%); + margin: 0 auto; + padding: 0 clamp(20px, 5vw, 64px); +} + +.hero { + min-height: 92vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-align: center; + padding: 150px 0 80px; +} + +.eyebrow, +.section-kicker { + margin: 0 0 22px; + color: var(--sky); + font-size: 0.72rem; + font-weight: 800; + letter-spacing: 0.28em; + text-transform: uppercase; +} + +.eyebrow { + display: inline-flex; + align-items: center; + gap: 10px; +} + +.eyebrow::before { + content: ""; + display: block; + width: 6px; + height: 6px; + border-radius: 50%; + background: var(--sky); + box-shadow: 0 0 18px rgba(125, 211, 252, 0.9); +} + +h1 { + margin: 0 0 -0.24em; + font-family: "Playfair Display", Georgia, serif; + font-size: clamp(2.9rem, 13vw, 9.5rem); + font-weight: 600; + line-height: 0.88; + padding-bottom: 0.28em; + letter-spacing: -0.045em; + background: linear-gradient(180deg, #ffffff 0%, var(--ice) 48%, var(--sky) 100%); + -webkit-background-clip: text; + background-clip: text; + color: transparent; + filter: drop-shadow(0 22px 54px rgba(56, 189, 248, 0.22)); +} + +.lede { + max-width: 650px; + margin: 30px auto 0; + color: var(--muted); + font-size: clamp(1.02rem, 1.8vw, 1.22rem); + font-weight: 400; + line-height: 1.75; +} + +.hero-actions { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 12px; + margin-top: 34px; +} + +.button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 10px; + padding: 14px 24px; + border-radius: 999px; + border: 1px solid transparent; + text-decoration: none; + font-size: 0.94rem; + font-weight: 800; + letter-spacing: 0.01em; + transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease; +} + +.button:hover { + transform: translateY(-2px); +} + +.button-primary { + color: #04111f; + background: linear-gradient(135deg, var(--frost), var(--sky) 48%, var(--blue)); + box-shadow: 0 14px 38px rgba(56, 189, 248, 0.26); +} + +.button-primary:hover { + box-shadow: 0 20px 48px rgba(56, 189, 248, 0.36); +} + +.button-ghost { + color: var(--text); + border-color: var(--line); + background: rgba(7, 24, 43, 0.38); + backdrop-filter: blur(14px); +} + +.button-ghost:hover { + background: rgba(201, 240, 255, 0.09); +} + +.hero-meta { + margin-top: 26px; + color: var(--muted); + font-size: 0.82rem; + letter-spacing: 0.03em; +} + +.section { + padding: 92px 0; + scroll-margin-top: 80px; +} + +.section h2 { + margin: 0; + font-family: "Playfair Display", Georgia, serif; + font-size: clamp(2.2rem, 4.6vw, 3.7rem); + font-weight: 500; + line-height: 1.08; + letter-spacing: -0.025em; +} + +.section-lede { + max-width: 680px; + margin: 18px auto 0; + color: var(--muted); + font-size: 1.02rem; + line-height: 1.7; +} + +.centered { + text-align: center; +} + +.feature-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 16px; + margin-top: 42px; +} + +.feature-card { + padding: 26px; + border: 1px solid var(--line); + border-radius: var(--radius); + background: var(--glass); + box-shadow: var(--shadow); + backdrop-filter: blur(20px); +} + +.feature-icon { + display: flex; + align-items: center; + justify-content: center; + width: 44px; + height: 44px; + margin-bottom: 20px; + border: 1px solid rgba(201, 240, 255, 0.28); + border-radius: 50%; + color: var(--ice); + font-size: 1.25rem; + background: radial-gradient(circle at 30% 20%, rgba(201, 240, 255, 0.22), transparent 60%); +} + +.feature-card h3 { + margin: 0 0 10px; + font-size: 1.02rem; + font-weight: 800; +} + +.feature-card p { + margin: 0; + color: var(--muted); + font-size: 0.9rem; + line-height: 1.68; +} + +.downloads { + padding-top: 70px; +} + +.download-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 18px; + max-width: 920px; + margin: 44px auto 0; +} + +.download-card { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + padding: 34px 30px; + border: 1px solid var(--line); + border-radius: var(--radius); + background: var(--glass-strong); + box-shadow: var(--shadow); + backdrop-filter: blur(24px); +} + +.os-badge { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 84px; + padding: 7px 13px; + border: 1px solid rgba(201, 240, 255, 0.26); + border-radius: 999px; + color: var(--ice); + font-size: 0.68rem; + font-weight: 800; + letter-spacing: 0.16em; + text-transform: uppercase; +} + +.download-card h3 { + margin: 18px 0 8px; + font-size: 1.45rem; + font-weight: 800; +} + +.download-card > p { + margin: 0; + color: var(--muted); + font-size: 0.9rem; + line-height: 1.65; +} + +.download-card .button { + width: 100%; + margin-top: 24px; +} + +.download-card .button span { + font-weight: 600; + opacity: 0.7; +} + +.sub-link { + display: inline-block; + margin-top: 14px; + color: var(--ice); + font-size: 0.82rem; + font-weight: 600; + text-decoration: underline; + text-decoration-color: rgba(201, 240, 255, 0.32); + text-underline-offset: 4px; +} + +.hint { + margin-top: 20px !important; + color: rgba(224, 244, 255, 0.54) !important; + font-size: 0.78rem !important; + line-height: 1.6 !important; +} + +.download-note { + max-width: 720px; + margin: 26px auto 0; + color: rgba(224, 244, 255, 0.5); + font-size: 0.78rem; + line-height: 1.6; + text-align: center; +} + +.notes-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 16px; + margin-top: 36px; +} + +.note-card { + padding: 26px; + border-top: 1px solid var(--line); +} + +.note-card h3 { + margin: 0 0 9px; + font-size: 0.95rem; + font-weight: 800; +} + +.note-card p { + margin: 0; + color: var(--muted); + font-size: 0.88rem; + line-height: 1.66; +} + +.release-list { + display: grid; + gap: 16px; + max-width: 860px; + margin: 36px auto 0; + text-align: left; +} + +.release-card { + padding: 24px 26px; + border: 1px solid var(--line); + border-radius: var(--radius); + background: var(--glass); + backdrop-filter: blur(20px); +} + +.release-head { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 10px; + margin-bottom: 10px; +} + +.release-version { + font-weight: 800; + color: var(--ice); +} + +.release-date { + color: var(--muted); + font-size: 0.8rem; +} + +.release-badge { + margin-left: auto; + padding: 3px 10px; + border: 1px solid rgba(201, 240, 255, 0.28); + border-radius: 999px; + color: var(--ice); + font-size: 0.68rem; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.release-card ul { + margin: 0; + padding-left: 18px; + color: var(--muted); + font-size: 0.9rem; + line-height: 1.7; +} + +.release-card li { + margin-bottom: 6px; +} + +.release-card li:last-child { + margin-bottom: 0; +} + +.site-footer { + position: relative; + z-index: 1; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 12px; + width: min(1180px, 100%); + margin: 30px auto 0; + padding: 30px clamp(20px, 5vw, 64px) 42px; + border-top: 1px solid var(--line); + color: var(--muted); + font-size: 0.78rem; +} + +.site-footer a { + color: var(--muted); + text-decoration: none; +} + +.site-footer a:hover { + color: var(--text); +} + +@keyframes aurora { + from { transform: translate3d(-2%, -1%, 0) scale(1); } + to { transform: translate3d(2%, 2%, 0) scale(1.06); } +} + +@keyframes trailDash { + to { stroke-dashoffset: -260; } +} + +@media (max-width: 900px) { + .feature-grid, + .notes-grid { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .download-grid { + grid-template-columns: 1fr; + max-width: 560px; + } +} + +@media (max-width: 640px) { + .site-header { + padding: 16px 18px; + } + + .site-nav > a:not(.nav-back) { + display: none; + } + + .site-header { + gap: 12px; + } + + .site-nav { + gap: 4px; + } + + .hero { + min-height: 88vh; + padding-top: 126px; + } + + .section { + padding: 68px 0; + } + + .feature-grid, + .notes-grid { + grid-template-columns: 1fr; + } + + .download-card { + padding: 28px 22px; + } + + .bg-video { + opacity: 0.42; + } +} + +@media (prefers-reduced-motion: reduce) { + html { + scroll-behavior: auto; + } + + *, + *::before, + *::after { + animation-duration: 0.001ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.001ms !important; + } +} diff --git a/web/bootstrap.php b/web/bootstrap.php new file mode 100644 index 0000000..fb19f45 --- /dev/null +++ b/web/bootstrap.php @@ -0,0 +1,121 @@ + time() + COOKIE_LIFETIME, + 'path' => '/', + 'secure' => $https, + 'httponly' => false, + 'samesite' => 'Lax', + ]); +} + +/** Beste unterstützte Sprache aus dem Accept-Language-Header, q-Werte beachtet. */ +function accept_language(): ?string +{ + $header = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? ''; + if (!is_string($header) || trim($header) === '') { + return null; + } + + $candidates = []; + foreach (explode(',', $header) as $position => $entry) { + $parts = explode(';', trim($entry)); + $lang = normalize_lang($parts[0]); + if ($lang === null) { + continue; + } + + $quality = 1.0; + foreach (array_slice($parts, 1) as $parameter) { + if (preg_match('/^\s*q\s*=\s*([0-9.]+)\s*$/i', $parameter, $match) === 1) { + $quality = (float) $match[1]; + } + } + if ($quality <= 0) { + continue; + } + + // Pro Sprache zählt der beste Treffer; bei Gleichstand gewinnt die + // Reihenfolge im Header. + if (!isset($candidates[$lang]) || $quality > $candidates[$lang][0]) { + $candidates[$lang] = [$quality, $position]; + } + } + + if ($candidates === []) { + return null; + } + + uasort($candidates, static fn (array $a, array $b): int => $b[0] <=> $a[0] ?: $a[1] <=> $b[1]); + return (string) array_key_first($candidates); +} + +function redirect_lang(string $lang): never +{ + header('Vary: Accept-Language, Cookie'); + header('Location: /' . $lang . '/', true, 302); + exit; +} + +/** Explizite Sprachwahl aus der URL, z. B. /de/?lang=en. */ +function requested_lang(): ?string +{ + $raw = $_GET['lang'] ?? null; + return is_string($raw) ? normalize_lang($raw) : null; +} + +function render_page(string $lang): never +{ + $requested = requested_lang(); + if ($requested !== null && $requested !== $lang) { + set_lang_cookie($requested); + redirect_lang($requested); + } + if ($requested === $lang) { + set_lang_cookie($lang); + } + + $strings = require __DIR__ . '/i18n.php'; + $t = $strings[$lang]; + $alt = $lang === 'de' ? 'en' : 'de'; + + header('Content-Type: text/html; charset=utf-8'); + require __DIR__ . '/template.php'; + exit; +} diff --git a/web/de/index.php b/web/de/index.php new file mode 100644 index 0000000..8a21ad2 --- /dev/null +++ b/web/de/index.php @@ -0,0 +1,6 @@ +), die Inhalte stammen ausschließlich aus +// dieser Datei und werden unverändert ausgegeben. + +declare(strict_types=1); + +return [ + 'de' => [ + 'meta.title' => 'Rinkplanner – Kürplaner für Eiskunstlauf', + 'meta.description' => 'Rinkplanner: Der Kürplaner für Eiskunstlauf. Elemente setzen, Timings planen, 3D-Vorschau und Cloud-Sync. Test-Builds für macOS und Windows.', + + 'nav.label' => 'Seitennavigation', + 'nav.features' => 'Funktionen', + 'nav.downloads' => 'Downloads', + 'nav.news' => 'Was ist neu', + 'nav.home' => 'Startseite', + + 'hero.eyebrow' => 'Eiskunstlauf · Kürplanung', + 'hero.lede' => 'Von der ersten Idee bis zur fertigen Kür: Elemente platzieren, Timings planen, Sprungkombinationen prüfen und die Kür auf dem Tablet oder Desktop zum Leben erwecken.', + 'hero.cta_download' => 'Jetzt herunterladen', + 'hero.cta_features' => 'Funktionen ansehen', + 'hero.meta' => 'Kostenloser Test-Build · macOS & Windows · 12.11.2026', + + 'features.kicker' => 'Alles für die Kür', + 'features.title' => 'Dein Programm. Deine Linien.', + 'features.lede' => 'Rinkplanner verbindet Zeichnung, ISU-Elemente und Timing in einer ruhigen Oberfläche – für die Planung am Schreibtisch und die Abnahme auf dem Eis.', + + 'feature.editor.title' => 'Kür-Editor', + 'feature.editor.body' => 'Linien, Bögen und Sections frei zeichnen. Start, Richtung, Kante und Tiefe direkt am Segment bearbeiten.', + 'feature.elements.title' => 'ISU-Elemente', + 'feature.elements.body' => 'Sprünge, Pirouetten, Sequenzen und Sprungkombinationen mit Kürzel, Level und Standzeit planen.', + 'feature.preview.title' => '3D-Vorschau', + 'feature.preview.body' => 'Die geplante Kür als animierte Vorschau erleben – mit Läufer, Kufenspur und Kameraansicht.', + 'feature.sync.title' => 'Cloud-Sync', + 'feature.sync.body' => 'Kürdateien und Musik über das eigene Dropbox-Konto zwischen Desktop und Tablet abgleichen.', + 'feature.export.title' => 'Export', + 'feature.export.body' => 'Übersichtliche PDF- und SVG-Blätter für Training, Wettkampf und die Absprache mit dem Trainer.', + 'feature.tablet.title' => 'Für das Tablet', + 'feature.tablet.body' => 'Große Touch-Ziele, Zwei-Finger-Zoom und ein Layout, das auch auf dem Eis gut lesbar bleibt.', + + 'downloads.kicker' => 'Test-Build', + 'downloads.title' => 'Rinkplanner herunterladen', + 'downloads.lede' => 'macOS- und Windows-Installer vom 12.11.2026. Wähle deine Plattform – die Downloads sind direkt einsatzbereit.', + 'downloads.mac.title' => 'Für den Mac', + 'downloads.mac.body' => 'Universal Binary für Apple Silicon (macOS 13+) und Intel (macOS 11+).', + 'downloads.mac.cta' => 'Installer herunterladen', + 'downloads.mac.hint' => 'DMG öffnen und Rinkplanner.app auf „Programme“ ziehen. Die App ist ad-hoc signiert, nicht notarisiert – beim ersten Start ggf. Rechtsklick → Öffnen, danach genügt ein Doppelklick.', + 'downloads.windows.title' => 'Für Windows', + 'downloads.windows.body' => 'Für Windows 10 und Windows 11 (64-Bit). Installation ohne Administratorrechte.', + 'downloads.windows.cta' => 'Installer herunterladen', + 'downloads.windows.hint' => 'Installer ausführen und den Anweisungen folgen – inklusive Startmenü-Verknüpfung und Deinstallation. Beim Start kann Windows SmartScreen warnen: „Weitere Informationen“ → „Trotzdem ausführen“.', + 'downloads.note' => 'Die Builds sind Testversionen und werden regelmäßig aktualisiert. Feedback und Fehlerberichte sind willkommen.', + + 'news.kicker' => 'Was ist neu', + 'news.title' => 'Letzte Änderungen', + 'news.lede' => 'Die Test-Builds wachsen in kleinen Schritten. Hier steht, was zuletzt dazugekommen ist.', + + 'release.0.version' => '0.2.1', + 'release.0.date' => '12.11.2026 · macOS und Windows', + 'release.0.badge' => 'Aktuell', + 'release.0.item.0' => 'Neue Läuferin im Kürkleid, mit deutlich saubererem Gesicht und feineren Konturen.', + 'release.0.item.1' => '3D-Bande mit Sockel und Fugen – Eisfläche und Bande sind jetzt klar getrennt.', + 'release.0.item.2' => 'Bei einer Step Sequence werden beim Auswählen alle zugehörigen Teilstrecken mitmarkiert.', + 'release.0.item.3' => 'Deutlich kleinerer Download: 29 statt 35 MB (Windows) und 65 statt 68 MB (macOS), weil alte Modellvarianten entfernt wurden.', + + 'release.1.version' => '0.2.0', + 'release.1.date' => '11.11.2026 · macOS und Windows', + 'release.1.item.0' => 'Die App prüft beim Start und über das Datei-Menü, ob eine neue Version bereitsteht.', + 'release.1.item.1' => 'Neuer Windows-Installer (ohne Administratorrechte) und macOS-Installer als DMG.', + 'release.1.item.2' => 'Sport-Theme, zentrale Küren-Verwaltung und automatische Auflösung von Sync-Konflikten.', + + 'release.2.version' => '0.1.0', + 'release.2.date' => '10.11.2026 · macOS und Windows', + 'release.2.item.0' => 'Erste verteilte Test-Builds als DMG und Setup-EXE.', + 'release.2.item.1' => 'Musikdateien werden mit der Kür synchronisiert; M4A/AAC läuft auf macOS über WAV.', + + 'rights.kicker' => 'Gut zu wissen', + 'rights.title' => 'Deine Daten bleiben bei dir.', + 'rights.cloud.title' => 'Eigenes Cloud-Konto', + 'rights.cloud.body' => 'Der Sync läuft über dein persönliches Dropbox-Konto. Es gibt keinen zentralen Rinkplanner-Speicher.', + 'rights.music.title' => 'Musik in deiner Hand', + 'rights.music.body' => 'Musikdateien liegen im eigenen Cloud-Ordner. Für die Nutzungsrechte an der Musik bist du selbst verantwortlich.', + 'rights.care.title' => 'Mit Liebe zum Detail', + 'rights.care.body' => 'Entwickelt für Eiskunstlauf-Trainer, Läuferinnen und Läufer, die ihre Kür strukturiert planen und teilen möchten.', + + 'footer.copyright' => '© 2026 programmschmiede.de', + 'footer.home' => 'Zur Startseite', + 'footer.contact' => 'Kontakt', + ], + + 'en' => [ + 'meta.title' => 'Rinkplanner – programme planner for figure skating', + 'meta.description' => 'Rinkplanner: the programme planner for figure skating. Place elements, plan timings, 3D preview and cloud sync. Test builds for macOS and Windows.', + + 'nav.label' => 'Site navigation', + 'nav.features' => 'Features', + 'nav.downloads' => 'Downloads', + 'nav.news' => 'What’s new', + 'nav.home' => 'Home', + + 'hero.eyebrow' => 'Figure skating · Programme planning', + 'hero.lede' => 'From the first idea to the finished programme: place elements, plan timings, check jump combinations and bring your programme to life on a tablet or desktop.', + 'hero.cta_download' => 'Download now', + 'hero.cta_features' => 'See the features', + 'hero.meta' => 'Free test build · macOS & Windows · 12 Nov 2026', + + 'features.kicker' => 'Everything for your programme', + 'features.title' => 'Your programme. Your lines.', + 'features.lede' => 'Rinkplanner brings drawing, ISU elements and timing together in one calm interface – for planning at your desk and for sign-off on the ice.', + + 'feature.editor.title' => 'Programme editor', + 'feature.editor.body' => 'Draw lines, curves and sections freely. Edit start, direction, edge and depth right on the segment.', + 'feature.elements.title' => 'ISU elements', + 'feature.elements.body' => 'Plan jumps, spins, sequences and jump combinations with abbreviation, level and hold time.', + 'feature.preview.title' => '3D preview', + 'feature.preview.body' => 'Watch the planned programme as an animated preview – with skater, blade trail and camera view.', + 'feature.sync.title' => 'Cloud sync', + 'feature.sync.body' => 'Sync programme files and music between desktop and tablet through your own Dropbox account.', + 'feature.export.title' => 'Export', + 'feature.export.body' => 'Clear PDF and SVG sheets for training, competition and for talking things through with your coach.', + 'feature.tablet.title' => 'Built for tablets', + 'feature.tablet.body' => 'Large touch targets, two-finger zoom and a layout that stays readable on the ice.', + + 'downloads.kicker' => 'Test build', + 'downloads.title' => 'Download Rinkplanner', + 'downloads.lede' => 'macOS and Windows installers from 12 Nov 2026. Pick your platform – the downloads are ready to use.', + 'downloads.mac.title' => 'For your Mac', + 'downloads.mac.body' => 'Universal binary for Apple Silicon (macOS 13+) and Intel (macOS 11+).', + 'downloads.mac.cta' => 'Download installer', + 'downloads.mac.hint' => 'Open the DMG and drag Rinkplanner.app into Applications. The app is ad-hoc signed, not notarised – on first launch you may need to right-click → Open; after that a double-click is enough.', + 'downloads.windows.title' => 'For Windows', + 'downloads.windows.body' => 'For Windows 10 and Windows 11 (64-bit). Installs without administrator rights.', + 'downloads.windows.cta' => 'Download installer', + 'downloads.windows.hint' => 'Run the installer and follow the steps – including the Start menu shortcut and uninstaller. On launch, Windows SmartScreen may warn you: “More info” → “Run anyway”.', + 'downloads.note' => 'These builds are test versions and are updated regularly. Feedback and bug reports are welcome.', + + 'news.kicker' => 'What’s new', + 'news.title' => 'Recent changes', + 'news.lede' => 'The test builds grow in small steps. Here is what was added most recently.', + + 'release.0.version' => '0.2.1', + 'release.0.date' => '12 Nov 2026 · macOS and Windows', + 'release.0.badge' => 'Current', + 'release.0.item.0' => 'A new skater in a competition dress, with a noticeably cleaner face and finer contours.', + 'release.0.item.1' => '3D boards with plinth and joints – the ice surface and the boards are now clearly separated.', + 'release.0.item.2' => 'When you select a step sequence, all of its segments are highlighted as well.', + 'release.0.item.3' => 'A much smaller download: 29 instead of 35 MB (Windows) and 65 instead of 68 MB (macOS), because old model variants were removed.', + + 'release.1.version' => '0.2.0', + 'release.1.date' => '11 Nov 2026 · macOS and Windows', + 'release.1.item.0' => 'The app checks at startup and from the File menu whether a new version is available.', + 'release.1.item.1' => 'New Windows installer (no administrator rights) and a macOS installer as a DMG.', + 'release.1.item.2' => 'Sports theme, central programme management and automatic resolution of sync conflicts.', + + 'release.2.version' => '0.1.0', + 'release.2.date' => '10 Nov 2026 · macOS and Windows', + 'release.2.item.0' => 'First distributed test builds as a DMG and a setup EXE.', + 'release.2.item.1' => 'Music files are synced with the programme; M4A/AAC plays via WAV on macOS.', + + 'rights.kicker' => 'Good to know', + 'rights.title' => 'Your data stays with you.', + 'rights.cloud.title' => 'Your own cloud account', + 'rights.cloud.body' => 'Sync runs through your personal Dropbox account. There is no central Rinkplanner storage.', + 'rights.music.title' => 'Music in your hands', + 'rights.music.body' => 'Music files live in your own cloud folder. You are responsible for the rights to use the music.', + 'rights.care.title' => 'Made with care', + 'rights.care.body' => 'Built for figure skating coaches and skaters who want to plan and share their programme in a structured way.', + + 'footer.copyright' => '© 2026 programmschmiede.de', + 'footer.home' => 'Back to the home page', + 'footer.contact' => 'Contact', + ], +]; diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..3cd1199 --- /dev/null +++ b/web/index.html @@ -0,0 +1,17 @@ + + + + + Rinkplanner + + + + + + +

Rinkplanner – zur Startseite

+ + diff --git a/web/index.php b/web/index.php new file mode 100644 index 0000000..48c2ee9 --- /dev/null +++ b/web/index.php @@ -0,0 +1,14 @@ + '✎', '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']; +?> + + + + + + + <?= $t['meta.title'] ?> + + + + + + + + + + + + + + + + +
+
+

+

Rinkplanner

+

+ +

+
+ + +
+

+
+ +
+
+

+

+

+ +

+
+
+ +
+ +

+

+
+ +
+
+ +
+
+

+

+

+ +

+
+ +
+ + + +
+ +

+ +

+
+ +
+
+

+

+

+ +

+
+ +
+ +
+
+ + + + + +
+
    + +
  • + +
+
+ +
+
+ +
+
+

+

+
+
+
+

+

+
+
+

+

+
+
+

+

+
+
+
+
+ +
+ + + +
+ + + +