Awesome
flake8-qt-tr
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) |