You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your Python code, import FreeCAD, then create a function called `translate` with the following code:
```python
translate = FreeCAD.Qt.translate
```
I only see Qt translation by function, but it is possible to translate using tr method from QObject.
In my opinion, this is a much better option (especially when object-oriented style is used).
Actually lupdate do not care about parent class, so it should be even possible to implement a custom method:
Should this translation pattern be encouraged? Or there are reasons why this is not mentioned here?
(There are problems with subclassing, but I know a workaround for this.)
In this markdown:
DevelopersHandbook/technical/translation.md
Lines 109 to 115 in 245f3d3
I only see Qt translation by function, but it is possible to translate using
tr
method fromQObject
.In my opinion, this is a much better option (especially when object-oriented style is used).
Actually
lupdate
do not care about parent class, so it should be even possible to implement a custom method:Should this translation pattern be encouraged? Or there are reasons why this is not mentioned here?
(There are problems with subclassing, but I know a workaround for this.)
This is a very frustrating error:
DevelopersHandbook/technical/translation.md
Line 127 in 245f3d3
It is so frustrating that I created a flake8 plugin to detect these errors. Can I advertise this flake8 plugin/pre-commit check here?
The text was updated successfully, but these errors were encountered: