# General Translation Platform: Content
URL: https://generaltranslation.com/ja/docs/platform/core/reference/types/content.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: 翻訳でサポートされるコンテンツ形式。Content 型の API リファレンス。

`Content` は、General Translation が翻訳できるすべてのコンテンツ形式を表すユニオン型です。[`TranslateManyEntry`](/docs/platform/core/reference/types/translate-many-entry) の `source` フィールド、および [`translate`](/docs/platform/core/reference/gt-class-methods/translation/translate) と [`translateMany`](/docs/platform/core/reference/gt-class-methods/translation/translate-many) の入力として使われます。

## 概要 [#overview]

`Content` は、構造化された JSX コンテンツと文字列ベースのメッセージ形式を、単一の型で統一して扱います。型は値の構造から推論することも、エントリのメタデータで [`DataFormat`](/docs/platform/core/reference/types/data-format) を使って明示的に指定することもできます。

```typescript
type Content = JsxChildren | IcuMessage | StringMessage | I18nextMessage;
```

*注記:* string メンバー (`IcuMessage`、`StringMessage`、`I18nextMessage`) は、いずれも `string` のエイリアスです。source ではこれらは `StringContent` としてグループ化されているため、`Content` は `JsxChildren | StringContent` と同等です。

## メンバー [#members]

| メンバー                                 | 説明                         | 型                             |
| ------------------------------------ | -------------------------- | ----------------------------- |
| [`JsxChildren`](#jsx-children)       | 要素と変数を含む、構造化された JSX コンテンツ。 | `object` | `array` | `string` |
| [`IcuMessage`](#icu-message)         | ICU MessageFormat 文字列。     | `string`                      |
| [`I18nextMessage`](#i18next-message) | i18next 互換のメッセージ文字列。       | `string`                      |
| [`StringMessage`](#string-message)   | プレーンな文字列コンテンツ。             | `string`                      |

### `JsxChildren` [#jsx-children]

**型** [`JsxChildren`](/docs/platform/core/reference/types/jsx-children)

テキスト、構造化された要素、変数で構成されるリッチな JSX コンテンツです。React コンポーネントや構造化された HTML コンテンツに使用できます。 (完全な構造については [`JsxChildren`](/docs/platform/core/reference/types/jsx-children) を参照してください) 

```typescript
const jsxContent: Content = {
  t: 'div',
  c: ['Hello ', { k: 'userName' }]
};
```

### `IcuMessage` [#icu-message]

**型** `string`

ICU MessageFormat 文字列です。複雑な複数形処理や、日付・数値の書式設定に使用します。

```typescript
const icuContent: Content = 'Hello {name}!' as IcuMessage;
```

### `I18nextMessage` [#i18next-message]

**型** `string`

i18next と互換性のあるメッセージ文字列です。シンプルな補間や、既存の i18next プロジェクトで使用します。

```typescript
const i18nextContent: Content = 'Welcome back, {{name}}!' as I18nextMessage;
```

### `StringMessage` [#string-message]

**型** `string`

補間、複数形処理、書式設定を含まないプレーンな文字列コンテンツです。シンプルなテキストに使用します。

```typescript
const stringContent: Content = 'Hello, world!' as StringMessage;
```

## メモ [#notes]

* `Content` は、異なるメッセージ形式を 1 つの型に統一します。
* content 型は、構造から推論することも、[`EntryMetadata`](/docs/platform/core/reference/types/entry-metadata) の [`DataFormat`](/docs/platform/core/reference/types/data-format) で明示的に指定することもできます。

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
