initializePublicLocale();'), 'A public-page controller does not initialize the shared locale resolver.'); $assert(str_contains($controller, '$this->publicView()'), 'A public-page controller does not expose shared locale data to its templates.'); } $assert(str_contains($legal, '$this->publicLocale') && str_contains($legal, "withHeader('Vary', 'Accept-Language, Cookie')"), 'Legal pages do not use the shared locale or declare cache variance.'); foreach ([$base, $home, $auth, $password, $legal] as $controller) { $assert(!str_contains($controller, "Configurations::where('name', 'language'") && !str_contains($controller, "Config::get('language'"), 'A public page still depends on the removed administrator language setting.'); } $layoutHeader = $read('web/resources/views/venix/auth/layout_header.tpl'); $layoutFooter = $read('web/resources/views/venix/auth/layout_footer.tpl'); $siteHeader = $read('web/resources/views/venix/home/site_header.tpl'); $navActions = $read('web/resources/views/venix/home/nav_actions.tpl'); $languageSwitch = $read('web/resources/views/venix/home/language_switch.tpl'); $siteFooter = $read('web/resources/views/venix/home/site_footer.tpl'); $css = $read('web/public/theme/venix/css/home.css'); $accountCss = $read('web/public/cloud/account.css'); $assert(str_contains($layoutHeader, "include file='home/site_header.tpl'") && str_contains($layoutHeader, 'theme/venix/css/home.css'), 'Authentication pages do not reuse the landing-page header and its stylesheet.'); $assert(str_contains($layoutFooter, "include file='home/site_footer.tpl'"), 'Authentication pages do not reuse the landing-page footer.'); foreach (['auth/login.tpl', 'auth/register.tpl', 'password/reset.tpl', 'password/token.tpl'] as $templatePath) { $template = $read('web/resources/views/venix/' . $templatePath); $assert(str_contains($template, "include file='auth/layout_footer.tpl'"), $templatePath . ' does not include the persistent public footer.'); $assert(!str_contains($template, "include file='auth/copyright.tpl'"), $templatePath . ' still includes the retired local copyright fragment.'); } $assert(str_contains($siteHeader, "include file='home/nav_actions.tpl'") && str_contains($navActions, "include file='home/language_switch.tpl'") && str_contains($languageSwitch, '$language_zh_url') && str_contains($languageSwitch, '$language_en_url'), 'The shared navigation does not expose both language switch targets.'); $assert(!str_contains($siteHeader, '?lang=en') && !str_contains($siteFooter, '?lang=en'), 'Public navigation still hard-codes English query parameters instead of using the locale cookie.'); $assert(preg_match('/\.landing-site-header\s*\{[^}]*position:\s*fixed;/s', $css) === 1 && str_contains($css, '.landing-language-switch') && str_contains($css, '.landing-mobile-nav-actions') && str_contains($accountCss, 'padding-top: 88px;') && str_contains($accountCss, 'padding-top: 76px;'), 'Persistent desktop or mobile public-navigation styling is incomplete.'); $assets = $read('web/resources/views/venix/layout_assets.tpl'); $assert(preg_match("/venix_asset_version value='([0-9]+)'/", $assets, $assetVersion) === 1 && (int) $assetVersion[1] >= 2026102804, 'The shared browser asset version was not advanced with the navigation styles.'); echo "Public page locale and shared-layout contract tests passed.\n";