Locales
The chat in Arabic and Spanish: complete catalogs, each its own entry, so a page ships only the ones it imports.
Complete catalogs for the chat besides the built-in English: ar (Arabic, with its six plural forms) and es
(Spanish). Each is its own package entry, so a page that does not import one does not ship it. Use one as
messages with the matching locale, and spread your own words over it.
Import
import { ar } from "@webmcp-agents/chat/locales/ar";
import { es } from "@webmcp-agents/chat/locales/es";
Example
// dir="rtl" comes from the locale
<AgentChat locale="ar" messages={{ ...ar, title: "مساعد المتجر" }} />
Options
Each entry exports one ChatMessages, named like the file.
| Name | Type | Default | Description |
|---|---|---|---|
ar |
ChatMessages |
Arabic. Pass locale="ar" (or a region, "ar-EG") for Arabic plurals, digits and right-to-left layout. |
|
es |
ChatMessages |
Spanish. Pass locale="es". |
Notes
localeandmessagesare separate on purpose: the catalog is the words;localedrives plural rules, number, byte and percent formatting, and the direction. A locale with no catalog formats numbers in that locale and keeps English words.- Every catalog is written with
satisfies ChatMessages, so a key the chat adds is a type error until it is translated. - To add a language, copy
en(ChatMessages) and translate it; keep every{placeholder}.