Content
Union type representing all supported content formats for translation
Overview
Content represents all supported content formats for translation.
type Content = JsxChildren | IcuMessage | I18nextMessage;Type Definition
Union Members
| Type | Description | Use Case |
|---|---|---|
JsxChildren | Rich JSX content with elements and variables | React components, structured HTML content |
IcuMessage | ICU MessageFormat strings | Complex pluralization, date/number formatting |
I18nextMessage | i18next compatible message strings | Simple interpolation, existing i18next projects |
Examples
JSX Content
const jsxContent: Content = {
t: 'div',
c: ['Hello ', { k: 'userName' }]
};ICU Message Format
const icuContent: Content = 'Hello {name}!' as IcuMessage;i18next Format
const i18nextContent: Content = 'Welcome back, {{name}}!' as I18nextMessage;Notes
Contentunifies different message formats under a single type- Content type can be inferred from structure or explicitly specified
Related Types
JsxChildren- JSX content structureDataFormat- Format specification
How is this guide?