Skip to main content

pytest terminal output in your language — 134 languages supported, zero configuration

Project description

🌍 pytest-translate

pytest terminal output in your language — automatically. Zero config. 134 languages.

Python pytest PyPI Languages License


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 statusesPASSED, FAILED, SKIPPED, ERROR
  • Summary line6 failed, 1 passed in 142s
  • Section headersFAILURES SUMMARY, short test summary

Translation is done via Google Translate through deep-translator — 134 languages supported, zero configuration required.


🌐 Language detection priority

  1. --lang=zh_CN CLI argument
  2. PYTEST_LANG=zh_CN environment variable
  3. OS locale (automatic — fr_FR on a French system, zh_CN on a Chinese system)
  4. 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

Newsletter

Also check out qa-autopilot — AI-powered diagnostic for Playwright test failures in 134 languages.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_translate-1.0.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_translate-1.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest_translate-1.0.1.tar.gz.

File metadata

  • Download URL: pytest_translate-1.0.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.2

File hashes

Hashes for pytest_translate-1.0.1.tar.gz
Algorithm Hash digest
SHA256 31f366e028afa51b52455a5a105a9fa91c8ca356f6e795df255675c60882f16f
MD5 a6770047bf469a9e12c6e06719118ca6
BLAKE2b-256 3a76940b45a3a5f76e06401f109dcde1e6065696489d24cbda8c8dd498924c7f

See more details on using hashes here.

File details

Details for the file pytest_translate-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_translate-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 420715cc2c613bc70b719edc6b7883d02f823848906741d465ae173d4a45cff7
MD5 ed6b3feac46237c16bde8cfe1cf8e576
BLAKE2b-256 970cf050690957b473ebffe98c891b3ee3eca822610f8efc93eb725123d4a1c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page