# generaltranslation: General Translation Core SDK: 内容 URL: https://generaltranslation.com/zh/docs/core/types/Content.mdx --- title: 内容 description: 表示所有受支持的可翻译内容格式的联合类型 --- ## 概述 `Content` 表示所有受支持的可翻译内容格式。 ```typescript type Content = JsxChildren | IcuMessage | I18nextMessage; ``` ## 类型定义 ### 联合类型成员 | 类型 | 描述 | 使用场景 | | ---------------- | ----------------------- | -------------------- | | `JsxChildren` | 包含元素和变量的富 JSX 内容 | React 组件、结构化 HTML 内容 | | `IcuMessage` | ICU MessageFormat 消息字符串 | 复杂复数形式处理、日期/数字格式化 | | `I18nextMessage` | 与 i18next 兼容的消息字符串 | 简单插值、现有 i18next 项目 | *** ## 示例 ### JSX 内容 ```typescript copy const jsxContent: Content = { t: 'div', c: ['Hello ', { k: 'userName' }] }; ``` ### ICU 消息格式 ```typescript copy const icuContent: Content = 'Hello {name}!' as IcuMessage; ``` ### i18next 格式 ```typescript copy const i18nextContent: Content = "Welcome back, {{name}}!" as I18nextMessage ``` *** ## 说明 * `Content` 将不同的消息格式统一为一种类型 * `Content` 类型既可根据结构推断,也可显式指定 ## 相关类型 * [`JsxChildren`](/docs/core/types/jsx-children) - JSX 内容结构 * [`DataFormat`](/docs/core/types/data-format) - 格式说明