🌍 pytest-translate
pytest terminal output in your language — automatically. Zero config. 134 languages.
Why should pytest speak only English?
A Chinese developer, a Japanese tester, an Arabic QA engineer — they all use pytest.
They all read FAILED and short test summary info in English.
Not anymore.
💡 Why pytest-translate?
- Inclusive by design — your non-English-speaking team reads pytest output natively
- Zero config — installs as a pytest plugin, auto-detects your OS locale
- 134 languages — from Mandarin to Yiddish, from Arabic to Sanskrit
- No vendor lock-in — pure pytest plugin, MIT licensed, no SaaS, no telemetry
- Smart cache — translations cached locally, no redundant API calls
⚡ Quick Start
pip install pytest-translate
That's it. pytest now speaks your OS language automatically.
pytest tests/ # auto-detects your OS locale
pytest tests/ --lang=zh_CN # force Chinese
pytest tests/ --lang=fr_FR # force French
pytest tests/ --lang=ja # force Japanese
pytest tests/ --lang=ar # force Arabic
pytest tests/ --lang=yi # force Yiddish (yes, really)
pytest tests/ --lang=sa # force Sanskrit (Hindu priests approved)
pytest tests/ --lang=off # back to English
🗺️ How it works
pytest-translate hooks into pytest's terminal reporter and translates:
- Test statuses —
PASSED,FAILED,SKIPPED,ERROR - Summary line —
6 failed, 1 passed in 142s - Section headers —
FAILURES SUMMARY,short test summary
Translation is done via Google Translate through deep-translator — 134 languages supported, zero configuration required.
🌐 Language detection priority
--lang=zh_CNCLI argumentPYTEST_LANG=zh_CNenvironment variable- OS locale (automatic —
fr_FRon a French system,zh_CNon a Chinese system) - English fallback if detection fails
📦 Installation
pip install pytest-translate
Or with pip + deep-translator explicitly:
pip install pytest-translate deep-translator
⚙️ Configuration
CLI
pytest tests/ --lang=zh_CN
Environment variable
export PYTEST_LANG=zh_CN
pytest tests/
pyproject.toml (permanent)
[tool.pytest.ini_options]
addopts = "--lang=zh_CN"
🗾 Supported languages (134)
Afrikaans, Albanian, Amharic, Arabic, Armenian, Azerbaijani, Basque, Bengali, Bosnian, Bulgarian, Catalan, Chinese (Simplified), Chinese (Traditional), Croatian, Czech, Danish, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Korean, Kurdish, Kyrgyz, Lao, Latin, Latvian, Lithuanian, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Myanmar, Nepali, Norwegian, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Sanskrit, Serbian, Sinhala, Slovak, Slovenian, Somali, Spanish, Swahili, Swedish, Tajik, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Uzbek, Vietnamese, Welsh, Yiddish, Yoruba, Zulu...
🤝 Contributors
| Contributor | Contribution |
|---|---|
| Julien Mer | Original author |
Tags: pytest plugin · i18n · l10n · internationalization · localization · multilingual testing · pytest in chinese · pytest in japanese · pytest in french · pytest in arabic · global qa · accessible testing · 134 languages · zero configuration · deep-translator · automatic locale detection · terminal reporter
📄 License
MIT — do whatever you want with it.
Created by Julien Mer — JMer Consulting
QA Architect · 20+ years · Katalon Top Partner Europe
Also check out qa-autopilot — AI-powered diagnostic for Playwright test failures in 134 languages.
Metadata
Release files for pytest-translate 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_translate-1.0.1.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_translate-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / pytest_translate-1.0.1.tar.gz
| Download URL | pytest_translate-1.0.1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31f366e028afa51b52455a5a105a9fa91c8ca356f6e795df255675c60882f16f
|
|
BLAKE2b-256 checksum How to use checksums |
3a76940b45a3a5f76e06401f109dcde1e6065696489d24cbda8c8dd498924c7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.2
|
Release files / pytest_translate-1.0.1-py3-none-any.whl
| Download URL | pytest_translate-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
420715cc2c613bc70b719edc6b7883d02f823848906741d465ae173d4a45cff7
|
|
BLAKE2b-256 checksum How to use checksums |
970cf050690957b473ebffe98c891b3ee3eca822610f8efc93eb725123d4a1c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.2
|