Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.67 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.67 KB

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

Code Description Example
TR011 Translation is formatted by f-string. self.tr(f"Value: {val}")
TR012 Translation is formatted by format method. self.tr("Value: {}".format(val))
TR013 Translation is formatted by printf-style. self.tr("Value: %s" % val)