Skip to content

messages: slice-3 ICU MessageFormat exclusions (selectordinal, offset:, =N, skeletons, nested dispatch) — build on demand #910

Description

@accuser

Summary

Tracking issue for the ICU MessageFormat constructs slice 3 (#878, ADR 0276) deliberately excluded. Each is diagnosed today via bynk.messages.malformed_icu_syntax (not silently mishandled), so authoring one gives a clear "not supported" error rather than wrong output. This issue enumerates them so the deferral is on the tracker rather than only in the ADR; each is a separable increment to open a proposal for when real demand appears.

Not planned as a batch — the surface was capped on purpose (ADR 0276). File this so nothing is lost, not to schedule it.

The excluded constructs

Construct Example What full support adds
selectordinal {n, selectordinal, one {#st} two {#nd} few {#rd} other {#th}} ordinal plural categories (1st/2nd/3rd), distinct from plural's cardinal set; delegable to Intl.PluralRules(tag, {type: "ordinal"})
plural offset: {n, plural, offset:1 one {you and # other} other {you and # others}} subtract an offset before category selection and # formatting
plural exact-value arms {n, plural, =0 {none} one {# item} other {# items}} literal =N matches that bypass category selection
CLDR skeleton strings {n, number, ::currency/GBP} / {d, date, ::yMMMd} arbitrary Intl options beyond the fixed style keywords (integer/percent; short/medium/long/full) — including currency, which needs a currency code the placeholder can't carry today
nested {arg, …} dispatch {n, plural, other {{g, select, …}}} a second format dispatch inside a sub-message; today a sub-message is literal text + # only, one dispatch level per placeholder

Notes for whoever picks one up

  • selectordinal, the offset:/=N variants, and the fixed→skeleton widening are all host-Intl-delegable (ADR 0276 Decision A) — no CLDR data in the compiler. The skeleton case is the largest: it re-opens the "how much Intl option surface to expose" question and, for currency, needs a value/type to carry the currency code (couples to the Money kernel, which has no formatting method — ADR 0276 context).
  • Nested dispatch is the one real parser change (icu.rs currently caps sub-messages at literal + #); the others extend the existing plural/number/date arms.
  • Each currently rejects via bynk.messages.malformed_icu_syntax — a proposal that builds one narrows that code's scope; add a positive fixture and (if Intl-delegated) a workerd smoke test, mirroring slice 3.

Done when

Each construct, when demanded, is filed as its own proposal citing this issue; there is no work to do on this issue itself beyond closing it if the exclusions are ever all lifted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions