shaise / FreeCAD_FastenersWB

A workbench to add/attach various fasteners to parts
GNU General Public License v2.0
286 stars 86 forks source link

[Improvement] Properties are displayed in lower case #391

Closed leoheck closed 5 months ago

leoheck commented 5 months ago

Hi, can we have the properties using Sentence case or Title Case as it is with the Base properties? Values false/true could also be False/True. image

shaise commented 5 months ago

the true/false are built in FreeCad properties. they are not controlled by fasteners workbench

leoheck commented 5 months ago

I see, but this list is a display that does not need to be the Python code itself. You can treat them to display to the user. You can also treat them to get from the user. Freecad is getting polished on the dev version and I thought the text on this extension could be improved too.

shaise commented 5 months ago

Perhaps I was not clear. I can not change it even if I want to. This is an internal FreeCAD featute. For example: sketch parameters are also lower case: image

leoheck commented 5 months ago

Ah, I see. Then if it is like that everywhere, it is good as it is. Now property names could still be improved to match the other properties, right?

leoheck commented 5 months ago

Your example shows the Title case is used when there is more than one word.

image

shaise commented 5 months ago

Yes! I will take a look

shaise commented 5 months ago

And... Sorry. Although this name is controlled by the workbench, this is also saved when saving the file. If I change everything to upper case, it will no longer be able to read old files...

leoheck commented 5 months ago

I see, why don't you present them using Title Case, and when saving you do it in lowercase... or even better ignore the case when reading from the file so old versions will be ok, and the new versions of the file will be written in title case.

leoheck commented 5 months ago

I think you can a simple regexp to filter out the case when reading from the file.

shaise commented 5 months ago

I see, why don't you present them using Title Case, and when saving you do it in lowercase... or even better ignore the case when reading from the file so old versions will be ok, and the new versions of the file will be written in title case.

Once again - this is internal to freecad. That's why you can not translate property names. The only way to fix it currently, Is create a conversion script that read old files, copy old parameters to new parameters and delete old parameters. Also, every place there is a use for the parametes (fastener WB files or any script that uses it) must be converted as well. I wish that there was a possibility to have a separate display name - this way it was possible to change only the display name and even have translations for it. Perhaps Freecad will eventually support it.

leoheck commented 5 months ago

Thanks for the clarification @shaise

shaise commented 5 months ago

@leoheck , After some consideration I decided to change Fasteners to Title Case, Since doing it in freecad core will take sometime. This work meant changing 72 files and add a built in migration script to migrate old Fastener files. I guess this comprehensive change might cause some things to break, but I'll fix it once I get feedback from the community. If you have old files with fasteners, please try them (by loading and doing some changes to the fasteners). Let me know if you encounter issues. Thanks! image

leoheck commented 5 months ago

Oh, that's beautiful. Nice @shaise. Thanks for considering this suggestion. As soon as I install it I will test my old files to report in case of any problem.

leoheck commented 5 months ago

I am checking this right now, this looks good and professional.

image

Did not have any issues with a couple of files. I will close this issue, and if I have any I can open it again, or create a new one. Cool?