Skip to main content

pytest terminal output in your language — 134 languages supported

Project description

🌍 pytest-translate

pytest terminal output in your language — automatically

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.


⚡ 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

📄 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.0.tar.gz (7.8 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.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_translate-1.0.0.tar.gz
  • Upload date:
  • Size: 7.8 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.0.tar.gz
Algorithm Hash digest
SHA256 dd7e7252f546c930279cb74e543b874303fe172c952592de5c673e1a0605548b
MD5 b63d78615fe99b3bfc403b0e2c50d36d
BLAKE2b-256 1a14c52faacdf0e905b984ecbff6670d9d02b1a2ebb456aa664d5cc23d38a9fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_translate-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fd208360eeb2e6c406e788e847df3b464abc99ba10e345e1b450539f9bf6c1a
MD5 e75737db86bfdf317741c786b660b601
BLAKE2b-256 3e82966f4184c348df847d1c8535b54b08f3877abf4ce2293cc86b86ba23b240

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