Skip to main content

Lint .po translation files for contamination, wrong languages, shifts, and garbled text

Project description

python-po-lint

Lint .po translation files for contamination, wrong languages, shifts, and garbled text.

Features

  • Wrong script detection — catches Cyrillic in a Dutch file, Arabic in French, etc.
  • Wrong language detection — hybrid fastText + lingua approach (fastText for long strings, lingua for short ones)
  • Shifted entry detection — finds translations that got shifted to the wrong msgid
  • Garbled text detection — catches corrupted/broken unicode

Installation

pip install python-po-lint

Usage

# Lint a locale directory
po-lint locale/

# Lint with config from pyproject.toml
po-lint

# Only check specific languages
po-lint locale/ --languages fr de nl

Configuration

Add to your pyproject.toml:

[tool.po-lint]
# Explicit locale directories (relative to project root)
paths = ["locale"]

# Auto-discover locale dirs from installed Python packages
packages = ["myapp", "myotherapp"]

# Only check these languages (empty = all)
languages = []

# Minimum confidence to flag wrong language (0.0 - 1.0)
confidence_threshold = 0.5

# Skip entries with msgstr shorter than this
min_text_length = 3

# Regex patterns to ignore (matched against msgid and msgstr)
ignore_patterns = []

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

python_po_lint-0.1.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file python_po_lint-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: python_po_lint-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_po_lint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff12949ca70f16f5d635443acf50aee9dcc87e3c4caf6e1aa8b61d4e32018bc3
MD5 885a5b086dc58d319f92ae3e85b9ae13
BLAKE2b-256 a91448a4897a26b6a095df2407f432d5930fdc070a054b63fd353eaba3dd8e02

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_po_lint-0.1.0-py3-none-any.whl:

Publisher: ci.yml on pescheckit/python-po-lint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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