ValidationMessages
Corex\Forms\Block\ValidationMessages · class · Forms layer
The validation messages a rendered form carries for its own runtime (#148 item 2). The runtime used to translate its messages through wp.i18n, which needs a built JS translation catalogue — wp_set_script_translations() plus a generated corex-*.json. Nothing in this repository generates one, and the failure mode is silent: every validation message stays English on a translated site, whatever the locale, and nothing reports why. That is a trap rather than a design, because it only surfaces on the sites least able to notice a missing translation is a bug rather than a gap in their own catalogue. Rendering the map into the form instead means the strings go through PHP’s __() and the site’s existing .mo catalogue, with nothing new to build. The runtime keeps its wp.i18n table as a fallback, so a form rendered by something that does not emit this attribute still gets a message. Keyed by rule, not by field: the runtime reports the rule that failed, and a per-field map would be one entry per field per rule for the same handful of sentences.
Public API
Section titled “Public API”all(): array
Section titled “all(): array”toAttribute(): string
Section titled “toAttribute(): string”The map as a JSON attribute value.