Messages and languages
User-facing text crosses every boundary as a message, never as a rendered string. A plugin owns one message catalog per locale, references keys through a generated typed builder, and lets the kernel and client render them in the viewer’s language. This page covers catalog files and keys, the generated builder, which manifest fields take catalog keys, how backend and client code use messages, testing helpers, and the shared language catalog.
Catalogs
Section titled “Catalogs”A plugin owns one catalog per locale in shared/messages/<locale>.json. en.json is the source
locale and is required.
- Files use the
catalog source format:
ICU MessageFormat strings, or
{ "message", "description" }entries. - Give translators a description whenever a message has arguments or ambiguous wording.
- Domain vocabulary (entity kinds, statuses, units) belongs here, never in kernel catalogs.
{ "entity-schema.task.name": "Task", "rejection.review.duplicate": { "message": "You already reviewed {title}.", "description": "Shown when a person submits a second review for the same item." }}Keys are lowercase kebab-case segments joined by dots.
| Text | Key shape | Examples |
|---|---|---|
| Manifest text | <section>.<slug>.<field> |
entity-schema.task.name, saved-view.all-tasks.name, plugin.description |
| Other text | Its area | rejection.review.duplicate |
| Property names | property.<slug> |
property.pages |
A browse field or table column label that shows a property’s name reuses that property’s
property.<slug> key. It gets its own key only when its text differs, such as a column that adds a
unit.
The generated builder
Section titled “The generated builder”ryot plugin messages validates the catalogs and writes the typed builder module
shared/messages.generated.ts for editors, type checks and local tests (see
CLI).
- Validation uses the kernel’s rules: limits, no markup, no currency or unit styles, and translations matching English arguments.
- It fails on keys that no plugin source references and on
catalogMessage("…")calls naming unknown keys. - The module is git-ignored. Monorepo plugins run it through their
messagesTurbo task, whichcheck,testandbuilddepend on. - The path is reserved:
ryot plugin buildnever sends that file to the compilers. They receive the compiled English catalog and generate the same builder from it withcatalogMessagesModulefrom@ryot-app/plugin-kit/messages-module, which decodes the catalog and applies the catalog limits first. - The builder is therefore bounded by the catalog limits and does not count toward the client or sandbox source limits, and a plugin cannot put code in that file.
import { catalogMessage } from "../shared/messages.generated";
catalogMessage("rejection.review.duplicate", { title });catalogMessage returns a LocalMessage. Keys and parameters are typed from en.json, and the
kernel stamps the plugin’s namespace wherever it stores or serves the message, so a plugin can only
reference its own catalog.
Dates and times
Section titled “Dates and times”| Value | Message style | Builder argument |
|---|---|---|
| A day without a time of day, such as a due date | {date, date, calendar-medium} |
A YYYY-MM-DD string; narrow one with isCalendarDate |
| An instant | date and time styles |
A Date |
| An instant that belongs to a place, such as a scheduled time | {at, date, zoned-medium} {at, time, zoned-short} |
{ date: Date, timeZone } (ZonedDateTime) with an IANA zone |
- A calendar date renders the same day in every time zone.
- A zoned instant renders in its own zone rather than the reader’s.
isCalendarDatecomes from@ryot-app/plugin-kit/messages.
Select codes
Section titled “Select codes”SelectCodes<Catalog, Key, Argument> from @ryot-app/plugin-client-sdk is the code union of a
select argument, with Catalog from the generated module, so client code that passes codes around
never repeats them.
Manifest text
Section titled “Manifest text”Manifest display text accepts only ManifestText, a key without arguments. Pass
catalogMessage("…").
Takes ManifestText |
|---|
metadata.name and metadata.description |
The name of entity, event, relationship and signal schemas, saved views, calendar sources, providers and OAuth providers |
Integration provider and import source name and description |
Import exportHelp.steps |
| Browse field, choice and sort labels |
| The table column labels of kernel-rendered saved views |
client.collectionPages labels, client.analyticsSections names and client.assistantStarters |
| Property schema labels, hints and choice labels (see Property schemas) |
- Calendar captions are row text from
catalogRowText(see Calendar sources), whose message must declare exactly the bound arguments. ryot plugin buildfails when manifest text names a missing key or a message whose arguments differ, and installation repeats the check.
Model-facing text stays English: operation and query titles and descriptions,
client.assistantInstructions, cron and bootstrap descriptions, and hook and script names.
Backend rejections
Section titled “Backend rejections”Backend code rejects an operation with a message from its own catalog:
reject(catalogMessage("rejection.review.duplicate", { title }));The same applies to every other text a plugin’s backend hands to the kernel. A before-stage policy
rejects with { action: "reject", reason: catalogMessage("…") }.
- Enumerated values that shape the sentence, such as a status or a content kind, are
selectcodes. - Names and provider-supplied values are string parameters.
- Operation outputs that the plugin’s own client renders also carry
LocalMessages.
@ryot-app/plugin-kit/messages exports the Message, LocalMessage and DisplayText schemas and
the isMessage predicate. Names the kernel serves, such as an entity schema’s name selected
through a recipe, are stamped Messages: select them with the Message schema and render them,
rather than keying copy by slug.
Client rendering
Section titled “Client rendering”| Need | Use |
|---|---|
| Render the plugin’s own messages | useMessages(PLUGIN_PACKAGE_ID, catalogMessage) |
Render a LocalMessage the backend returned |
useLocalMessage(PLUGIN_PACKAGE_ID) |
Pass text the host renders (DisplayText) |
useStampedMessages(PLUGIN_PACKAGE_ID, catalogMessage), or user-authored text such as an item’s name |
| Render an operation rejection or a contract error’s reason | formatError(t, error, fallback?) from @ryot-app/plugin-client-sdk/react |
| Render an entity schema’s served name from its owner and slug | useEntitySchemaName() |
useMessagesreturns a builder that renders text in the viewer’s locale and also accepts the kernel’s generic button, status and yes/no words (common.action.cancel,common.status.saving,common.value.yesand the rest of the list in the client SDK README). Use them instead of copying them into the plugin catalog.ryot plugin messages,ryot plugin buildand installation reject a catalog that defines one of those keys.- Text the host renders instead of the plugin is passed unrendered.
PluginScreenFrameandusePluginTitletitles areDisplayText. Background-submissionlabel(input)and the devicereturn-shortcutlabel areLocalMessages that the host stamps with the plugin’s namespace. - While the host reloads plugin catalogs, the bridge lists them as
pendingNamespaces, and their missing messages render the neutral loading text.
See Messages And Locale in the client SDK README for details.
The archive carries the compiled catalogs and the generated en-XA pseudo-locale. Installation
re-checks their limits before the kernel serves them.
Testing messages
Section titled “Testing messages”| Test | Helper |
|---|---|
| Compile the catalog | compilePluginCatalog(packageRoot) from @ryot-app/plugin-kit/testing |
| Backend rendering | englishRenderer(catalog) from @ryot-app/plugin-backend-sdk/testing |
| Notification automations | signalAutomationInput({ signalSchemaSlug, properties, ... }) from @ryot-app/plugin-backend-sdk/testing builds the input a signal emission hands a notification automation |
| Client rendering | testPluginText from the client SDK testing module |
Languages
Section titled “Languages”@ryot-app/plugin-kit/languages exposes the shared language catalog:
| Export | Purpose |
|---|---|
canonicalLanguageCode |
Code normalization |
canonicalLanguagePattern |
Validation pattern |
languageName |
English display names |
languageCodeForIso6393 |
Converts a code to its ISO 639-3 three-letter form for APIs |
It is an independent neutral import and a shared sandbox runtime dependency, so unrelated schema consumers do not bundle the catalog into each script. Provider-specific codes stay plugin-owned.