shaise / FreeCAD_SheetMetal

A simple sheet metal workbench for FreeCAD
http://theseger.com/projects/2015/06/sheet-metal-addon-for-freecad/
GNU Lesser General Public License v2.1
190 stars 55 forks source link

Make parameter `shapeType` enum translatable #338

Closed hasecilu closed 3 months ago

hasecilu commented 3 months ago
shaise commented 3 months ago

Hi @hasecilu ,

Sorry, this will not work. Since your translation goes all the way down to the command property as well, loading a file saved in another language will cause an error Perhaps we need to translate only the gui.

shai

hasecilu commented 3 months ago

Hi, I made several tests and it seems is like that, previously only tested on current session.

Do you know if FreeCAD has a method to get the index of the enum property? When we retrieve the value it returns the string, i think would to the trick.

shaise commented 3 months ago

When freecad saves an enum parameter, it saves it name. When it reads it, it must be one of the enums it have in the list.

hasecilu commented 3 months ago

Well, for now I think the method OnChanged() could be made using the strings, I'll make another PR

shaise commented 3 months ago

As said, the gui (task window) can still be translatable - but then set the property with the original values.