Home

Awesome

flake8-qt-tr

PyPI Python 3.10 License: MIT pre-commit.ci status Code style: black Ruff

Flake8 extension for detecting incorrect QT translations.

Installation

with pip:

pip install flake8-qt-tr

with pre-commit (doc):

repos:
  - repo: https://github.com/PyCQA/flake8
    rev: '' # pick a git hash/tag
    hooks:
      - id: flake8
        additional_dependencies:
          # ...
          - flake8-qt-tr

Error Codes

CodeDescriptionExample
TR011Translation is formatted by f-string.self.tr(f"Value: {val}")
TR012Translation is formatted by format method.self.tr("Value: {}".format(val))
TR013Translation is formatted by printf-style.self.tr("Value: %s" % val)