# General Translation Platform: GTRuntime
URL: https://generaltranslation.com/ja/docs/platform/core/reference/runtime.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: プロジェクト管理機能なしで、ランタイム翻訳、フォーマット、ロケールヘルパーを利用できます。GTRuntime の API リファレンスです。

アプリケーションでファイル管理やプロジェクト管理が不要な場合は、`generaltranslation/runtime` から `GTRuntime` をインポートしてください。サポート対象の [`GT`](/docs/platform/core/reference/gt-class/constructor) クラスは `GTRuntime` を継承し、これらの管理用メソッドを追加したものです。

| エクスポート                                  | 説明                          |
| --------------------------------------- | --------------------------- |
| [`GTRuntime`](#runtime)                 | ランタイム翻訳、フォーマット、ロケール関連のメソッド。 |
| [`GTConstructorParams`](#configuration) | コンストラクターと再設定で共通のオプション。      |

## `GTRuntime` [#runtime]

**型** class · **コンストラクター** `new GTRuntime(params?: GTConstructorParams)`

Runtime エントリポイントには、ファイル／プロジェクト管理クライアントが含まれていません。[`translate`](/docs/platform/core/reference/gt-class-methods/translation/translate)、[`translateMany`](/docs/platform/core/reference/gt-class-methods/translation/translate-many)、フォーマット、ロケールヘルパー、[`setConfig`](/docs/platform/core/reference/gt-class/set-config) は引き続き利用できます。これらの Runtime コントラクトは、[`GT`](/docs/platform/core/reference/gt-class/constructor) から継承されたメソッドと同じです。

```ts title="format.ts"
import { GTRuntime } from 'generaltranslation/runtime';

const runtime = new GTRuntime({ sourceLocale: 'en', targetLocale: 'en-US' });
console.log(runtime.formatNum(1234.5)); // 1,234.5
```

フォーマットヘルパーとロケールヘルパーには API の認証情報は不要です。ランタイム翻訳にはプロジェクト ID と API キーが必要です。

デプロイするブラウザ向けやモバイル向けのバンドルには、API キーを埋め込まないでください。

## `GTConstructorParams` [#configuration]

**型** object · **任意** · **デフォルト** `{}`

この型は `generaltranslation/runtime` からインポートします。ルートクラスで使用されるものと同じ[コンストラクター設定](/docs/platform/core/reference/types/gt-constructor-params)で、API キー、プロジェクト ID、ベース URL、ロケール、カスタムマッピングを指定できます。`fetch`、`timeoutMs`、`retryPolicy`、`apiVersion` は指定できません。

インスタンスを再設定するには [`setConfig`](/docs/platform/core/reference/gt-class/set-config) を使用します。

## Sitemap

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