77 */
88
99/**
10- * @object -ui/i18n - Spec-aligned i18n utilities
10+ * @object -ui/i18n - locale formatting helpers
1111 *
12- * Runtime consumers for @objectstack/spec v2.0.7 i18n types:
13- * - PluralRuleSchema → resolvePlural()
14- * - DateFormatSchema → formatDateSpec()
15- * - NumberFormatSchema → formatNumberSpec()
16- * - LocaleConfigSchema → applyLocaleConfig()
12+ * ## Provenance of the four shapes below (objectui#4597)
13+ *
14+ * They were authored against `@objectstack/spec/ui`, which exported
15+ * `PluralRuleSchema`, `DateFormatSchema`, `NumberFormatSchema` and
16+ * `LocaleConfigSchema` up to and including 17.0.0-rc.5. The pinned
17+ * 17.0.0-rc.6 removed all four under ADR-0049 enforce-or-remove
18+ * (objectstack#5055, maintainer ruling 2026-08-06): they carried no key on any
19+ * authorable shape and nothing ever parsed them, so the vocabulary was retired
20+ * rather than given a door. The key sets here were faithful to the retired
21+ * schemas — this is a retirement, not a drift.
22+ *
23+ * Nothing in the pinned protocol models locale formatting today, so the
24+ * interfaces below are declarations this package owns outright, not a view onto
25+ * a protocol type. The retirement note records that localisation returns as
26+ * authorable metadata through a new ADR — "the formatter that reads a
27+ * LocaleConfig first, the vocabulary second" — so re-derive these at that point
28+ * instead of assuming they still track anything upstream.
1729 *
1830 * @module spec-formatters
1931 */
2032
2133// ============================================================================
22- // PluralRuleSchema Consumer
34+ // Plural rules
2335// ============================================================================
2436
2537/**
26- * Spec-aligned PluralRule (mirrors @objectstack/spec PluralRuleSchema).
38+ * Plural forms for a single translation key, in CLDR categories.
39+ *
40+ * Local shape — authored against the protocol's `PluralRuleSchema`, retired in
41+ * 17.0.0-rc.6 (see the module doc), so there is nothing upstream to derive from.
2742 */
2843export interface SpecPluralRule {
2944 /** Translation key */
@@ -81,11 +96,14 @@ export function resolvePlural(
8196}
8297
8398// ============================================================================
84- // DateFormatSchema Consumer
99+ // Date formatting
85100// ============================================================================
86101
87102/**
88- * Spec-aligned DateFormat (mirrors @objectstack/spec DateFormatSchema).
103+ * Date/time formatting options passed through to `Intl.DateTimeFormat`.
104+ *
105+ * Local shape — authored against the protocol's `DateFormatSchema`, retired in
106+ * 17.0.0-rc.6 (see the module doc), so there is nothing upstream to derive from.
89107 */
90108export interface SpecDateFormat {
91109 dateStyle ?: 'full' | 'long' | 'medium' | 'short' ;
@@ -95,7 +113,7 @@ export interface SpecDateFormat {
95113}
96114
97115/**
98- * Format a date using @objectstack/spec DateFormatSchema configuration.
116+ * Format a date using a { @link SpecDateFormat} configuration.
99117 *
100118 * @example
101119 * ```ts
@@ -124,11 +142,15 @@ export function formatDateSpec(
124142}
125143
126144// ============================================================================
127- // NumberFormatSchema Consumer
145+ // Number formatting
128146// ============================================================================
129147
130148/**
131- * Spec-aligned NumberFormat (mirrors @objectstack/spec NumberFormatSchema).
149+ * Number formatting options passed through to `Intl.NumberFormat`.
150+ *
151+ * Local shape — authored against the protocol's `NumberFormatSchema`, retired
152+ * in 17.0.0-rc.6 (see the module doc), so there is nothing upstream to derive
153+ * from.
132154 */
133155export interface SpecNumberFormat {
134156 style ?: 'currency' | 'percent' | 'decimal' | 'unit' ;
@@ -140,7 +162,7 @@ export interface SpecNumberFormat {
140162}
141163
142164/**
143- * Format a number using @objectstack/spec NumberFormatSchema configuration.
165+ * Format a number using a { @link SpecNumberFormat} configuration.
144166 *
145167 * @example
146168 * ```ts
@@ -170,11 +192,15 @@ export function formatNumberSpec(
170192}
171193
172194// ============================================================================
173- // LocaleConfigSchema Consumer
195+ // Locale configuration
174196// ============================================================================
175197
176198/**
177- * Spec-aligned LocaleConfig (mirrors @objectstack/spec LocaleConfigSchema).
199+ * One locale's formatting defaults, resolved by `applyLocaleConfig()`.
200+ *
201+ * Local shape — authored against the protocol's `LocaleConfigSchema`, retired
202+ * in 17.0.0-rc.6 (see the module doc), so there is nothing upstream to derive
203+ * from.
178204 */
179205export interface SpecLocaleConfig {
180206 /** BCP 47 language code (e.g., 'en-US', 'zh-CN') */
@@ -190,7 +216,7 @@ export interface SpecLocaleConfig {
190216}
191217
192218/**
193- * Apply a LocaleConfigSchema to configure i18n formatting defaults.
219+ * Apply a { @link SpecLocaleConfig} to configure i18n formatting defaults.
194220 * Returns resolved formatting functions bound to the locale config.
195221 *
196222 * @example
0 commit comments