python-i18n
Translation library for Python
What it is and what it does
python-i18n is a translation library that brings Rails-style internationalization to Python. It lets you manage translations for multiple languages in your application by loading them from YAML or JSON files, adding them programmatically, or both. The library handles common i18n tasks: substituting placeholders like %{name} into strings, choosing the right plural form based on a count, falling back to a default language when a translation is missing, and organizing translations into namespaces based on file and folder structure.
You set a locale, add or load translations, and call i18n.t() with a key to retrieve the translated string. It supports memoization to cache translations in memory after the first load, and optional configuration to skip locale root elements in JSON files. With no external runtime dependencies, it installs cleanly and works out of the box.
Use it for:
- Build a web application that serves content in multiple languages by loading translations from YAML or JSON files organized by locale.
- Add placeholder and pluralization support to user-facing messages (e.g., 'You have %{count} new emails').
- Integrate translations into a Python microservice that reuses i18n JSON files from another project without modifying the file structure.
- Set up fallback locales so that missing translations in the user's preferred language automatically fall back to a default.
- Organize translations hierarchically using directory and file namespaces to keep large translation sets manageable.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides internationalization (i18n) functionality for Python applications, enabling translation of strings into multiple languages with support for pluralization, placeholders, and fallback locales.
Yes, if you need straightforward Rails-style i18n for a Python project and can accept that the package is aging (last release 2020-08-26). It has no dependencies, installs easily, carries no known vulnerabilities, and is permissively licensed. However, verify Python support matches your target version, and consider whether the lack of recent maintenance poses a risk for your use case.
Install
python-i18n on PyPI
pip
pip install python-i18nuv
uv add python-i18npoetry
poetry add python-i18nInstalling python-i18n
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release was 2020-08-26, though the repository remains active with a recent commit in 2026-01-17.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install python-i18n
import i18n
i18n.add_translation('foo', 'bar')
i18n.t('foo') # bar
# Or load from files:
i18n.load_path.append('/path/to/translations')
i18n.t('foo.hi') # Hello world !
Verify before relying
- Whether the package supports Python 3 exclusively or maintains Python 2 compatibility as classifiers suggest
- Current test coverage and whether the build/coverage badges reflect the actual state of the codebase
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 2,179 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 399,331/month — #6,949 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_i18n-0.3.9-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
i18nicei18nice provides internationalization (i18n)…
permissive · top 15,000 on PyPI
translationstringProvides translation string objects and…
permissive · top 5,000 on PyPI
SmartlingApiSdkA Python SDK for interacting with Smartling's…
permissive · top 15,000 on PyPI
oslo.i18noslo.i18n provides utilities for handling…
permissive · top 5,000 on PyPI
babelBabel provides internationalization (i18n) and…
permissive · top 1,000 on PyPI
zope.i18nProvides internationalization and localization…
unclear · top 15,000 on PyPI
flufl.i18nflufl.i18n provides a high-level API for…
permissive · top 15,000 on PyPI
flask-babelAdds internationalization (i18n) and…
permissive · top 5,000 on PyPI
edx-i18n-toolsCommand-line tool for extracting, compiling,…
permissive · top 15,000 on PyPI
l18nProvides lazy translations for timezone and…
permissive · top 15,000 on PyPI