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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff12949ca70f16f5d635443acf50aee9dcc87e3c4caf6e1aa8b61d4e32018bc3
|
|
| MD5 |
885a5b086dc58d319f92ae3e85b9ae13
|
|
| BLAKE2b-256 |
a91448a4897a26b6a095df2407f432d5930fdc070a054b63fd353eaba3dd8e02
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_po_lint-0.1.0-py3-none-any.whl -
Subject digest:
ff12949ca70f16f5d635443acf50aee9dcc87e3c4caf6e1aa8b61d4e32018bc3 - Sigstore transparency entry: 1096910864
- Sigstore integration time:
-
Permalink:
pescheckit/python-po-lint@67e76f2e02a12194c5aab92b30dc498808ab036a -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/pescheckit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@67e76f2e02a12194c5aab92b30dc498808ab036a -
Trigger Event:
push
-
Statement type: