From fb6fffa69f8797f3bb10400a4373c2dc30d46341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=A4hr?= Date: Sun, 26 Feb 2023 20:38:40 +0100 Subject: [PATCH] PD: Retranslate InvoluteGear's Task Panel on language change This makes use of the recent additions to `TaskPanelPython` and `UiLoader`, cf. #8602, to retranslate the UI without having to close and reopen it again. Retranslation of the part from the UI file is now handled by FreeCAD internally, but the tool tips from the property descriptions still need to be reassigned with the translated versions. --- src/Mod/PartDesign/InvoluteGearFeature.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Mod/PartDesign/InvoluteGearFeature.py b/src/Mod/PartDesign/InvoluteGearFeature.py index 7c2d40de72..b6c06f6940 100644 --- a/src/Mod/PartDesign/InvoluteGearFeature.py +++ b/src/Mod/PartDesign/InvoluteGearFeature.py @@ -223,6 +223,10 @@ class _InvoluteGearTaskPanel: assign("DedendumCoefficient", self.form.doubleSpinBox_Dedendum, self.form.label_Dedendum) assign("RootFilletCoefficient", self.form.doubleSpinBox_RootFillet, self.form.label_RootFillet) + def changeEvent(self, event): + if event == QtCore.QEvent.LanguageChange: + self.assignToolTipsFromPropertyDocs() + def transferTo(self): "Transfer from the dialog to the object" self.obj.NumberOfTeeth = self.form.spinBox_NumberOfTeeth.value()