If you change the source code, I'll submit the PR
FreeCAD coding/documentation standards?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: FreeCAD coding/documentation standards?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: FreeCAD coding/documentation standards?
Submitting the PR I could figure out, I can find instructions previously posted. It's the changing code I have no clue how.
Re: FreeCAD coding/documentation standards?
There is not one unified way to do this unfortunately, it depends on each module. I think the right way would be to leave the object Name in english, so someone can for example open a file made in another language and still figure out more or less what the object is (although the icon informs), and just translate the Label.
In python module, that means basically that in every place where a new object is created, for ex. with a line like this:
it should be followed by a line like this:
That's the theory. In practice each module will have implemented this in different ways...
But you are right. I'll take care of this for Draft and Arch after the 0.18 release. issue #3388
In python module, that means basically that in every place where a new object is created, for ex. with a line like this:
Code: Select all
obj = FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython","Line")
Code: Select all
obj.Label = translate("Draft","Line")
But you are right. I'll take care of this for Draft and Arch after the 0.18 release. issue #3388
Re: FreeCAD coding/documentation standards?
Sorry but I'm a little confused. One one side you want to leave the object's "name" in English, but on the other side you want to translate the label? In the Model tree, isn't it the label rather than the name which is shown?
I guess you mean the internal name which shows in preselection in the status bar, or in some GUI dialogues and of course in the python console. I hadn't thought of that.
I understand it would create major headaches to translate the internal name. I think just allowing label translation would be fine. Of course, that might be problematic with GUI dialogues that show the internal names instead of the label. But the problem exists already when the user renames the labels.
Re: FreeCAD coding/documentation standards?
Yes exactly. This internal name at the moment also doesn't support non-ASCII characters, which I think is a good thing, because then we are 100% sure there will never be unicode problem with them.
So yes, only the Label (ie. the name that appears in the tree, and that the user can change) would be translated.