LocaleProvider
Language for every component below it.
See internationalisation for adding languages and overriding individual strings.
Names for identifiers
Shape, ink and state identifiers are API — 'blob', 'blue', 'thinking' — and are never translated. Their display names are, and the locale table carries them as id-driven families: shape.*, color.*, state.*, stateDesc.* (a one-line description of each state), belt.*, hud.*, mouth.*, expression.*, plus face.* and nose.* for the line face and state.group.* for the four groups the states fall into.
useLabel() reads those families as functions, so a component iterating SHAPE_IDS does not have to build 'shape.' + id and cast it to a key:
mochi → Mochi, Thinking, Progresscircle → Circle, Thinking, Progressblob → Blob, Thinking, Progressmochi → 麻薯, 思考, 进度circle → 圆形, 思考, 进度blob → 果冻, 思考, 进度HUD names come from the engine's own HUD_KIND_LABELS, which already carries both languages; the locale re-exports them rather than keeping a second copy.
Key families
Beyond the identifier families, the table is grouped by the surface that reads it: picker.*, editor.*, activity.*, template.*, avatar.*, occupancy.*, restricted.*, boot.* and loading.label, cast.*, walkthrough.*, sprite.*. LocaleKey is a closed union over all of them, so an override with a misspelt key is a type error rather than a silent no-op.
API
| Prop | Type | Default | Description |
|---|---|---|---|
children* | string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | null | — | — |
locale | "en-US" | "zh-CN" | 'en-US' | Language for every component below this point. |
overrides | Partial<Locale> | — | Override individual strings without replacing the whole table. |
Next
- Internationalisation — one provider, every label
- API index — every export in one place