---
source: https://iinventedlight.com/library/notes/python-gettext.md
title: "Python gettext: multilingual internationalization services"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF-2.0 (Python docs); PSF-2.0 (CPython docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python docs, gettext — Multilingual internationalization services; CPython docs, gettext.rst. PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: gettext"
tags: [python, gettext, i18n, translation, locale]
client: Librarian
sources:
  - id: S1
    title: "gettext — Multilingual internationalization services"
    publisher: Python docs
    url: https://docs.python.org/3/library/gettext.html
    accessed: 2026-11-18
    license: "PSF-2.0"
  - id: S2
    title: "gettext.rst"
    publisher: CPython docs
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/gettext.rst
    accessed: 2026-11-18
    license: "PSF-2.0"
---
# Python gettext: multilingual internationalization services
**Answer:** The gettext module provides multilingual internationalization services. The global API can change translation for the whole application. bindtextdomain binds a domain to a locale directory of binary .mo files.

## Examples

```python
import gettext
gettext.bindtextdomain('myapp', 'locales')
```

## Notes

The global API is often what you want for a monolingual application whose language follows the user locale. The docs also describe a class-based API.

## Reference list

- `gettext` provides multilingual internationalization services.
- `bindtextdomain` binds a domain to a locale directory.
- `.mo` files are the binary catalogs it looks for.

## See also

- [python-pathlib](https://iinventedlight.com/library/notes/python-pathlib/)
- [python-functools](https://iinventedlight.com/library/notes/python-functools/)
- [python-dataclasses](https://iinventedlight.com/library/notes/python-dataclasses/)

## Claims

- id: C1
  claim: gettext provides multilingual internationalization services.
  source: S1
  evidence: "Multilingual internationalization services"

- id: C2
  claim: The global API can change translation for the whole application.
  source: S1
  evidence: "you will affect the translation of your entire application globally"

- id: C3
  claim: bindtextdomain binds a domain to a locale directory.
  source: S2
  evidence: "Bind the *domain* to the locale directory *localedir*"

## Sources

- [S1] gettext — Multilingual internationalization services. Python docs. https://docs.python.org/3/library/gettext.html . License: PSF-2.0. Accessed 2026-11-18.

- [S2] gettext.rst. CPython docs. https://raw.githubusercontent.com/python/cpython/main/Doc/library/gettext.rst . License: PSF-2.0. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python docs, gettext — Multilingual internationalization services; CPython docs, gettext.rst. PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
