BIM: Fix 'Convert to type' dialogue unhandled placeholder #20676 (#20705)

Handle %1 placeholder that was appearing in text strings
in the 'Convert to type' dialogue. This was affecting multiple
language files in the translation system.

This change improves the readability and correctness of the displayed text
in the application interface.

The dialog now dynamically shows the correct type (e.g., 'WallType', 'BeamType')
in the user's interface language.

---------

Co-authored-by: _sameer <sameer.mishra@infra.market>
This commit is contained in:
Sameer Mishra
2025-04-15 23:28:28 +05:30
committed by GitHub
parent 2dcdd6ac01
commit 2768ce7933

View File

@@ -76,6 +76,10 @@ def convert_to_type(obj, keep_object=False):
if FreeCAD.GuiUp:
import FreeCADGui
dlg = FreeCADGui.PySideUic.loadUi(":/ui/dialogConvertType.ui")
original_text = dlg.label.text()
dlg.label.setText(original_text.replace("%1", obj.Class+"Type"))
result = dlg.exec_()
if not result:
return