Class UiMessages
defaults a deployment can override per key.
The chrome lives in two layers (the server-side DivKit builders and the React app), so the
same resolved map feeds both: the DivKit builders read it directly to
render server-side, and GET /api/config hands the whole map (asMap()) to the web
client, which indexes into it by the same keys. This is the chrome counterpart to the domain
localization an app already has (entity title, @Attribute displayName, list-column
labels): those cover data/field text, this covers the surrounding shell.
Overrides come from onno.ui.messages (see UiProperties.getMessages()). Scope is
one language per deployment — there is no per-request locale negotiation; an app sets the chrome
language once and both layers pick it up. A {name}-style placeholder in a template is
filled by format(String, Object...).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUiMessages(Map<String, String> overrides) Builds the resolved map: the EnglishDEFAULTSwith the given overrides layered on top. -
Method Summary
Modifier and TypeMethodDescriptionasMap()The full resolved map — handed to the web client viaGET /api/config.static UiMessagesdefaults()The all-defaults instance — used by builder overloads and unit tests.get(String)with{placeholder}substitution:format("ref.new", "name", "Customers")→"New Customers".The resolved text forkey, or the key itself when unknown (so a typo is visible, not blank).
-
Field Details
-
DEFAULTS
The English defaults for every chrome key. Both layers index into this same key namespace; the React app ships a mirror of these as its offline fallback (seelib/messages.ts), so keep the two in sync when adding or changing a key.
-
-
Constructor Details
-
UiMessages
Builds the resolved map: the EnglishDEFAULTSwith the given overrides layered on top.
-
-
Method Details
-
defaults
The all-defaults instance — used by builder overloads and unit tests. -
get
The resolved text forkey, or the key itself when unknown (so a typo is visible, not blank). -
format
get(String)with{placeholder}substitution:format("ref.new", "name", "Customers")→"New Customers". Args are alternating placeholder/value pairs. -
asMap
The full resolved map — handed to the web client viaGET /api/config.
-