feat(portal-shell): collapse accessibility routes into one i18n-marked route #94
Reference in New Issue
Block a user
Delete Branch "feat/portal-shell/i18n-accessibility-route-fusion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Continue ADR-0019: replace the
/accessibility+/accessibilitetwin routes with a single canonical route whose content is i18n-marked in the template. The per-locale build (en/fr) already inlines the right copy — the route-data +copy()service indirection is no longer carrying its weight.What changes
AccessibilityStatementloses itsActivatedRouteinjection, theLangdiscriminator, and theCOPYlookup table. The component is now a plain shell over the template.accessibility.htmlcarries the title + intro + status panel asi18n="@@page.accessibility.*"markers. Six new trans-units inmessages.fr.xlfprovide the French copy — verbatim from the oldCOPY.frblock, so the page reads the same in FR as before.app.routes.tsdeclares the single canonical route atpath: 'accessibility'and keeps/accessibilitealive as aredirectTo: 'accessibility'. Dropsdata: { lang: ... }— no longer consumed.footer.htmlcollapses the dual link into one i18n-marked link (@@footer.accessibilityLink). EN bundle reads "Accessibility statement"; FR bundle reads "Déclaration d'accessibilité".Decision worth flagging
The path stays in English across both locales for now:
/en/accessibilityand/fr/accessibility. Translating route segments (/fr/declaration-d-accessibilite) needs either a custom URL serializer or per-locale route trees — not worth the complexity at this scale. The page title and the link label already differ per locale via i18n, which is what's actually visible to users.The historical
/accessibilitepath keeps working via the route-level redirect. Drops out of the codebase once analytics confirm no traffic reaches it.Test plan
pnpm exec nx run-many -t lint test build --projects=portal-shell— green. 35 / 35 specs (was 36; the obsoletelang-fallback test is removed).Statut,Déclaration, the FR intro / panel bodies. No leftover English on swept strings.extract-i18nclean (49 unique units now: +5 forpage.accessibility.*+footer.accessibilityLink, −0; the old route-datalangmarkers were not i18n)./en/accessibilityand/fr/accessibilityrender their respective content;/fr/accessibilite301-redirects to/fr/accessibility.What this PR explicitly does NOT do
Continue ADR-0019: replace the `/accessibility` + `/accessibilite` twin routes with a single canonical `/accessibility` path whose content is i18n-marked in templates. The per-locale build (en/fr) already inlines the right copy — the route data + `copy()` service indirection is no longer needed. What changes: - `AccessibilityStatement` loses its `ActivatedRoute` injection, its `Lang` discriminator and the `COPY` lookup table. The component is now a plain shell over the template. - `accessibility.html` carries the title + intro + status panel strings as `i18n="@@page.accessibility.*"` markers; six new trans-units in `messages.fr.xlf` provide the French copy (verbatim from the old `COPY.fr` block, kept identical so the page reads the same in FR). - `app.routes.ts` declares the single canonical route and keeps `/accessibilite` as a `redirectTo: 'accessibility'` for backward compatibility with existing bookmarks. Drops the `data.lang` payload — no longer consumed. - `footer.html` collapses the dual link (`Accessibility` / `Accessibilité`) into one i18n-marked link (`@@footer.accessibilityLink`). EN bundle reads "Accessibility statement"; FR bundle reads "Déclaration d'accessibilité". The path stays in English across both locales for now (`/{en,fr}/accessibility`). Translating route segments (`/fr/declaration-d-accessibilite`) is a future refinement that needs either a custom URL serializer or per-locale route trees — not worth the complexity at this scale. Specs: - `accessibility.spec.ts` loses the `lang`-based tests and asserts on the rendered EN source content + the amber-panel structure (specs run in the source locale). - `footer.spec.ts` asserts on the single accessibility link and the absence of the historical `/accessibilite` href. Test plan / verification: - 35/35 specs pass (was 36; one obsolete `lang` fallback test removed). - Production build emits both locales; FR chunk contains "Statut", "Déclaration", FR intro/panel bodies, and no leftover English from the swept strings.