A simple gettext .po linter to check for mangled variable names in translations
Project description
lint-po
A simple gettext .po linter to check for mangled variable names in translations.
Features
- reads utf-8 encoded *.po files
- skips
msgid/msgstrpairs where either value is unset - compares original/translation pairs for common interpolation markers:
- supports
{name},{123},<123>,</123>,<123/>,%(name)s - ensures both messages use the same set of variables - no renames, no removals, no additions
- supports
- supports Github Actions error reporting syntax (when
env.GITHUB_ACTIONSis set) - supports lingui plural syntax -
msgstr "{count, plural, one {依存関係} other {依存関係}}"is the one case when the thing in {} needs to change between msgid and msgstr
Example usage
$ lint-po locale/*.po
Difference between msgid="Hello {name}" and msgstr="Bonjour {nom}":
Missing from msgstr: {name}
Unexpected in msgstr: {nom}
at problem.po:2
TODO
- catch nesting errors (<0><1></0></1>), reordering is fine but nesting still needs to make sense
- ensure positional counts (3x %s vs 4x %s, etc.)
- build: autoincrement version for releases
- check headers, Language:
should match the filename
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
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 lint_po-0.1.5.tar.gz.
File metadata
- Download URL: lint_po-0.1.5.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e67ed31568163a9a9e1770dce7ce543dc120a576da17e8343a478763b732213
|
|
| MD5 |
6f8a9f2544b9790a1a53c11b16f6bb5a
|
|
| BLAKE2b-256 |
3e4b31ee4d62c31262d6d891381882df2bfd64cf8473c7deca40d41881fe9b49
|
Provenance
The following attestation bundles were made for lint_po-0.1.5.tar.gz:
Publisher:
build-and-publish.yml on himdel/lint-po
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lint_po-0.1.5.tar.gz -
Subject digest:
3e67ed31568163a9a9e1770dce7ce543dc120a576da17e8343a478763b732213 - Sigstore transparency entry: 1440324462
- Sigstore integration time:
-
Permalink:
himdel/lint-po@28a231bab3b92604c675f7e70a2ef0c6eb1ead5e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/himdel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@28a231bab3b92604c675f7e70a2ef0c6eb1ead5e -
Trigger Event:
push
-
Statement type:
File details
Details for the file lint_po-0.1.5-py3-none-any.whl.
File metadata
- Download URL: lint_po-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc5b316104c2a61e54c5132e1ab2f20f9452886d69548719eb37d87570661806
|
|
| MD5 |
72e9c473e6f907430f3196f47da19bf6
|
|
| BLAKE2b-256 |
68209a3127fb08285c7a4fc7a8abf8910ea3cca6f926dab634f9f4f75f45e894
|
Provenance
The following attestation bundles were made for lint_po-0.1.5-py3-none-any.whl:
Publisher:
build-and-publish.yml on himdel/lint-po
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lint_po-0.1.5-py3-none-any.whl -
Subject digest:
bc5b316104c2a61e54c5132e1ab2f20f9452886d69548719eb37d87570661806 - Sigstore transparency entry: 1440324470
- Sigstore integration time:
-
Permalink:
himdel/lint-po@28a231bab3b92604c675f7e70a2ef0c6eb1ead5e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/himdel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-and-publish.yml@28a231bab3b92604c675f7e70a2ef0c6eb1ead5e -
Trigger Event:
push
-
Statement type: