Skip to main content

pre-commit hooks for PO files

Project description

pre-commit-po-hooks

PyPI Python versions License Tests

Hooks for pre-commit useful working with PO files.

Example configuration

- repo: https://github.com/mondeja/pre-commit-po-hooks
  rev: v1.0.0
  hooks:
    - id: obsolete-messages
    - id: untranslated-messages
    - id: lreplace-extracted-comments
      args: ['-m', 'Translators: ', '-r', '']

Hooks

obsolete-messages

Checks for obsolete messages printing their line numbers if found.

untranslated-messages

Checks for untranslated messages printing their line numbers if found.

lreplace-extracted-comments

Replaces a matching string at the beginning of the extracted comments. This can be used to remove the string "Translators: " introduced by Django (see more about this problem in django-rosetta#245).

Parameters

  • -m/--match "STRING": Matching string to be replaced.
  • -r/--replacement "STRING": Replacement for the match at the beginning of the extracted comment. If you want to remove the matching beginning you can pass an empty string "".
  • -d/--dry-run: Don't do the replacements, only writes to stderr the locations of the extracted comments to be replaced.

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

pre_commit_po_hooks-1.1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

pre_commit_po_hooks-1.1.0-py2.py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 2 Python 3

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