Skip to main content

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/msgstr pairs 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 Github Actions error reporting syntax (when env.GITHUB_ACTIONS is set)

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

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

lint-po-0.1.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

lint_po-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file lint-po-0.1.2.tar.gz.

File metadata

  • Download URL: lint-po-0.1.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for lint-po-0.1.2.tar.gz
Algorithm Hash digest
SHA256 86e420999774210f17fe1f72269bfb75ac68f68305a2b2420d2117a618b2a21b
MD5 2905090376a18209c548ba4967f3e394
BLAKE2b-256 614a8c2efdcae028c4f4387e11f7f0adbb96e92c5299474ce9433ded43e1dd93

See more details on using hashes here.

File details

Details for the file lint_po-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: lint_po-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for lint_po-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b34834cde57a05f5c60e13b56d862abe9bdd620499c095efee3f81ade8b708c
MD5 b98c855899d9df39f7f29c3481b5b98b
BLAKE2b-256 3b6ccd9bd29a034fb2340935ffe3b13dc2fb15b0b057e75bd3dbcfc468bd9937

See more details on using hashes here.

Supported by

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