Files
zeekay e7b07c32d5 boot: lang and dir before first paint
@hanzo/i18n/boot exports bootScript(), an inline head script that sets
<html lang dir> before the first paint: the locale the provider last
showed in this browser, else the signed-out choice, else the browser's
languages negotiated as resolve does. Its tables are built from the
registry through resolve's own pick(), so the two answer alike.

The provider records what it shows (hanzo.locale.v1.painted) and keeps
an account's IAM choice in this browser, so the next load opens in it.

@hanzo/i18n 0.3.2.
2026-10-22 06:11:16 -07:00

10 lines
367 B
TypeScript

import { createElement } from 'react'
import { hydrateRoot } from 'react-dom/client'
import { Document, props } from './document.ts'
const failures: string[] = ((window as unknown as { recoverable: string[] }).recoverable = [])
hydrateRoot(document, createElement(Document, props(location.href)), {
onRecoverableError: (error) => failures.push(String(error)),
})