# vue: GTStringOptions URL: https://generaltranslation.com/ja/docs/vue/reference/types/gt-string-options.mdx --- title: GTStringOptions description: 静的コンテキストを使用して、プレーン文字列のカタログ参照を区別します。GTStringOptions の API リファレンス。 --- このオプションオブジェクトは、[`useGT()`](/docs/vue/reference/composables/use-gt)、[`t()`](/docs/vue/reference/functions/t)、[`msg()`](/docs/vue/reference/functions/msg)、および [`useMessages()`](/docs/vue/reference/composables/use-messages) の生文字列呼び出しで共通して使用されます。 ## 概要 [#overview] ```ts type GTStringOptions = { $context?: string; }; ``` | Property | 説明 | 型 | 任意 | デフォルト | | ---------------------- | ------------------------------ | -------- | -- | ------- | | [`$context`](#context) | カタログハッシュの計算時に、同一のソース文字列を識別します。 | `string` | はい | — | ## `$context` [#context] **型** `string` · **任意** · **デフォルト** — 同じソーステキストでも状況によって異なる翻訳が必要な場合は、コンテキストを使用します。 ```ts gt('Open', { $context: 'button that opens a file' }); gt('Open', { $context: 'adjective for an available store' }); ``` コンテキストはカタログの識別情報に影響しますが、表示はされません。CLIとランタイムで同じキーが計算されるよう、抽出された呼び出しでは固定値にしてください。 ## サポートされないオプション [#unsupported] Vue のプレーン文字列の参照では、補間変数、`$format`、`$locale`、`$maxChars`、`$requiresReview` を意図的に受け付けません。また、ICU 構文も解析しません。波括弧などのメッセージ形式の文字はリテラルとして扱われます。 ランタイム値には、[``](/docs/vue/reference/components/var) とともに [``](/docs/vue/reference/components/t) を使用してください。リッチな翻訳メタデータは `GTStringOptions` ではなく、[``](/docs/vue/reference/components/t) に指定します。 ## 例 [#example] ```vue title="src/AccountStatus.vue" ```