But in the regard of Python commands it even could have been the case they never ever existet and just noone complained about.
This is rather unlikely because the .ts files include several command-related string literals (e.g. for FEM_ResultShow). When I run pyside2-lupdate
for commands.py the ts file will be empty.
Would you give an example how it needs to be coded? I would fix them.
The translation of Python command-related string literals works this way:
- mark the text with QT_TRANSLATE_NOOP where as first argument you specify the context string. The context string is the one you use to register the command
- run the script to update the .ts file (done by Yorik)
- translate the strings and update the .qm files (Yorik and community)
Example code:
Change
Code: Select all
class _ResultShow(CommandManager):
"The FEM_ResultShow command definition"
def __init__(self):
super(_ResultShow, self).__init__()
self.menutext = "Show result"
self.accel = "R, S"
self.tooltip = "Shows and visualizes selected result data"
self.is_active = "with_selresult"
def Activated(self):
self.selobj.ViewObject.Document.setEdit(self.selobj.ViewObject, 0)
to
Code: Select all
class _ResultShow(CommandManager):
"The FEM_ResultShow command definition"
def __init__(self):
super(_ResultShow, self).__init__()
self.menutext = Qt.QT_TRANSLATE_NOOP("FEM_ResultShow", "Show result")
self.accel = "R, S"
self.tooltip = Qt.QT_TRANSLATE_NOOP("FEM_ResultShow", "Shows and visualizes selected result data")
self.is_active = "with_selresult"
def Activated(self):
self.selobj.ViewObject.Document.setEdit(self.selobj.ViewObject, 0)
You get
with