Step 1: i18n foundation (@angular/localize) + data inventory
Domain reference data already lives in the backend (per ADR-0001); the only residual "move" was ~90 inlined Dutch UI strings with no i18n layer. - Wire @angular/localize ($localize) — Angular first-party, no third-party lib - Pin the pattern on shared/ui/async: Dutch fallbacks → language-agnostic input()s with localizable $localize defaults (English-shared-UI rule) - CLAUDE.md: drop i18n (now in scope) + stale "real backend"/"OpenAPI codegen" (both already shipped); document the $localize convention Bulk string sweep deferred to Step 2 to avoid touching ~36 files twice. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -46,15 +46,15 @@ export class AsyncErrorDirective {
|
||||
<ng-container [ngTemplateOutlet]="errorTpl()!.tpl"
|
||||
[ngTemplateOutletContext]="{ $implicit: error(), retry: retry }" />
|
||||
} @else {
|
||||
<app-alert type="error">Er ging iets mis bij het laden van de gegevens.</app-alert>
|
||||
<app-alert type="error">{{ errorText() }}</app-alert>
|
||||
<div style="margin-top:1rem">
|
||||
<app-button variant="secondary" (click)="retry()">Opnieuw proberen</app-button>
|
||||
<app-button variant="secondary" (click)="retry()">{{ retryText() }}</app-button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@case ('Empty') {
|
||||
@if (emptyTpl()) { <ng-container [ngTemplateOutlet]="emptyTpl()!.tpl" /> }
|
||||
@else { <p class="rhc-paragraph">Geen gegevens gevonden.</p> }
|
||||
@else { <p class="rhc-paragraph">{{ emptyText() }}</p> }
|
||||
}
|
||||
@case ('Success') {
|
||||
<ng-container [ngTemplateOutlet]="loadedTpl().tpl"
|
||||
@@ -72,6 +72,12 @@ export class AsyncComponent<T> {
|
||||
data = input<RemoteData<Error | undefined, T>>();
|
||||
isEmpty = input<(v: T) => boolean>(() => false);
|
||||
|
||||
// Shared/English component: copy lives behind language-agnostic inputs. Defaults are
|
||||
// localizable via $localize (source = default locale, currently nl); callers may override.
|
||||
errorText = input($localize`:@@async.error:Er ging iets mis bij het laden van de gegevens.`);
|
||||
retryText = input($localize`:@@async.retry:Opnieuw proberen`);
|
||||
emptyText = input($localize`:@@async.empty:Geen gegevens gevonden.`);
|
||||
|
||||
loadedTpl = contentChild.required(AsyncLoadedDirective);
|
||||
loadingTpl = contentChild(AsyncLoadingDirective);
|
||||
emptyTpl = contentChild(AsyncEmptyDirective);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/// <reference types="@angular/localize" />
|
||||
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { appConfig } from './app/app.config';
|
||||
import { App } from './app/app';
|
||||
|
||||
bootstrapApplication(App, appConfig)
|
||||
.catch((err) => console.error(err));
|
||||
bootstrapApplication(App, appConfig).catch((err) => console.error(err));
|
||||
|
||||
Reference in New Issue
Block a user