This commit is contained in:
2026-01-11 14:04:48 +01:00
parent 971aa7288b
commit 2f0b83f030
10 changed files with 436 additions and 173 deletions

View File

@@ -25,7 +25,7 @@ They exist to avoid duplicating presentation logic across View Models.
A Display Object MAY:
- format values (money, dates, durations)
- handle localization and language-specific rules
- handle localization only when localization inputs are deterministic (for example: mapping stable codes to stable labels)
- map codes to labels
- encapsulate UI display conventions
- be reused across multiple View Models
@@ -67,6 +67,20 @@ In this repository, a Display Object MUST NOT:
Reason: these are runtime-locale/timezone dependent and cause SSR/hydration mismatches.
## Localization rule (strict)
Localization MUST NOT depend on runtime locale APIs.
Allowed approaches:
- API returns the exact labels/strings for the current user context.
- Website maps stable codes to stable labels using a deterministic table.
Forbidden approaches:
- any usage of `Intl.*`
- any usage of `toLocale*`
If a rule affects system correctness or persistence,
it does not belong in a Display Object.