fix(i18n): map gallery + hero + floorplan images to real filenames; force-DE on legal pages
- home: map 9/12 gallery items to real filenames (Wohnzimmer-1 -> wohnzimmer2.png, Badezimmer-1 -> Bad.jpg, etc.); remove 3 items whose source images are missing - home: hero-bg.jpg -> Außenansicht-2.webp (file exists) - home: floorplan image -> /bilder/grundrisse/<name>.png (subdir + correct name) - layout: og:image fallback Aussenansicht-2.webp (ASCII) -> Außenansicht-2.png (UTF-8) - layout: hero-bg.jpg fallback -> Außenansicht-2.png (UTF-8) - Controller::render(): add $forceLocale param for legal pages - ImpressumController / DatenschutzController: force 'de' (TMG §5 / GDPR) so <html lang=de> is emitted regardless of cookie
This commit is contained in:
@@ -25,10 +25,13 @@ abstract class Controller
|
||||
* Render a view inside a layout.
|
||||
*
|
||||
* @param array<string,mixed> $data
|
||||
* @param string|null $forceLocale If set, overrides the locale resolved from
|
||||
* cookie/Accept-Language for this render. Used by legal pages (Impressum,
|
||||
* Datenschutz) that must be served in German only by German law.
|
||||
*/
|
||||
protected function render(string $view, array $data = [], string $layout = 'main'): void
|
||||
protected function render(string $view, array $data = [], string $layout = 'main', ?string $forceLocale = null): void
|
||||
{
|
||||
$locale = LocaleController::current();
|
||||
$locale = $forceLocale ?? LocaleController::current();
|
||||
$i18n = static fn (string $key, array $params = []): string => I18n::t($key, $params, $locale);
|
||||
|
||||
$globals = [
|
||||
|
||||
@@ -11,17 +11,18 @@ class DatenschutzController extends Controller
|
||||
{
|
||||
public function index(): void
|
||||
{
|
||||
$locale = LocaleController::current();
|
||||
|
||||
// Legal pages (Datenschutzerklärung) must be served in German only by GDPR / German law.
|
||||
// Force German locale for render() so <html lang="de"> + German meta are emitted
|
||||
// regardless of cookie/Accept-Language.
|
||||
$this->render('datenschutz/index', [
|
||||
'pageTitle' => I18n::t('legal.privacy_h1', [], $locale) . ' – ' . I18n::t('site.title', [], $locale),
|
||||
'pageDescription' => I18n::t('legal.privacy_h1', [], $locale) . ' – ' . I18n::t('site.title', [], $locale),
|
||||
'pageTitle' => I18n::t('legal.privacy_h1', [], 'de') . ' – ' . I18n::t('site.title', [], 'de'),
|
||||
'pageDescription' => I18n::t('legal.privacy_h1', [], 'de') . ' – ' . I18n::t('site.title', [], 'de'),
|
||||
'robots' => 'noindex',
|
||||
'canonical' => I18n::t('site.canonical_base', [], $locale) . '/datenschutz',
|
||||
'ogLocale' => Locale::toOgLocale($locale),
|
||||
'ogUrl' => I18n::t('site.canonical_base', [], $locale) . '/datenschutz',
|
||||
'ogTitle' => I18n::t('legal.privacy_h1', [], $locale),
|
||||
'ogDescription' => I18n::t('legal.privacy_h1', [], $locale),
|
||||
]);
|
||||
'canonical' => I18n::t('site.canonical_base', [], 'de') . '/datenschutz',
|
||||
'ogLocale' => Locale::toOgLocale('de'),
|
||||
'ogUrl' => I18n::t('site.canonical_base', [], 'de') . '/datenschutz',
|
||||
'ogTitle' => I18n::t('legal.privacy_h1', [], 'de'),
|
||||
'ogDescription' => I18n::t('legal.privacy_h1', [], 'de'),
|
||||
], 'main', 'de');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,17 +11,18 @@ class ImpressumController extends Controller
|
||||
{
|
||||
public function index(): void
|
||||
{
|
||||
$locale = LocaleController::current();
|
||||
|
||||
// Legal pages (Impressum) must be served in German only by German law (TMG §5).
|
||||
// Force German locale for render() so <html lang="de"> + German meta are emitted
|
||||
// regardless of cookie/Accept-Language.
|
||||
$this->render('impressum/index', [
|
||||
'pageTitle' => I18n::t('legal.imprint_h1', [], $locale) . ' – ' . I18n::t('site.title', [], $locale),
|
||||
'pageDescription' => I18n::t('legal.imprint_h1', [], $locale) . ' – ' . I18n::t('site.title', [], $locale),
|
||||
'pageTitle' => I18n::t('legal.imprint_h1', [], 'de') . ' – ' . I18n::t('site.title', [], 'de'),
|
||||
'pageDescription' => I18n::t('legal.imprint_h1', [], 'de') . ' – ' . I18n::t('site.title', [], 'de'),
|
||||
'robots' => 'noindex',
|
||||
'canonical' => I18n::t('site.canonical_base', [], $locale) . '/impressum',
|
||||
'ogLocale' => Locale::toOgLocale($locale),
|
||||
'ogUrl' => I18n::t('site.canonical_base', [], $locale) . '/impressum',
|
||||
'ogTitle' => I18n::t('legal.imprint_h1', [], $locale),
|
||||
'ogDescription' => I18n::t('legal.imprint_h1', [], $locale),
|
||||
]);
|
||||
'canonical' => I18n::t('site.canonical_base', [], 'de') . '/impressum',
|
||||
'ogLocale' => Locale::toOgLocale('de'),
|
||||
'ogUrl' => I18n::t('site.canonical_base', [], 'de') . '/impressum',
|
||||
'ogTitle' => I18n::t('legal.imprint_h1', [], 'de'),
|
||||
'ogDescription' => I18n::t('legal.imprint_h1', [], 'de'),
|
||||
], 'main', 'de');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user