# General Translation Python SDKs: set_i18n_manager
URL: https://generaltranslation.com/en-US/docs/python/reference/functions/set-i18n-manager.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Register the active I18nManager in General Translation Python. API reference for set_i18n_manager.

Registers an [`I18nManager`](/docs/python/reference/classes/i18n-manager) as the module-level singleton that the translation functions read. This is how you wire up General Translation without a framework; [`initialize_gt`](/docs/python/reference/functions/initialize-gt) calls it for you in Flask and FastAPI.

## Overview [#overview]

Call `set_i18n_manager` with a manager you constructed. Afterward, [`t`](/docs/python/reference/functions/t), the locale helpers, and [`get_i18n_manager`](/docs/python/reference/functions/get-i18n-manager) all use it.

```python
from gt_i18n import I18nManager, set_i18n_manager

manager = I18nManager(default_locale="en", locales=["es", "fr"])
set_i18n_manager(manager)
```

Signature:

```python
set_i18n_manager(manager: I18nManager) -> None
```

Import `set_i18n_manager` from `gt_i18n`. It is not re-exported by the framework packages.

## How it works [#how-it-works]

- **Singleton assignment.** It stores the manager as the module-level singleton, replacing any previous one.
- **Framework use.** [`initialize_gt`](/docs/python/reference/functions/initialize-gt) calls it internally; you call it directly only when using the core library without a framework.

## Parameters [#parameters]

| Parameter | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| [`manager`](#manager) | The manager to register as the active singleton. | [`I18nManager`](/docs/python/reference/classes/i18n-manager) | No | — |

### `manager` [#manager]

**Type** [`I18nManager`](/docs/python/reference/classes/i18n-manager) · **Required**

The manager instance to register.

## Returns [#returns]

**Type** `None`

## Example [#example]

```python
from gt_i18n import I18nManager, set_i18n_manager, t

manager = I18nManager(default_locale="en", locales=["es"])
set_i18n_manager(manager)
manager.set_locale("es")
t("Hello, world!")
```

## Sitemap

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