Flake8 extension for detecting incorrect QT translations.
with pip:
pip install flake8-qt-trwith pre-commit (doc):
repos:
- repo: https://github.com/PyCQA/flake8
rev: '' # pick a git hash/tag
hooks:
- id: flake8
additional_dependencies:
# ...
- flake8-qt-tr| 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) |