Skip to main content

Module strings

Module strings 

Source
Expand description

Round 1 (docs/round-1-contract.md §4): the BUILT-IN UI strings — the copy no author writes (search placeholder, month buttons, copy, close, …). The ids and English defaults are catalog/strings.json (embedded); a host overrides any id per surface; $string.<id> in a prop value resolves through the surface’s table at bind time. Mirrors src/strings.ts.

Statics§

DEFAULT_STRINGS
The English defaults, in source order.

Functions§

default_string
The default text of one id.
format_string
{name} placeholders filled from params; unknown (or null) ones stay.
is_string_ref
True for a well-formed reference to a KNOWN id.
parse_string_ref
$string.choose → choose; None for any other value (^\$string\.([a-zA-Z][a-zA-Z0-9]*)$).
resolve_string
A value with a $string.<id> reference replaced by the table’s text (an unknown id resolves to the id itself); any other value passes.
string_table
The host’s overrides merged over the defaults.

Type Aliases§

StringTable
One string table: id → text (the defaults merged under the overrides).