# General Translation Python SDKs: declare_static URL: https://generaltranslation.com/ja/docs/python/reference/functions/declare-static.mdx --- title: declare_static description: General Translation Python でコンテンツをビルド時抽出の対象としてマークする、derive の非推奨エイリアス。declare_static の API リファレンス。 --- [`derive`](/docs/python/reference/functions/derive) の非推奨エイリアスです。General Translation CLI で静的に解析できるようにコンテンツをマークし、その後 `derive` に委譲します。新しいコードでは `derive` を使用してください。 ## 概要 [#overview] `declare_static` は `derive` とまったく同じように呼び出します。つまり、静的な式を、結果が有限個に定まる形でラップします。`DeprecationWarning` を出力し、入力は変更せずそのまま返します。 ```python from gt_i18n import declare_static message = t(f"The {declare_static('boy' if gender == 'male' else 'girl')} is playing.") ``` シグネチャ: ```python declare_static(content: object) -> object ``` `gt_i18n` とフレームワークパッケージによって、`generaltranslation.static` から再エクスポートされます。 ## 仕組み [#how-it-works] * **非推奨の警告。** `derive` の使用を推奨する `DeprecationWarning` を発生させます。 * **`derive` に委譲します。** `derive(content)` (内容はそのまま) を返すため、動作は [`derive`](/docs/python/reference/functions/derive) と同一です。 ## パラメーター [#parameters] | パラメーター | 説明 | Type | Optional | デフォルト | | --------------------- | ------------------- | -------- | -------- | ----- | | [`content`](#content) | 取り得る値が有限個に限られた静的な式。 | `object` | いいえ | — | ### `content` [#content] **型** `object` · **必須** 取り得る値が有限個に限られた静的な式。 ## 戻り値 [#returns] **型** `object` `content` をそのまま返します。 ## 例 [#example] ```python # 非推奨 — derive() を使用してください from gt_i18n import declare_static # ❌ 非推奨 from gt_i18n import derive # ✅ 代わりにこちらを使用してください ```