skillfed

python-i18n

Translation library for Python

python-i18n v0.3.9 399.3K downloads/30d#6,949 on PyPI246
Permissive license MIT AGING released

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-i18n

uv

uv add python-i18n

poetry

poetry add python-i18n

Installing 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

Development Status :: 4 - BetaEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Libraries

Tags

python internationalization i18ntranslation library pythonmultilingual text localizationpluralization and locale supportyaml json translation filesrails-style i18n python
localizationmultilingualtranslation-management

More Libraries packages