Wrap every user-facing Dutch string in Angular's first-party i18n — `i18n`/ `i18n-<attr>` in templates, `$localize` in TS (value-objects, machines, commands, label constants, shared-component defaults). Source locale stays nl; a second locale is now a translation file, not a code change. - M3: ~145 strings localized with stable @@ ids across registratie, herregistratie, auth, shared/ui, shared/layout. Skipped: showcase, debug-state, scenario interceptor, generated client, specs/stories, raw status enum tags, internal parse* diagnostics. - M4: single shared JA_NEE (localized labels) in radio-group; both wizard copies removed. Gate green: lint, check:tokens, build, test 77/77. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
44 lines
2.0 KiB
TypeScript
44 lines
2.0 KiB
TypeScript
import { Component, computed, inject } from '@angular/core';
|
|
import { PageShellComponent } from '@shared/layout/page-shell/page-shell.component';
|
|
import { AlertComponent } from '@shared/ui/alert/alert.component';
|
|
import { ASYNC } from '@shared/ui/async/async.component';
|
|
import { map } from '@shared/application/remote-data';
|
|
import { BigProfileStore } from '@registratie/application/big-profile.store';
|
|
import { HerregistratieWizardComponent } from '@herregistratie/ui/herregistratie-wizard/herregistratie-wizard.component';
|
|
|
|
/** A whole new page built from existing building blocks. Eligibility is a
|
|
SERVER-computed decision read from the aggregated view — the frontend renders
|
|
it, it does not recompute the rule. */
|
|
@Component({
|
|
selector: 'app-herregistratie-page',
|
|
imports: [PageShellComponent, AlertComponent, ...ASYNC, HerregistratieWizardComponent],
|
|
template: `
|
|
<app-page-shell i18n-heading="@@herregistratie.heading" heading="Herregistratie aanvragen" backLink="/dashboard">
|
|
<app-async [data]="eligibility()">
|
|
<ng-template appAsyncLoaded let-eligible>
|
|
@if (eligible) {
|
|
<app-alert type="info" i18n="@@herregistratie.eligible">
|
|
Uw huidige registratie verloopt binnenkort. Vraag tijdig herregistratie aan.
|
|
</app-alert>
|
|
<div class="app-section">
|
|
<app-herregistratie-wizard />
|
|
</div>
|
|
} @else {
|
|
<app-alert type="warning" i18n="@@herregistratie.notEligible">
|
|
Voor uw huidige registratiestatus is herregistratie niet mogelijk.
|
|
</app-alert>
|
|
}
|
|
</ng-template>
|
|
</app-async>
|
|
</app-page-shell>
|
|
`,
|
|
})
|
|
export class HerregistratiePage {
|
|
private store = inject(BigProfileStore);
|
|
// The eligibility decision comes from the server (decisions block), not a
|
|
// client-side rule. The UI just reads the boolean.
|
|
protected eligibility = computed(() =>
|
|
map(this.store.decisions(), (d) => d.eligibleForHerregistratie),
|
|
);
|
|
}
|