feat(portal-shell): collapse accessibility routes into one i18n-marked route
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.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Route } from '@angular/router';
|
||||
|
||||
// Tab titles per route — marked with `$localize` so each locale's
|
||||
// bundle ships its own. The `/accessibility` and `/accessibilite`
|
||||
// pair shares a title key; the upcoming route fusion (per ADR-0019)
|
||||
// collapses them to a single localised route.
|
||||
// bundle ships its own. The accessibility statement now lives at the
|
||||
// single canonical path `/accessibility` (per ADR-0019, replacing the
|
||||
// previous `/accessibility` + `/accessibilite` pair).
|
||||
const homeTitle = $localize`:@@route.home.title:APF Portal`;
|
||||
const accessibilityTitle = $localize`:@@route.accessibility.title:Accessibility statement · APF Portal`;
|
||||
|
||||
@@ -14,21 +14,21 @@ export const appRoutes: Route[] = [
|
||||
loadComponent: () => import('./pages/home/home').then((m) => m.Home),
|
||||
title: homeTitle,
|
||||
},
|
||||
// RGAA + ADR-0016: the accessibility statement must be reachable
|
||||
// from both locales' canonical paths. Same component, content
|
||||
// driven by the `lang` route data property.
|
||||
// RGAA + ADR-0016: the accessibility statement is reachable from
|
||||
// `/accessibility` in every locale. Content is i18n-marked so the
|
||||
// per-locale bundle ships the right copy automatically.
|
||||
{
|
||||
path: 'accessibility',
|
||||
loadComponent: () =>
|
||||
import('./pages/accessibility/accessibility').then((m) => m.AccessibilityStatement),
|
||||
data: { lang: 'en' },
|
||||
title: accessibilityTitle,
|
||||
},
|
||||
// Backward-compat: the historical French path redirects to the
|
||||
// canonical one. Bookmarks and existing inbound links keep working.
|
||||
// Drops out of the codebase once analytics confirm no traffic.
|
||||
{
|
||||
path: 'accessibilite',
|
||||
loadComponent: () =>
|
||||
import('./pages/accessibility/accessibility').then((m) => m.AccessibilityStatement),
|
||||
data: { lang: 'fr' },
|
||||
title: accessibilityTitle,
|
||||
redirectTo: 'accessibility',
|
||||
pathMatch: 'full',
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user