mirror of
https://github.com/bitbaum/petvity.git
synced 2026-12-04 04:17:20 +01:00
The owner walked the site with Loki on 2026-10-18 and said the design was inconsistent between the home page and the portal. It was, and not by design: app/[locale]/layout.tsx rendered a second <html> inside the root one. React keeps one document element and, when that nested <html> unmounted on a client navigation from the marketing site into /login or /portal, cleared what it had set on it — lang, dir and the font classes. Measured on the live site, /de → /login without a reload: lang null, class "", body font Roboto instead of Plus Jakarta Sans, headings out of Jost. Loki's checks also kept reporting "the page does not declare its language", which was true after every such navigation. German pages were also served as lang="en" (the browser kept the first <html>'s). - The root layout renders the only <html>, with the request's locale and direction (next-intl getLocale: the URL's on the localized site, the default elsewhere). - Each route group keeps document lang/dir right across client navigations with a small client component (DocumentLanguage): [locale] with the URL's locale, the portal with the user's, auth and admin in English. - lib/i18n/one-html.test.ts: only the root layout renders <html>, and every route group says its language. Checked on a production build: /de, /login and /ar serve one <html> each with lang de / en / ar and dir rtl for Arabic; /de → /login → /de/features by client navigation keeps the font classes and the right lang at every step. Claude-Session: https://claude.ai/code/session_01TNLstupcdvsPfTjy8yjR67 Co-authored-by: Claude <noreply@anthropic.com>