fix layout SSR translations and remediation follow-ups
This commit is contained in:
@@ -1815,7 +1815,14 @@ export function createHandlers(deps: RuntimeDeps): Handlers {
|
||||
if (isMobileRequest) body = revealMobileOnlyHtml(body);
|
||||
|
||||
// i18n: resolve `{t:key}` / `t:attr` markers against the request language.
|
||||
if (deps.i18n) body = translateHtml(body, ctx.t);
|
||||
if (deps.i18n) {
|
||||
body = translateHtml(body, ctx.t);
|
||||
// renderDocument prefers the complete document template when one was
|
||||
// rendered. Keep it in sync with the translated body; otherwise markers
|
||||
// owned by document/page layouts are replaced by the stale pre-translation
|
||||
// template even though page-only responses translate correctly.
|
||||
if (documentTemplate) documentTemplate = body;
|
||||
}
|
||||
|
||||
// Point 3: only ship the JS this page actually uses.
|
||||
const scripts = collectScripts(body, deps.clientRuntimes, deps.navigation).map((script) =>
|
||||
|
||||
Reference in New Issue
Block a user