diff --git a/src/Gui/Language/FreeCAD.ts b/src/Gui/Language/FreeCAD.ts index aab39afe45..9196374fda 100644 --- a/src/Gui/Language/FreeCAD.ts +++ b/src/Gui/Language/FreeCAD.ts @@ -5297,6 +5297,10 @@ How do you want to proceed? Expression... + + Auto expand + + Gui::PropertyEditor::PropertyModel diff --git a/src/Gui/TaskView/TaskDialog.cpp b/src/Gui/TaskView/TaskDialog.cpp index e36279c843..a2358c161a 100644 --- a/src/Gui/TaskView/TaskDialog.cpp +++ b/src/Gui/TaskView/TaskDialog.cpp @@ -38,7 +38,9 @@ using namespace Gui::TaskView; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ TaskDialog::TaskDialog() - : QObject(0), pos(North), escapeButton(true) + : QObject(nullptr), pos(North) + , escapeButton(true) + , autoCloseTransaction(false) { } @@ -84,6 +86,11 @@ void TaskDialog::closed() } +void TaskDialog::autoClosedOnTransactionChange() +{ + +} + void TaskDialog::clicked(int) { diff --git a/src/Gui/TaskView/TaskDialog.h b/src/Gui/TaskView/TaskDialog.h index 51c44ba359..08d7bdccaa 100644 --- a/src/Gui/TaskView/TaskDialog.h +++ b/src/Gui/TaskView/TaskDialog.h @@ -75,6 +75,15 @@ public: return escapeButton; } + /// Defines whether a task dialog must be closed if the document changed the + /// active transaction. + void setAutoCloseOnTransactionChange(bool on) { + autoCloseTransaction = on; + } + bool isAutoCloseOnTransactionChange() const { + return autoCloseTransaction; + } + const std::string& getDocumentName() const { return documentName; } void setDocumentName(const std::string& doc) @@ -105,6 +114,9 @@ public: virtual void open(); /// is called by the framework when the dialog is closed virtual void closed(); + /// is called by the framework when the dialog is automatically closed due to + /// changing the active transaction + virtual void autoClosedOnTransactionChange(); /// is called by the framework if a button is clicked which has no accept or reject role virtual void clicked(int); /// is called by the framework if the dialog is accepted (Ok) @@ -129,6 +141,7 @@ protected: private: std::string documentName; bool escapeButton; + bool autoCloseTransaction; }; } //namespace TaskView diff --git a/src/Gui/TaskView/TaskView.cpp b/src/Gui/TaskView/TaskView.cpp index 456c411905..8a6e61e14e 100644 --- a/src/Gui/TaskView/TaskView.cpp +++ b/src/Gui/TaskView/TaskView.cpp @@ -532,12 +532,22 @@ void TaskView::slotDeletedDocument() void TaskView::slotUndoDocument(const App::Document&) { + if (ActiveDialog && ActiveDialog->isAutoCloseOnTransactionChange()) { + ActiveDialog->autoClosedOnTransactionChange(); + removeDialog(); + } + if (!ActiveDialog) updateWatcher(); } void TaskView::slotRedoDocument(const App::Document&) { + if (ActiveDialog && ActiveDialog->isAutoCloseOnTransactionChange()) { + ActiveDialog->autoClosedOnTransactionChange(); + removeDialog(); + } + if (!ActiveDialog) updateWatcher(); } diff --git a/src/Mod/AddonManager/Resources/AddonManager.qrc b/src/Mod/AddonManager/Resources/AddonManager.qrc index e0d897faaa..0db7ccb034 100644 --- a/src/Mod/AddonManager/Resources/AddonManager.qrc +++ b/src/Mod/AddonManager/Resources/AddonManager.qrc @@ -46,6 +46,7 @@ icons/Reinforcement_workbench_icon.svg icons/Reporting_workbench_icon.svg icons/Render_workbench_icon.svg + icons/Rocket_workbench_icon.svg icons/sheetmetal_workbench_icon.svg icons/slic3r-tools_workbench_icon.svg icons/Ship_workbench_icon.svg diff --git a/src/Mod/AddonManager/Resources/icons/Rocket_workbench_icon.svg b/src/Mod/AddonManager/Resources/icons/Rocket_workbench_icon.svg new file mode 100644 index 0000000000..8e96d0b952 --- /dev/null +++ b/src/Mod/AddonManager/Resources/icons/Rocket_workbench_icon.svg @@ -0,0 +1,111 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/AddonManager/Resources/translations/AddonManager.ts b/src/Mod/AddonManager/Resources/translations/AddonManager.ts index aa67aa7390..28937f59c7 100644 --- a/src/Mod/AddonManager/Resources/translations/AddonManager.ts +++ b/src/Mod/AddonManager/Resources/translations/AddonManager.ts @@ -1,9 +1,9 @@ - + AddonInstaller - + Installed location @@ -11,267 +11,267 @@ AddonsInstaller - + Unable to fetch the code of this macro. - + Unable to retrieve a description for this macro. - + The addons that can be installed here are not officially part of FreeCAD, and are not reviewed by the FreeCAD team. Make sure you know what you are installing! - + Addon manager - + You must restart FreeCAD for changes to take effect. Press Ok to restart FreeCAD now, or Cancel to restart later. - + Checking for updates... - + Apply - + update(s) - + No update available - + Macro successfully installed. The macro is now available from the Macros dialog. - + Unable to install - + Addon successfully removed. Please restart FreeCAD - + Unable to remove this addon - + Macro successfully removed. - + Macro could not be removed. - + Unable to download addon list. - + Workbenches list was updated. - + Outdated GitPython detected, consider upgrading with pip. - + List of macros successfully retrieved. - + Retrieving description... - + Retrieving info from - + An update is available for this addon. - + This addon is already installed. - + Retrieving info from git - + Retrieving info from wiki - + GitPython not found. Using standard download instead. - + Your version of python doesn't appear to support ZIP files. Unable to proceed. - + Workbench successfully installed. Please restart FreeCAD to apply the changes. - + Missing workbench - + Missing python module - + Missing optional python module (doesn't prevent installing) - + Some errors were found that prevent to install this workbench - + Please install the missing components first. - + Error: Unable to download - + Successfully installed - + GitPython not installed! Cannot retrieve macros from git - + Installed - + Update available - + Restart required - + This macro is already installed. - + A macro has been installed and is available under Macro -> Macros menu - + This addon is marked as obsolete - + This usually means it is no longer maintained, and some more advanced addon in this list provides the same functionality. - + Error: Unable to locate zip from - + Something went wrong with the Git Macro Retrieval, possibly the Git executable is not in the path - + This addon is marked as Python 2 Only - + This workbench may no longer be maintained and installing it on a Python 3 system will more than likely result in errors at startup or while in use. - + User requested updating a Python 2 workbench on a system running Python 3 - - + Workbench successfully updated. Please restart FreeCAD to apply the changes. - + User requested installing a Python 2 workbench on a system running Python 3 - - + Appears to be an issue connecting to the Wiki, therefore cannot retrieve Wiki macro list at this time - + Raw markdown displayed - + Python Markdown library is missing. @@ -279,129 +279,129 @@ Dialog - + Workbenches - + Macros - + Execute - + Downloading info... - + Update all - + Executes the selected macro, if installed - + Uninstalls a selected macro or workbench - + Installs or updates the selected macro or workbench - + Download and apply all available updates - + Custom repositories (one per line): - + Sets configuration options for the Addon Manager - + Configure... - + Addon manager options - + Uninstall selected - + Install/update selected - + Close - + If this option is selected, when launching the Addon Manager, installed addons will be checked for available updates (this requires the GitPython package installed on your system) - + Automatically check for updates at start (requires GitPython) - + Proxy - + No proxy - + User system proxy - + User defined proxy : - + Addon Manager - + Close the Addon Manager - + You can use this window to specify additional addon repositories to be scanned for available addons @@ -410,12 +410,12 @@ to be scanned for available addons Std_AddonMgr - + &Addon manager - + Manage external workbenches and macros diff --git a/src/Mod/Arch/Resources/translations/Arch.ts b/src/Mod/Arch/Resources/translations/Arch.ts index 17ccdba35a..ec0c86609a 100644 --- a/src/Mod/Arch/Resources/translations/Arch.ts +++ b/src/Mod/Arch/Resources/translations/Arch.ts @@ -1,2014 +1,2014 @@ - + App::Property - + The intervals between axes - + The angles of each axis - + The length of the axes - + The size of the axis bubbles - + The numbering style - + The type of this building - + The base object this component is built upon - + The object this component is cloning - + Other shapes that are appended to this object - + Other shapes that are subtracted from this object - + An optional description for this component - + An optional tag for this component - + A material for this object - + Specifies if this object must move together when its host is moved - + The area of all vertical faces of this object - + The area of the projection of this object onto the XY plane - + The perimeter length of the horizontal area - + The model description of this equipment - + Additional snap points for this equipment - + The electric power needed by this equipment in Watts - + The height of this object - + The computed floor area of this floor - + The placement of this object - + The profile used to build this frame - + Specifies if the profile must be aligned with the extrusion wires - + An offset vector between the base sketch and the frame - + Crossing point of the path on the profile. - + The rotation of the profile around its extrusion axis - + The length of this element, if not based on a profile - + The width of this element, if not based on a profile - + The thickness or extrusion depth of this element - + The number of sheets to use - + The offset between this panel and its baseline - + The length of waves for corrugated elements - + The height of waves for corrugated elements - + The direction of waves for corrugated elements - + The type of waves for corrugated elements - + The area of this panel - + The facemaker type to use to build the profile of this object - + The normal extrusion direction of this object (keep (0,0,0) for automatic normal) - + The linked object - + The line width of the rendered objects - + The color of the panel outline - + The size of the tag text - + The color of the tag text - + The X offset of the tag text - + The Y offset of the tag text - + The font of the tag text - + The text to display. Can be %tag%, %label% or %description% to display the panel tag or label - + The position of the tag text. Keep (0,0,0) for center position - + The rotation of the tag text - + A margin inside the boundary - + Turns the display of the margin on/off - + The linked Panel cuts - + The tag text to display - + The width of the sheet - + The height of the sheet - + The fill ratio of this sheet - + The diameter of this pipe, if not based on a profile - + The length of this pipe, if not based on an edge - + An optional closed profile to base this pipe on - + Offset from the start point - + Offset from the end point - + The curvature radius of this connector - + The pipes linked by this connector - + The type of this connector - + The length of this element - + The width of this element - + The height of this element - + The structural nodes of this element - + The size of the chamfer of this element - + The dent length of this element - + The dent height of this element - + The dents of this element - + The chamfer length of this element - + The base length of this element - + The groove depth of this element - + The groove height of this element - + The spacing between the grooves of this element - + The number of grooves of this element - + The dent width of this element - + The type of this slab - + The size of the base of this element - + The number of holes in this element - + The major radius of the holes of this element - + The minor radius of the holes of this element - + The spacing between the holes of this element - + The length of the down floor of this element - + The number of risers in this element - + The riser height of this element - + The tread depth of this element - + Outside Diameter - + Wall thickness - + Width of the beam - + Height of the beam - + Thickness of the web - + Thickness of the flanges - + Thickness of the sides - + Thickness of the webs - + Thickness of the flange - + The diameter of the bar - + The distance between the border of the beam and the first bar (concrete cover). - + The distance between the border of the beam and the last bar (concrete cover). - + The amount of bars - + The spacing between the bars - + The direction to use to spread the bars. Keep (0,0,0) for automatic direction. - + The fillet to apply to the angle of the base profile. This value is multiplied by the bar diameter. - + The description column - + The values column - + The units column - + The objects column - + The filter column - + The spreadsheet to print the results to - + If false, non-solids will be cut too, with possible wrong results. - + The display length of this section plane - + The display height of this section plane - + The size of the arrows of this section plane - + Show the cut in the 3D view - + The rendering mode to use - + If cut geometry is shown or not - + If cut geometry is filled or not - + The size of the texts inside this object - + If checked, source objects are displayed regardless of being visible in the 3D model - + The base terrain of this site - + The postal or zip code of this site - + The city of this site - + The country of this site - + The latitude of this site - + Angle between the true North and the North direction in this document - + The elevation of level 0 of this site - + The perimeter length of this terrain - + The volume of earth to be added to this terrain - + The volume of earth to be removed from this terrain - + An extrusion vector to use when performing boolean operations - + Remove splitters from the resulting shape - + Show solar diagram or not - + The scale of the solar diagram - + The position of the solar diagram - + The color of the solar diagram - + The objects that make the boundaries of this space object - + The computed floor area of this space - + The finishing of the floor of this space - + The finishing of the walls of this space - + The finishing of the ceiling of this space - + Objects that are included inside this space, such as furniture - + The type of this space - + The thickness of the floor finish - + The number of people who typically occupy this space - + The electric power needed to light this space in Watts - + The electric power needed by the equipment of this space in Watts - + If True, Equipment Power will be automatically filled by the equipment included in this space - + The type of air conditioning of this space - + The text to show. Use $area, $label, $tag, $floor, $walls, $ceiling to insert the respective data - + The name of the font - + The color of the area text - + The size of the text font - + The size of the first line of text - + The space between the lines of text - + The position of the text. Leave (0,0,0) for automatic position - + The justification of the text - + The number of decimals to use for calculated texts - + Show the unit suffix - + The length of these stairs, if no baseline is defined - + The width of these stairs - + The total height of these stairs - + The alignment of these stairs on their baseline, if applicable - + The number of risers in these stairs - + The depth of the treads of these stairs - + The height of the risers of these stairs - + The size of the nosing - + The thickness of the treads - + The type of landings of these stairs - + The type of winders in these stairs - + The type of structure of these stairs - + The thickness of the massive structure or of the stringers - + The width of the stringers - + The offset between the border of the stairs and the structure - + An optional extrusion path for this element - + The height or extrusion depth of this element. Keep 0 for automatic - + A description of the standard profile this element is based upon - + Offset distance between the centerline and the nodes line - + If the nodes are visible or not - + The width of the nodes line - + The size of the node points - + The color of the nodes line - + The type of structural node - + Axes systems this structure is built on - + The element numbers to exclude when this structure is based on axes - + If true the element are aligned with axes - + The length of this wall. Not used if this wall is based on an underlying object - + The width of this wall. Not used if this wall is based on a face - + The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid - + The alignment of this wall on its base object, if applicable - + The face number of the base object used to build this wall - + The offset between this wall and its baseline (only for left and right alignments) - + The normal direction of this window - + The area of this window - + An optional higher-resolution mesh or shape for this object - + An optional additional placement to add to the profile before extruding it - + Opens the subcomponents that have a hinge defined - + A standard code (MasterFormat, OmniClass,...) - + A description for this material - + The transparency value of this material - + The color of this material - + The list of layer names - + The list of layer materials - + The list of layer thicknesses - + The line color of the projected objects - + The color of the cut faces (if turned on) - + The overlap of the stringers above the bottom of the treads - + The number of the wire that defines the hole. A value of 0 means automatic - + The label of each axis - + If true, show the labels - + A transformation to apply to each label - + The axes this system is made of - + An optional axis or axis system on which this object should be duplicated - + The type of edges to consider - + If true, geometry is fused, otherwise a compound - + If True, the object is rendered as a face, if possible. - + The allowed angles this object can be rotated to when placed on sheets - + Specifies an angle for the wood grain (Clockwise, 0 is North) - + Specifies the scale applied to each panel view. - + A list of possible rotations for the nester - + Turns the display of the wood grain texture on/off - + The total distance to span the rebars over. Keep 0 to automatically use the host shape size. - + List of placement of all the bars - + The structure object that hosts this rebar - + The custom spacing of rebar - + Shape of rebar - + Shows plan opening symbols if available - + Show elevation opening symbols if available - + The objects that host this window - + An optional custom bubble number - + The type of line to draw this axis - + Where to add bubbles to this axis: Start, end, both or none - + The line width to draw this axis - + The color of this axis - + The number of the first axis - + The font to use for texts - + The font size - + The placement of this axis system - + The level of the (0,0,0) point of this level - + The shape of this object - + The line width of this object - + An optional unit to express levels - + A transformation to apply to the level mark - + If true, show the level - + If true, show the unit on the level tag - + If true, when activated, the working plane will automatically adapt to this level - + The font to be used for texts - + The font size of texts - + Camera position data associated with this object - + If set, the view stored in this object will be restored on double-click - + The individual face colors - + If set to True, the working plane will be kept on Auto mode - + An optional standard (OmniClass, etc...) code for this component - + The URL of the product page of this equipment - + A URL where to find information about this material - + The horizontal offset of waves for corrugated elements - + If the wave also affects the bottom side or not - + The font file - + An offset value to move the cut plane from the center point - + Length of a single rebar - + Total length of all rebars - + The base file this component is built upon - + The part to use from the base file - + The latest time stamp of the linked file - + If true, the colors from the linked file will be kept updated - + The objects that must be considered by this section plane. Empty means the whole document. - + The transparency of this object - + The color of this object - + The distance between the cut plane and the actual view cut (keep this a very small value but not zero) - + The street and house number of this site, with postal box or apartment number if needed - + The region, province or county of this site - + A url that shows this site in a mapping website - + An optional offset between the model (0,0,0) origin and the point indicated by the geocoordinates - + Specifies if this space is internal or external - + The width of a Landing (Second edge and after - First edge follows Width property) - + The Blondel ratio indicates comfortable stairs and should be between 62 and 64cm or 24.5 and 25.5in - + The depth of the landing of these stairs - + The depth of the treads of these stairs - Enforced regardless of Length or edge's Length - + The height of the risers of these stairs - Enforced regardless of Height or edge's Height - + The direction of flight after landing - + The 'absolute' top level of a flight of stairs leads to - + The 'left outline' of stairs - + The 'left outline' of all segments of stairs - + Enable this to make the wall generate blocks - + The length of each block - + The height of each block - + The horizontal offset of the first line of blocks - + The horizontal offset of the second line of blocks - + The size of the joints between each block - + The number of entire blocks - + The number of broken blocks - + The components of this window - + The depth of the hole that this window makes in its host object. If 0, the value will be calculated automatically. - + An optional object that defines a volume to be subtracted from hosts of this window - + The width of this window - + The height of this window - + The preset number this window is based on - + The frame size of this window - + The offset size of this window - + The width of louvre elements - + The space between louvre elements - + The number of the wire that defines the hole. If 0, the value will be calculated automatically - + Specifies if moving this object moves its base instead - + A single section of the fence - + A single fence post - + The Path the fence should follow - + The number of sections the fence is built of - + The number of posts used to build the fence - + The type of this object - + IFC data - + IFC properties of this object - + Description of IFC attributes are not yet implemented - + If True, resulting views will be clipped to the section plane area. - + If true, the color of the objects material will be used to fill cut areas. - + When set to 'True North' the whole geometry will be rotated to match the true north of this site - + Show compass or not - + The rotation of the Compass relative to the Site - + The position of the Compass relative to the Site placement - + Update the Declination value based on the compass rotation - + The thickness of the risers - + The 'right outline' of all segments of stairs - + If true, show the objects contained in this Building Part will adopt these line, color and transparency settings - + The line width of child objects - + The line color of child objects - + The shape color of child objects - + The transparency of child objects - + When true, the fence will be colored like the original post and section. - + If true, the height value propagates to contained objects - + This property stores an inventor representation for this object - + If true, display offset will affect the origin mark too - + If true, the object's label is displayed - + If this is enabled, the inventor representation of this object will be saved in the FreeCAD file, allowing to reference it in other files in lightweight mode. - + A slot to save the inventor representation of this object, if enabled - + Cut the view above this level - + The distance between the level plane and the cut line - + Turn cutting on when activating this level - + Use the material color as this object's shape color, if available - + The number of vertical mullions - + If the profile of the vertical mullions get aligned with the surface or not - + The number of vertical sections of this curtain wall - + A profile for vertical mullions (disables vertical mullion size) - + The number of horizontal mullions - + If the profile of the horizontal mullions gets aligned with the surface or not - + The number of horizontal sections of this curtain wall - + A profile for horizontal mullions (disables horizontal mullion size) - + The number of diagonal mullions - + The size of the diagonal mullions, if any, if no profile is used - + A profile for diagonal mullions, if any (disables horizontal mullion size) - + The number of panels - + The thickness of the panels - + Swaps horizontal and vertical lines - + Perform subtractions between components so none overlap - + Centers the profile over the edges or not - + The vertical direction reference to be used by this object to deduce vertical/horizontal directions. Keep it close to the actual vertical direction of your curtain wall - + The wall thickness of this pipe, if not based on a profile - + The way the referenced objects are included in the current document. 'Normal' includes the shape, 'Transient' discards the shape when the object is switched off (smaller filesize), 'Lightweight' does not import the shape but only the OpenInventor representation - + If True, a spreadsheet containing the results is recreated when needed - + If True, additional lines with each individual object are added to the results - + The time zone where this site is located - + The angle of the truss - + The slant type of this truss - + The normal direction of this truss - + The height of the truss at the start position - + The height of the truss at the end position - + An optional start offset for the top strut - + An optional end offset for the top strut - + The height of the main top and bottom elements of the truss - + The width of the main top and bottom elements of the truss - + The type of the middle element of the truss - + The direction of the rods - + The diameter or side of the rods - + The number of rod sections - + If the truss has a rod at its endpoint or not - + How to draw the rods - + This overrides Width attribute to set width of each segment of wall. Ignored if Base object provides Widths information, with getWidths() method. (The 1st value override 'Width' attribute for 1st segment of wall; if a value is zero, 1st value of 'OverrideWidth' will be followed) - + This overrides Align attribute to set Align of each segment of wall. Ignored if Base object provides Aligns information, with getAligns() method. (The 1st value override 'Align' attribute for 1st segment of wall; if a value is not 'Left, Right, Center', 1st value of 'OverrideAlign' will be followed) - + The area of this wall as a simple Height * Length calculation - + If True, double-clicking this object in the tree activates it - + An optional host object for this curtain wall - + The height of the curtain wall, if based on an edge - + The height of the vertical mullions profile, if no profile is used - + The width of the vertical mullions profile, if no profile is used - + The height of the horizontal mullions profile, if no profile is used - + The width of the horizontal mullions profile, if no profile is used - + An optional EPW File for the location of this site. Refer to the Site documentation to know how to obtain one - + Show wind rose diagram or not. Uses solar diagram scale. Needs Ladybug module - + The rebar mark - + The color of this material when cut - + The list of angles of the roof segments - + The list of horizontal length projections of the roof segments - + The list of IDs of the relative profiles of the roof segments - + The list of thicknesses of the roof segments - + The list of overhangs of the roof segments - + The list of calculated heights of the roof segments - + The face number of the base object used to build the roof - + The total length of the ridges and hips of the roof - + The total length of the borders of the roof - + Specifies if the direction of the roof should be flipped - + Show the label in the 3D view @@ -2016,1650 +2016,1608 @@ Arch - + Components - + Components of this object - + Axes - + Create Axis - + Remove - + Add - + Axis - + Distance - + Angle - + is not closed - + is not valid - + doesn't contain any solid - + contains a non-closed solid - + contains faces that are not part of any solid - + Grouping - + Ungrouping - + Split Mesh - + Mesh to Shape - + Base component - + Additions - + Subtractions - + Objects - + Roof - + Create Roof - + Unable to create a roof - + Page - + View of - + Create Section Plane - + Create Site - + Create Structure - + Create Wall - + Width - + Height - + This mesh is an invalid solid - + Create Window - + Edit - + Create/update component - + Base 2D object - + Wires - + Create new component - + Name - + Type - + Thickness - + Error: Couldn't determine character encoding - + file %s successfully created. - + Add space boundary - + Remove space boundary - + Please select a base object - + Fixtures - + Frame - + Create Frame - + Create Rebar - + Create Space - + Create Stairs - + Length - + Error: The base shape couldn't be extruded along this tool object - + Couldn't compute a shape - + Merge Wall - + Please select only wall objects - + Merge Walls - + Distances (mm) and angles (deg) between axes - + Error computing the shape of this object - + Create Structural System - + Object doesn't have settable IFC Attributes - + Disabling Brep force flag of object - + Enabling Brep force flag of object - + has no solid - + has an invalid shape - + has a null shape - + Cutting - + Create Equipment - + You must select exactly one base object - + The selected object must be a mesh - + This mesh has more than 1000 facets. - + This operation can take a long time. Proceed? - + The mesh has more than 500 facets. This will take a couple of minutes... - + Create 3 views - + Create Panel - + Id - + IdRel - + Cut Plane - + Cut Plane options - + Behind - + Front - + Angle (deg) - + Run (mm) - + Thickness (mm) - + Overhang (mm) - + Height (mm) - + Create Component - + Create material - + Walls can only be based on Part or Mesh objects - + Set text position - + Category - + Key - + Value - + Unit - + Create IFC properties spreadsheet - + Create Building - + Group - + Create Floor - + Create Panel Cut - + Create Panel Sheet - + Facemaker returned an error - + Tools - + Edit views positions - + Create Pipe - + Create Connector - + Precast elements - + Slab type - + Chamfer - + Dent length - + Dent width - + Dent height - + Slab base - + Number of holes - + Major diameter of holes - + Minor diameter of holes - + Spacing between holes - + Number of grooves - + Depth of grooves - + Height of grooves - + Spacing between grooves - + Number of risers - + Length of down floor - + Height of risers - + Depth of treads - + Precast options - + Dents list - + Add dent - + Remove dent - + Slant - + Level - + Rotation - + Offset - + Unable to retrieve value from object - + Import CSV File - + Export CSV File - + Schedule - - There is no valid object in the selection. -Site creation aborted. - - - - + Node Tools - + Reset nodes - + Edit nodes - + Extend nodes - + Extends the nodes of this element to reach the nodes of another element - + Connect nodes - + Connects nodes of this element with the nodes of another element - + Toggle all nodes - + Toggles all structural nodes of the document on/off - + Intersection found. - + Door - + Hinge - + Opening mode - + Get selected edge - + Press to retrieve the selected edge - + Which side to cut - + You must select a base shape object and optionally a mesh object - + Create multi-material - + Material - + New layer - + Wall Presets... - + Hole wire - + Pick selected - + Create Axis System - + Create Grid - + Label - + Axis system components - + Grid - + Total width - + Total height - + Add row - + Del row - + Add col - + Del col - + Create span - + Remove span - + Rows - + Columns - + This object has no face - + Space boundaries - + Error: Unable to modify the base object of this wall - + Window elements - + Survey - + Set description - + Clear - + Copy Length - + Copy Area - + Export CSV - + Description - + Area - + Total - + Hosts - + Only axes must be selected - + Please select at least one axis - + Auto height is larger than height - + Total row size is larger than height - + Auto width is larger than width - + Total column size is larger than width - - There is no valid object in the selection. -Building creation aborted. - - - - + BuildingPart - + Create BuildingPart - + Invalid cutplane - + All good! No problems found - + The object doesn't have an IfcProperties attribute. Cancel spreadsheet creation for object: - + Toggle subcomponents - + Closing Sketch edit - + Component - + Edit IFC properties - + Edit standard code - + Property - + Add property... - + Add property set... - + New... - + New property - + New property set - - You can put anything but the following objects: Site, Building, and Floor - in a Floor object. -Floor object is not allowed to accept Site, Building, or Floor objects. -Site, Building, and Floor objects will be removed from the selection. -You can change that in the preferences. - - - - - There is no valid object in the selection. -Floor creation aborted. - - - - + Crossing point not found in profile. - + Error computing shape of - + Please select exactly 2 or 3 Pipe objects - + Please select only Pipe objects - + Unable to build the base path - + Unable to build the profile - + Unable to build the pipe - + The base object is not a Part - + Too many wires in the base shape - + The base wire is closed - + The profile is not a 2D Part - + The profile is not closed - + Only the 3 first wires will be connected - + Common vertex not found - + Pipes are already aligned - + At least 2 pipes must align - + Profile - + Please select a base face on a structural object - + Create external reference - + Section plane settings - + Objects seen by this section plane: - + Section plane placement: - + Rotate X - + Rotate Y - + Rotate Z - + Resize - + Center - - Please either select only Building objects or nothing at all! -Site is not allowed to accept any other object besides Building. -Other objects will be removed from the selection. -Note: You can change that in the preferences. - - - - + Choose another Structure object: - + The chosen object is not a Structure - + The chosen object has no structural nodes - + One of these objects has more than 2 nodes - + Unable to find a suitable intersection point - + Intersection found. - + The selected wall contains no subwall to merge - + Cannot compute blocks for wall - + Choose a face on an existing object or select a preset - + Unable to create component - + The number of the wire that defines a hole in the host object. A value of zero will automatically adopt the largest wire - + + default - + If this is checked, the default Frame value of this window will be added to the value entered here - + If this is checked, the default Offset value of this window will be added to the value entered here - + pycollada not found, collada support is disabled. - + This exporter can currently only export one site object - + Error: Space '%s' has no Zone. Aborting. - + Couldn't locate IfcOpenShell - + IfcOpenShell not found or disabled, falling back on internal parser. - + IFC Schema not found, IFC import disabled. - + Error: IfcOpenShell is not installed - + Error: your IfcOpenShell version is too old - + Successfully written - + Found a shape containing curves, triangulating - + Successfully imported - - You can put anything but Site and Building objects in a Building object. -Building object is not allowed to accept Site and Building objects. -Site and Building objects will be removed from the selection. -You can change that in the preferences. - - - - + Remove highlighted objects from the list above - + Add selected - + Add selected object(s) to the scope of this section plane - + Rotates the plane along the X axis - + Rotates the plane along the Y axis - + Rotates the plane along the Z axis - + Resizes the plane to fit the objects in the list above - + Centers the plane on the objects in the list above - + First point of the beam - + Base point of column - + Next point - + Structure options - + Drawing mode - + Beam - + Column - + Preset - + Switch L/H - + Switch L/W - + Con&tinue - + First point of wall - + Wall options - + This list shows all the MultiMaterials objects of this document. Create some to define wall types. - + Alignment - + Left - + Right - + Use sketches - + Structure - + Window - + Window options - + Auto include in host object - + Sill height - + Curtain Wall - + Please select only one base object or none - + Create Curtain Wall - + Total thickness - + depends on the object - + Create Project - + Unable to recognize that file type - + Truss - + Create Truss - + Arch - + Rebar tools - + Create profile - + Profile settings - + Create Profile - + Shapes elevation - + Choose which field provides shapes elevations: - + No shape found in this file - + Shapefile module not found - + Error: Unable to download from: - + Could not download shapefile module. Aborting. - + Shapefile module not downloaded. Aborting. - + Shapefile module not found. Aborting. - + The shapefile library can be downloaded from the following URL and installed in your macros folder: - + The shapefile python library was not found on your system. Would you like to download it now from <a href="https://github.com/GeospatialPython/pyshp">https://github.com/GeospatialPython/pyshp</a>? It will be placed in your macros folder. - + Parameters of the roof profiles : * Angle : slope in degrees relative to the horizontal. * Run : horizontal distance between the wall and the ridge. @@ -3674,130 +3632,184 @@ If Run = 0 then the run is calculated so that the height is the same as the rela - + Wall - + This window has no defined opening - + Invert opening direction - + Invert hinge position + + + You can put anything but Site and Building objects in a Building object. + +Building object is not allowed to accept Site and Building objects. + +Site and Building objects will be removed from the selection. + +You can change that in the preferences. + + + + + There is no valid object in the selection. + +Building creation aborted. + + + + + Please either select only Building objects or nothing at all! + +Site is not allowed to accept any other object besides Building. + +Other objects will be removed from the selection. + +Note: You can change that in the preferences. + + + + + There is no valid object in the selection. + +Site creation aborted. + + + + + You can put anything but the following objects: Site, Building, and Floor - in a Floor object. + +Floor object is not allowed to accept Site, Building, or Floor objects. + +Site, Building, and Floor objects will be removed from the selection. + +You can change that in the preferences. + + + + + There is no valid object in the selection. + +Floor creation aborted. + + ArchMaterial - + Arch material - + Choose preset... - + Name - + Description - + Color - + URL - + Copy existing... - + Choose a preset card - + Copy values from an existing material in the document - + The name/label of this material - + An optional description for this material - + The color of this material - + Transparency - + A transparency value for this material - + Standard code - + A standard (MasterFormat, Omniclass...) code for this material - + Opens the URL in a browser - + A URL describing this material - + Opens a browser dialog to choose a class from a BIM standard - + Father - + Section Color @@ -3805,12 +3817,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_3Views - + 3 views from mesh - + Creates 3 views (top, front, side) from a mesh-based object @@ -3818,12 +3830,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Add - + Add component - + Adds the selected components to the active object @@ -3831,22 +3843,22 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Axis - + Axis - + Grid - + Creates a customizable grid object - + Creates a set of axes @@ -3854,12 +3866,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_AxisSystem - + Axis System - + Creates an axis system from a set of axes @@ -3867,7 +3879,7 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_AxisTools - + Axis tools @@ -3875,12 +3887,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Building - + Building - + Creates a building object including selected objects. @@ -3888,12 +3900,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_BuildingPart - + BuildingPart - + Creates a BuildingPart object including selected objects @@ -3901,12 +3913,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Check - + Check - + Checks the selected objects for problems @@ -3914,12 +3926,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_CloneComponent - + Clone component - + Clones an object as an undefined architectural component @@ -3927,12 +3939,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_CloseHoles - + Close holes - + Closes holes in open shapes, turning them solids @@ -3940,12 +3952,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Component - + Component - + Creates an undefined architectural component @@ -3953,12 +3965,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_CurtainWall - + Curtain Wall - + Creates a curtain wall object from selected line or from scratch @@ -3966,22 +3978,22 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_CutPlane - + Cut with plane - + Cut an object with a plane - + Cut with a line - + Cut an object with a line with normal workplane @@ -3989,12 +4001,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Equipment - + Equipment - + Creates an equipment object from a selected object (Part or Mesh) @@ -4002,12 +4014,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Fence - + Fence - + Creates a fence object from a selected section, post and path @@ -4015,12 +4027,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Floor - + Level - + Creates a Building Part object that represents a level, including selected objects @@ -4028,12 +4040,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Frame - + Frame - + Creates a frame object from a planar 2D object (the extrusion path(s)) and a profile. Make sure objects are selected in that order. @@ -4041,62 +4053,62 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Grid - + The number of rows - + The number of columns - + The sizes for rows - + The sizes of columns - + The span ranges of cells that are merged together - + The type of 3D points produced by this grid object - + The total width of this grid - + The total height of this grid - + Creates automatic column divisions (set to 0 to disable) - + Creates automatic row divisions (set to 0 to disable) - + When in edge midpoint mode, if this grid must reorient its children along edge normals or not - + The indices of faces to hide @@ -4104,12 +4116,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_IfcSpreadsheet - + Create IFC spreadsheet... - + Creates a spreadsheet to store IFC properties of an object. @@ -4117,12 +4129,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Material - + Creates or edits the material definition of a selected object. - + Material @@ -4130,7 +4142,7 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_MaterialTools - + Material tools @@ -4138,12 +4150,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_MergeWalls - + Merge Walls - + Merges the selected walls, if possible @@ -4151,12 +4163,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_MeshToShape - + Mesh to Shape - + Turns selected meshes into Part Shape objects @@ -4164,12 +4176,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_MultiMaterial - + Multi-Material - + Creates or edits multi-materials @@ -4177,12 +4189,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Nest - + Nest - + Nests a series of selected shapes in a container @@ -4190,12 +4202,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Panel - + Panel - + Creates a panel object from scratch or from a selected object (sketch, wire, face or solid) @@ -4203,7 +4215,7 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_PanelTools - + Panel tools @@ -4211,7 +4223,7 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Panel_Cut - + Panel Cut @@ -4219,17 +4231,17 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Panel_Sheet - + Creates 2D views of selected panels - + Panel Sheet - + Creates a 2D sheet which can contain panel cuts @@ -4237,17 +4249,17 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Pipe - + Pipe - + Creates a pipe object from a given Wire or Line - + Creates a connector between 2 or 3 selected pipes @@ -4255,7 +4267,7 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_PipeConnector - + Connector @@ -4263,7 +4275,7 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_PipeTools - + Pipe tools @@ -4271,12 +4283,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Profile - + Profile - + Creates a profile object @@ -4284,12 +4296,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Project - + Project - + Creates a project entity aggregating the selected sites. @@ -4297,12 +4309,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Rebar - + Creates a Reinforcement bar from the selected face of a structural object - + Custom Rebar @@ -4310,12 +4322,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Reference - + External reference - + Creates an external reference object @@ -4323,12 +4335,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Remove - + Remove component - + Remove the selected components from their parents, or create a hole in a component @@ -4336,12 +4348,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_RemoveShape - + Remove Shape from Arch - + Removes cubic shapes from Arch components @@ -4349,12 +4361,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Roof - + Roof - + Creates a roof object from the selected wire. @@ -4362,12 +4374,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Schedule - + Schedule - + Creates a schedule to collect data from the model @@ -4375,12 +4387,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_SectionPlane - + Section Plane - + Creates a section plane object, including the selected objects @@ -4388,12 +4400,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_SelectNonSolidMeshes - + Select non-manifold meshes - + Selects all non-manifold meshes from the document or from the selected groups @@ -4401,12 +4413,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Site - + Site - + Creates a site object including selected objects. @@ -4414,17 +4426,17 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Space - + Space - + Creates a space object from selected boundary objects - + Creates a stairs object @@ -4432,12 +4444,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_SplitMesh - + Split Mesh - + Splits selected meshes into independent components @@ -4445,7 +4457,7 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Stairs - + Stairs @@ -4453,12 +4465,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Structure - + Structure - + Creates a structure object from scratch or from a selected object (sketch, wire, face or solid) @@ -4466,12 +4478,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Survey - + Survey - + Starts survey @@ -4479,12 +4491,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_ToggleIfcBrepFlag - + Toggle IFC Brep flag - + Force an object to be exported as Brep or not @@ -4492,12 +4504,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_ToggleSubs - + Toggle subcomponents - + Shows or hides the subcomponents of this object @@ -4505,12 +4517,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Truss - + Truss - + Creates a truss object from selected line or from scratch @@ -4518,12 +4530,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Wall - + Wall - + Creates a wall object from scratch or from a selected object (wire, face or solid) @@ -4531,12 +4543,12 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Arch_Window - + Window - + Creates a window object from a selected object (wire, rectangle or sketch) @@ -4544,77 +4556,77 @@ If Run = 0 then the run is calculated so that the height is the same as the rela BimServer - + BimServer - + Server - + The name of the BimServer you are currently connecting to. Change settings in Arch Preferences - + Bim Server - + Connect - + Idle - + Open in browser - + Project - + The list of projects present on the Bim Server - + Download - + Available revisions: - + Open - + Upload - + Root object: - + Comment @@ -4622,197 +4634,192 @@ If Run = 0 then the run is calculated so that the height is the same as the rela Dialog - + Schedule definition - + Description - + A description for this operation - + Unit - + Objects - + Filter - + Adds a line below the selected line/cell - + Deletes the selected line - + Clears the whole list - + Clear - + Put selected objects into the "Objects" column of the selected row - + Imports the contents of a CSV file - + Import - + Export - + BimServer Login - + Login (email): - + Password: - + Dialog - + BimServer URL: - + Keep me logged in across FreeCAD sessions - + IFC properties editor - + IFC UUID: - + Leave this empty to generate one at export - + List of IFC properties for this object. Double-click to edit, drag and drop to reorganize - + Delete selected property/set - + Force exporting geometry as BREP - + Force export full FreeCAD parametric data - + Schedule name: - + Property - + An optional unit to express the resulting value. Ex: m^3 (you can also write m³ or m3) - + If this is enabled, an associated spreadsheet containing the results will be maintained together with this schedule object - + Associate spreadsheet - + If this is turned on, additional lines will be filled with each object considered. If not, only the totals. - + Detailed results - + Add row - + Del row - + Add selection - - <html><head/><body><p>This exports the results to a CSV or Markdown file. </p><p><span style=" font-weight:600;">Note for CSV export:</span></p><p>In Libreoffice, you can keep this CSV file linked by right-clicking the Sheets tab bar -&gt; New sheet -&gt; From file -&gt; Link (Note: as of LibreOffice v5.4.5.1 the correct path now is: Sheets tab bar -&gt; Insert Sheet... -&gt; From file -&gt; Browse...)</p></body></html> - - - - + The property to retrieve from each object. Can be "Count" to count the objects, or property names like "Length" or "Shape.Volume" to retrieve @@ -4820,7 +4827,7 @@ a certain property. - + An optional semicolon (;) separated list of object names (internal names, not labels), to be considered by this operation. If the list contains groups, children will be added. @@ -4828,45 +4835,50 @@ Leave blank to use all objects from the document - + <html><head/><body><p>An optional semicolon (;) separated list of property:value filters. Prepend ! to a property name to invert the effect of the filer (exclude objects that match the filter). Objects whose property contains the value will be matched. Examples of valid filters (everything is case-insensitive):</p><p><span style=" font-weight:600;">Name:Wall</span> - Will only consider objects with &quot;wall&quot; in their name (internal name)</p><p><span style=" font-weight:600;">!Name:Wall</span> - Will only consider objects which DON'T have &quot;wall&quot; in their name (internal name)</p><p><span style=" font-weight:600;">Description:Win</span> - Will only consider objects with &quot;win&quot; in their description</p><p><span style=" font-weight:600;">!Label:Win</span> - Will only consider objects which DO NOT have &quot;win&quot; in their label</p><p><span style=" font-weight:600;">IfcType:Wall</span> - Will only consider objects which Ifc Type is &quot;Wall&quot;</p><p><span style=" font-weight:600;">!Tag:Wall</span> - Will only consider objects which tag is NOT &quot;Wall&quot;</p><p>If you leave this field empty, no filtering is applied</p></body></html> - + Unnamed schedule + + + <html><head/><body><p>This exports the results to a CSV or Markdown file. </p><p><span style=" font-weight:600;">Note for CSV export:</span></p><p>In Libreoffice, you can keep this CSV file linked by right-clicking the Sheets tab bar -&gt; New sheet -&gt; From file -&gt; Link (Note: as of LibreOffice v6.x the correct path now is: Sheet -&gt; Insert Sheet... -&gt; From file -&gt; Browse...)</p></body></html> + + Draft - + Writing camera position - + Draft creation tools - + Draft annotation tools - + Draft modification tools - + Draft - + Import-Export @@ -4874,212 +4886,212 @@ Leave blank to use all objects from the document Form - + Git - + Status - + Log - + Refresh - + List of files to be committed: - + Diff - + Select all - + Commit - + Commit message - + Remote repositories - + Pull - + Push - + Multimaterial definition - + Copy existing... - + Edit definition - + Name: - + Composition: - + Add - + Up - + Down - + Del - + Nesting - + Container - + Pick selected - + Shapes - + Add selected - + Remove - + Nesting parameters - + Rotations - + Tolerance - + Arcs subdivisions - + Closer than this, two points are considered equal - + The number of segments to divide non-linear edges into, for calculations. If curved shapes overlap, try raising this value - + A comma-separated list of angles to try and rotate the shapes - + 0,90,180,270 - + Nesting operation - + pass %p - + Start - + Stop - + Preview - + Total thickness - + Invert @@ -5087,772 +5099,772 @@ Leave blank to use all objects from the document Gui::Dialog::DlgSettingsArch - + General settings - + This is the default color for new Wall objects - + This is the default color for new Structure objects - + 2D rendering - + Show debug information during 2D rendering - + Show renderer debug messages - + Cut areas line thickness ratio - + Specifies how many times the viewed line thickness must be applied to cut lines - + Width: - + Height: - + Color: - + Length: - + Diameter - + Offset - + The default width for new windows - + The default height for new windows - + Thickness: - + The default thickness for new windows - + Frame color: - + Glass color: - + Auto-join walls - + If this is checked, when 2 similar walls are being connected, their underlying sketches will be joined into one, and the two walls will become one - + Join walls base sketches when possible - + Mesh to Shape Conversion - + If this is checked, conversion is faster but the result might still contain triangulated faces - + Fast conversion - + Tolerance: - + If this is checked, flat groups of faces will be force-flattened, resulting in possible gaps and non-solid results - + Force flat faces - + If this is checked, holes in faces will be performed by subtraction rather than using wires orientation - + Cut method - + Show debug messages - + Separate openings - + Prefix names with ID number - + Scaling factor - + Defaults - + Walls - + mm - + Structures - + Rebars - + Windows - + Transparency: - + 30, 10 - + Stairs - + Number of steps: - + Panels - + mm - + Thickness - + Force export as Brep - + Bim server - + Address - + http://localhost:8082 - + DAE - + Export options - + General options - + Import options - + Import arch IFC objects as - + Specifies what kind of objects will be created in FreeCAD - + Parametric Arch objects - + Non-parametric Arch objects - + Simple Part shapes - + One compound per floor - + Do not import Arch objects - + Import struct IFC objects as - + One compound for all - + Do not import structural objects - + Root element: - + Detect extrusions - + Mesher - + Builtin - + Mefisto - + Netgen - + Builtin and mefisto mesher options - + Tessellation - + Netgen mesher options - + Grading - + Segments per edge - + Segments per radius - + Second order - + Allows optimization - + Optimize - + Allow quads - + Use triangulation options set in the DAE options page - + Use DAE triangulation options - + Join coplanar facets when triangulating - + Object creation - + Two possible strategies to avoid circular dependencies: Create one more object (unchecked) or remove external geometry of base sketch (checked) - + Remove external geometry of base sketches when needed - + Create clones when objects have shared geometry - + If this is checked, when an object becomes Subtraction or Addition of an Arch object, it will receive the Draft Construction color. - + Apply Draft construction style to subcomponents - + Symbol line thickness ratio - + Pattern scale - + Open in external browser - + Survey - + If this is checked, the text that gets placed in the clipboard will include the unit. Otherwise, it will be a simple number expressed in internal units (millimeters) - + Include unit when sending measurements to clipboard - + Pipes - + Diameter: - + Split walls made of multiple layers - + Split multilayer walls - + Use IfcOpenShell serializer if available - + Export 2D objects as IfcAnnotations - + Hidden geometry pattern - + Tolerance value to use when checking if 2 adjacent faces as planar - + Fit view while importing - + Export full FreeCAD parametric model - + Do not compute areas for object with more than: - + faces - + Interval between file checks for references - + seconds - + By default, new objects will have their "Move with host" property set to False, which means they won't move when their host object is moved. - + Set "Move with host" property to True by default - + Use sketches - + Helpers (grids, axes, etc...) - + Exclude list: - + Reuse similar entities - + Disable IfcRectangleProfileDef - + Set "Move base" property to True by default - + IFC version - + The IFC version will change which attributes and products are supported - + IFC4 - + IFC2X3 - + Spaces - + Line style: - + Solid - + Dashed - + Dotted - + Dashdot - + Line color - + Import full FreeCAD parametric definitions if available - + Auto-detect and export as standard cases when applicable - + If this is checked, when an Arch object has a material, the object will take the color of the material. This can be overridden for each object. - + Use material color as shape color - + This is the SVG stroke-dasharray property to apply to projections of hidden objects. - + Scaling factor for patterns used by object that have a Footprint display mode - + The URL of a bim server instance (www.bimserver.org) to connect to. - + If this is selected, the "Open BimServer in browser" button will open the Bim Server interface in an external browser instead of the FreeCAD web workbench - + All dimensions in the file will be scaled with this factor - + Meshing program that should be used. If using Netgen, make sure that it is available. - + Tessellation value to use with the Builtin and the Mefisto meshing program. - + Grading value to use for meshing using Netgen. This value describes how fast the mesh size decreases. The gradient of the local mesh size h(x) is bound by |Δh(x)| ≤ 1/value. - + Maximum number of segments per edge - + Number of segments per radius - + Allow a second order mesh - + Allow quadrilateral faces - + IFC export - + Show this dialog when exporting - + Some IFC viewers don't like objects exported as extrusions. Use this to force all objects to be exported as BREP geometry. - + When exporting objects without unique ID (UID), the generated UID will be stored inside the FreeCAD object for reuse next time that object is exported. This leads to smaller differences between file versions. - + Store IFC unique ID in FreeCAD objects - + IFCOpenShell is a library that allows to import IFC files. Its serializer functionality allows to give it an OCC shape and it will produce adequate IFC geometry: NURBS, faceted, or anything else. @@ -5860,24 +5872,24 @@ Note: The serializer is still an experimental feature! - + 2D objects will be exported as IfcAnnotation - + All FreeCAD object properties will be stored inside the exported objects, allowing to recreate a full parametric model on reimport. - + When possible, similar entities will be used only once in the file if possible. This can reduce the file size a lot, but will make it less easily readable. - + When possible, IFC objects that are extruded rectangles will be exported as IfcRectangleProfileDef. However, some other applications might have problems importing that entity. @@ -5885,7 +5897,7 @@ If this is your case, you can disable this and then all profiles will be exporte - + Some IFC types such as IfcWall or IfcBeam have special standard versions like IfcWallStandardCase or IfcBeamStandardCase. If this option is turned on, FreeCAD will automatically export such objects @@ -5893,176 +5905,176 @@ as standard cases when the necessary conditions are met. - + If no site is found in the FreeCAD document, a default one will be added. A site is not mandatory but a common practice is to have at least one in the file. - + Add default site if one is not found in the document - + If no building is found in the FreeCAD document, a default one will be added. Warning: The IFC standard asks for at least one building in each file. By turning this option off, you will produce a non-standard IFC file. However, at FreeCAD, we believe having a building should not be mandatory, and this option is there to have a chance to demonstrate our point of view. - + Add default building if one is not found in the document (no standard) - + If no building storey is found in the FreeCAD document, a default one will be added. A building storey is not mandatory but a common practice to have at least one in the file. - + Add default building storey if one is not found in the document - + IFC file units - + Metric - + Imperial - + IFC import - + Show this dialog when importing - + Shows verbose debug messages during import and export of IFC files in the Report view panel - + Clones are used when objects have shared geometry One object is the base object, the others are clones. - + Only subtypes of the specified element will be imported. Keep the element IfcProduct to import all building elements. - + Openings will be imported as subtractions, otherwise wall shapes will already have their openings subtracted - + The importer will try to detect extrusions. Note that this might slow things down. - + Object names will be prefixed with the IFC ID number - + If several materials with the same name and color are found in the IFC file, they will be treated as one. - + Merge materials with same name and same color - + Each object will have their IFC properties stored in a spreadsheet object - + Import IFC properties in spreadsheet - + IFC files can contain unclean or non-solid geometry. If this option is checked, all the geometry is imported, regardless of their validity. - + Allow invalid shapes - + Comma-separated list of IFC entities to be excluded from imports - + Fit view during import on the imported objects. This will slow down the import, but one can watch the import. - + Creates a full parametric model on import using stored FreeCAD object properties - + Export type - + Standard model - + Structural analysis - + Standard + structural - + Curved shapes that cannot be represented as curves in IFC are decomposed into flat facets. If this is checked, an additional calculation is done to join coplanar facets. - + The type of objects that you wish to export: - Standard model: solid objects. - Structural analysis: wireframe model for structural calculations. @@ -6070,7 +6082,7 @@ If this is checked, an additional calculation is done to join coplanar facets. - + The units you want your IFC file to be exported to. Note that IFC files are ALWAYS written in metric units; imperial units @@ -6080,7 +6092,7 @@ unit to work with when opening the file. - + EXPERIMENTAL The number of cores to use in multicore mode. Keep 0 to disable multicore mode. @@ -6092,12 +6104,12 @@ if you start getting crashes when you set multiple cores. - + Number of cores to use (experimental) - + If this option is checked, the default 'Project', 'Site', 'Building', and 'Storeys' objects that are usually found in an IFC file are not imported, and all objects are placed in a 'Group' instead. @@ -6105,7 +6117,7 @@ are placed in a 'Group' instead. - + Replace 'Project', 'Site', 'Building', and 'Storey' with 'Group' @@ -6113,7 +6125,7 @@ are placed in a 'Group' instead. Workbench - + Arch tools @@ -6121,32 +6133,32 @@ are placed in a 'Group' instead. arch - + &Draft - + Utilities - + &Arch - + Creation - + Annotation - + Modification diff --git a/src/Mod/Draft/Resources/translations/Draft.ts b/src/Mod/Draft/Resources/translations/Draft.ts index 6a2c8b30c4..f81d33d455 100644 --- a/src/Mod/Draft/Resources/translations/Draft.ts +++ b/src/Mod/Draft/Resources/translations/Draft.ts @@ -1,249 +1,1238 @@ - + - Dialog + App::Property - - Annotation Styles Editor + + The start point of this line. - - Style name + + The end point of this line. - - Add new... + + The length of this line. - - Renames the selected style + + Radius to use to fillet the corner. - - Rename + + The base object that will be duplicated - - Deletes the selected style + + The type of array to create. +- Ortho: places the copies in the direction of the global X, Y, Z axes. +- Polar: places the copies along a circular arc, up to a specified angle, and with certain orientation defined by a center and an axis. +- Circular: places the copies in concentric circular layers around the base object. - - Delete + + Specifies if the copies should be fused together if they touch each other (slower) - - Text + + Number of copies in X direction - - Font size + + Number of copies in Y direction - - Line spacing + + Number of copies in Z direction - + + Distance and orientation of intervals in X direction + + + + + Distance and orientation of intervals in Y direction + + + + + Distance and orientation of intervals in Z direction + + + + + The axis direction around which the elements in a polar or a circular array will be created + + + + + Center point for polar and circular arrays. +The 'Axis' passes through this point. + + + + + The axis object that overrides the value of 'Axis' and 'Center', for example, a datum line. +Its placement, position and rotation, will be used when creating polar and circular arrays. +Leave this property empty to be able to set 'Axis' and 'Center' manually. + + + + + Number of copies in the polar direction + + + + + Distance and orientation of intervals in 'Axis' direction + + + + + Angle to cover with copies + + + + + Distance between circular layers + + + + + Distance between copies in the same circular layer + + + + + Number of circular layers. The 'Base' object counts as one layer. + + + + + A parameter that determines how many symmetry planes the circular array will have. + + + + + Total number of elements in the array. +This property is read-only, as the number depends on the parameters of the array. + + + + + Show the individual array elements (only for Link arrays) + + + + + The components of this block + + + + + The placement of this object + + + + + Length of the rectangle + + + + + Height of the rectangle + + + + + Radius to use to fillet the corners + + + + + Size of the chamfer to give to the corners + + + + + Create a face + + + + + Horizontal subdivisions of this rectangle + + + + + Vertical subdivisions of this rectangle + + + + + The area of this object + + + + + The normal direction of the text of the dimension + + + + + The object measured by this dimension object + + + + + The object, and specific subelements of it, +that this dimension object is measuring. + +There are various possibilities: +- An object, and one of its edges. +- An object, and two of its vertices. +- An arc object, and its edge. + + + + + + A point through which the dimension line, or an extrapolation of it, will pass. + +- For linear dimensions, this property controls how close the dimension line +is to the measured object. +- For radial dimensions, this controls the direction of the dimension line +that displays the measured radius or diameter. +- For angular dimensions, this controls the radius of the dimension arc +that displays the measured angle. + + + + + Starting point of the dimension line. + +If it is a radius dimension it will be the center of the arc. +If it is a diameter dimension it will be a point that lies on the arc. + + + + + Ending point of the dimension line. + +If it is a radius or diameter dimension +it will be a point that lies on the arc. + + + + + The direction of the dimension line. +If this remains '(0,0,0)', the direction will be calculated automatically. + + + + + The value of the measurement. + +This property is read-only because the value is calculated +from the 'Start' and 'End' properties. + +If the 'Linked Geometry' is an arc or circle, this 'Distance' +is the radius or diameter, depending on the 'Diameter' property. + + + + + When measuring circular arcs, it determines whether to display +the radius or the diameter value + + + + + Starting angle of the dimension line (circular arc). +The arc is drawn counter-clockwise. + + + + + Ending angle of the dimension line (circular arc). +The arc is drawn counter-clockwise. + + + + + The center point of the dimension line, which is a circular arc. + +This is normally the point where two line segments, or their extensions +intersect, resulting in the measured 'Angle' between them. + + + + + The value of the measurement. + +This property is read-only because the value is calculated from +the 'First Angle' and 'Last Angle' properties. + + + + + The placement of the base point of the first line + + + + + The text displayed by this object. +It is a list of strings; each element in the list will be displayed in its own line. + + + + + Start angle of the arc + + + + + End angle of the arc (for a full circle, + give it same value as First Angle) + + + + + Radius of the circle + + + + + Number of faces + + + + + Radius of the control circle + + + + + How the polygon must be drawn from the control circle + + + + + X Location + + + + + Y Location + + + + + Z Location + + + + + The objects that are part of this layer + + + + + The position of the tip of the leader line. +This point can be decorated with an arrow or another symbol. + + + + + Object, and optionally subelement, whose properties will be displayed +as 'Text', depending on 'Label Type'. + +'Target' won't be used if 'Label Type' is set to 'Custom'. + + + + + The list of points defining the leader line; normally a list of three points. + +The first point should be the position of the text, that is, the 'Placement', +and the last point should be the tip of the line, that is, the 'Target Point'. +The middle point is calculated automatically depending on the chosen +'Straight Direction' and the 'Straight Distance' value and sign. + +If 'Straight Direction' is set to 'Custom', the 'Points' property +can be set as a list of arbitrary points. + + + + + The direction of the straight segment of the leader line. + +If 'Custom' is chosen, the points of the leader can be specified by +assigning a custom list to the 'Points' attribute. + + + + + The length of the straight segment of the leader line. + +This is an oriented distance; if it is negative, the line will be drawn +to the left or below the 'Text', otherwise to the right or above it, +depending on the value of 'Straight Direction'. + + + + + The placement of the 'Text' element in 3D space + + + + + The text to display when 'Label Type' is set to 'Custom' + + + + + The text displayed by this label. + +This property is read-only, as the final text depends on 'Label Type', +and the object defined in 'Target'. +The 'Custom Text' is displayed only if 'Label Type' is set to 'Custom'. + + + + + The type of information displayed by this label. + +If 'Custom' is chosen, the contents of 'Custom Text' will be used. +For other types, the string will be calculated automatically from the object defined in 'Target'. +'Tag' and 'Material' only work for objects that have these properties, like Arch objects. + +For 'Position', 'Length', and 'Area' these properties will be extracted from the main object in 'Target', +or from the subelement 'VertexN', 'EdgeN', or 'FaceN', respectively, if it is specified. + + + + + Text string + + + + + Font file name + + + + + Height of text + + + + + Inter-character spacing + + + + + Show the individual array elements + + + + + Base object that will be duplicated + + + + + Object containing points used to distribute the base object, for example, a sketch or a Part compound. +The sketch or compound must contain at least one explicit point or vertex object. + + + + + Total number of elements in the array. +This property is read-only, as the number depends on the points contained within 'Point Object'. + + + + + Additional placement, shift and rotation, that will be applied to each copy + + + + + The points of the B-spline + + + + + If the B-spline is closed or not + + + + + Create a face if this spline is closed + + + + + Parameterization factor + + + + + The base object this 2D view must represent + + + + + The projection vector of this object + + + + + The way the viewed object must be projected + + + + + The indices of the faces to be projected in Individual Faces mode + + + + + Show hidden lines + + + + + Fuse wall and structure objects of same type and material + + + + + Tessellate Ellipses and B-splines into line segments + + + + + For Cutlines and Cutfaces modes, + this leaves the faces at the cut location + + + + + Length of line segments if tessellating Ellipses or B-splines + into line segments + + + + + If this is True, this object will be recomputed only if it is + visible + + + + + Start angle of the elliptical arc + + + + + End angle of the elliptical arc + + (for a full circle, give it same value as First Angle) + + + + + Minor radius of the ellipse + + + + + Major radius of the ellipse + + + + + Area of this object + + + + + The points of the Bezier curve + + + + + The degree of the Bezier function + + + + + Continuity + + + + + If the Bezier curve should be closed or not + + + + + Create a face if this curve is closed + + + + + The length of this object + + + + + The object along which the copies will be distributed. It must contain 'Edges'. + + + + + List of connected edges in the 'Path Object'. +If these are present, the copies will be created along these subelements only. +Leave this property empty to create copies along the entire 'Path Object'. + + + + + Number of copies to create + + + + + Additional translation that will be applied to each copy. +This is useful to adjust for the difference between shape centre and shape reference point. + + + + + Alignment vector for 'Tangent' mode + + + + + Force use of 'Vertical Vector' as local Z direction when using 'Original' or 'Tangent' alignment mode + + + + + Direction of the local Z axis when 'Force Vertical' is true + + + + + Method to orient the copies along the path. +- Original: X is curve tangent, Y is normal, and Z is the cross product. +- Frenet: aligns the object following the local coordinate system along the path. +- Tangent: similar to 'Original' but the local X axis is pre-aligned to 'Tangent Vector'. + +To get better results with 'Original' or 'Tangent' you may have to set 'Force Vertical' to true. + + + + + Orient the copies along the path depending on the 'Align Mode'. +Otherwise the copies will have the same orientation as the original Base object. + + + + + The linked object + + + + + Projection direction + + + + + The width of the lines inside this object + + + + + The size of the texts inside this object + + + + + The spacing between lines of text + + + + + The color of the projected objects + + + + + Shape Fill Style + + + + + Line Style + + + + + If checked, source objects are displayed regardless of being visible in the 3D model + + + + + Linked faces + + + + + Specifies if splitter lines must be removed + + + + + An optional extrusion value to be applied to all faces + + + + + An optional offset value to be applied to all faces + + + + + This specifies if the shapes sew + + + + + The area of the faces of this Facebinder + + + + + The objects included in this clone + + + + + The scale factor of this clone + + + + + If Clones includes several objects, +set True for fusion or False for compound + + + + + General scaling factor that affects the annotation consistently +because it scales the text, and the line decorations, if any, +in the same proportion. + + + + + Annotation style to apply to this object. +When using a saved style some of the view properties will become read-only; +they will only be editable by changing the style through the 'Annotation style editor' tool. + + + + + The vertices of the wire + + + + + If the wire is closed or not + + + + + The base object is the wire, it's formed from 2 objects + + + + + The tool object is the wire, it's formed from 2 objects + + + + + The start point of this line + + + + + The end point of this line + + + + + The length of this line + + + + + Create a face if this object is closed + + + + + The number of subdivisions of each edge + + + + Font name - - The font to use for texts and dimensions + + Font size - - Units + + Spacing between text and dimension line - - Scale multiplier + + Rotate the dimension text 180 degrees - - Decimals + + Text Position. +Leave '(0,0,0)' for automatic position - - Unit override + + Text override. +Write '$dim' so that it is replaced by the dimension length. - - Show unit + + The number of decimals to show - - Line and arrows + + Show the unit suffix - - Line width + + A unit to express the measurement. +Leave blank for system default - - Extension overshoot - - - - + Arrow size - - Show lines - - - - - Dimension overshoot - - - - - Extension lines - - - - + Arrow type - + + Rotate the dimension arrows 180 degrees + + + + + The distance the dimension line is extended +past the extension lines + + + + + Length of the extension lines + + + + + Length of the extension line +beyond the dimension line + + + + + Shows the dimension line and arrows + + + + + If it is true, the objects contained within this layer will adopt the line color of the layer + + + + + If it is true, the print color will be used when objects in this layer are placed on a TechDraw page + + + + + The line color of the objects contained within this layer + + + + + The shape color of the objects contained within this layer + + + + + The line width of the objects contained within this layer + + + + + The draw style of the objects contained within this layer + + + + + The transparency of the objects contained within this layer + + + + + The line color of the objects contained within this layer, when used on a TechDraw page + + + + + Line width + + + + + Line color + + + + + The size of the text + + + + + The font of the text + + + + + The vertical alignment of the text + + + + + Text color + + + + + Line spacing (relative to font size) + + + + + The maximum number of characters on each line of the text box + + + + + The size of the arrow + + + + + The type of arrow of this label + + + + + The type of frame around the text of this object + + + + + Display a leader line or not + + + + + Dialog + + + Annotation Styles Editor + + + + + Style name + + + + + Add new... + + + + + Renames the selected style + + + + + Rename + + + + + Deletes the selected style + + + + + Delete + + + + + Text + + + + + Font size + + + + + Line spacing + + + + + Font name + + + + + The font to use for texts and dimensions + + + + + Units + + + + + Scale multiplier + + + + + Decimals + + + + + Unit override + + + + + Show unit + + + + + Line and arrows + + + + + Line width + + + + + Extension overshoot + + + + + Arrow size + + + + + Show lines + + + + + Dimension overshoot + + + + + Extension lines + + + + + Arrow type + + + + Line / text color - + The width of the dimension lines - + px - + The color of dimension lines, arrows and texts - + Dot - + Arrow - + Tick - + The name of your style. Existing style names can be edited. - + Font size in the system units - + Line spacing in system units - + A multiplier factor that affects the size of texts and markers - + The number of decimals to show for dimension values - + Specify a valid length unit like mm, m, in, ft, to force displaying the dimension value in this unit - + If it is checked it will show the unit next to the dimension value - + The distance that the extension lines are additionally extended beyond the dimension line - + The size of the dimension arrows or markers in system units - + If it is checked it will display the dimension line - + The distance that the dimension line is additionally extended - + The length of the extension lines - + The type of arrows or markers to use at the end of dimension lines - + Circle - + Tick-2 - + Import styles from json file - + Export styles to json file @@ -251,172 +1240,376 @@ Draft - + Download of dxf libraries failed. Please install the dxf Library addon manually from menu Tools -> Addon Manager - + Draft creation tools - + Draft annotation tools - + Draft modification tools - + Draft utility tools - + &Drafting - + &Annotation - + &Modification - + &Utilities - + Draft - + Import-Export + + + Point object doesn't have a discrete point, it cannot be used for an array. + + + + + _BSpline.createGeometry: Closed with same first/last Point. Geometry not updated. + + + + + Writing camera position + + + + + Writing objects shown/hidden state + + + + + Merge layer duplicates + + + + + Add new layer + + + + + Toggles Grid On/Off + + + + + Object snapping + + + + + Toggles Visual Aid Dimensions On/Off + + + + + Toggles Ortho On/Off + + + + + Toggles Constrain to Working Plane On/Off + + + + + Unable to insert new object into a scaled part + + + + + True + + + + + False + + + + + Scale + + + + + X factor + + + + + Y factor + + + + + Z factor + + + + + Uniform scaling + + + + + Working plane orientation + + + + + Copy + + + + + Modify subelements + + + + + Pick from/to points + + + + + Create a clone + + + + + Clone + + + + + Slope + + + + + Circular array + + + + + Creates copies of the selected object, and places the copies in a radial pattern +creating various circular layers. + +The array can be turned into an orthogonal or a polar array by changing its type. + + + + + Polar array + + + + + Creates copies of the selected object, and places the copies in a polar pattern +defined by a center of rotation and its angle. + +The array can be turned into an orthogonal or a circular array by changing its type. + + + + + Array tools + + + + + Create various types of arrays, including rectangular, polar, circular, path, and point + + + + + Array + + + + + Creates copies of the selected object, and places the copies in an orthogonal pattern, +meaning the copies follow the specified direction in the X, Y, Z axes. + +The array can be turned into a polar or a circular array by changing its type. + + + + + Fillet + + + + + Creates a fillet between two selected wires or edges. + + + + + Delete original objects + + + + + Create chamfer + + + + + Offset direction is not defined. Please move the mouse on either side of the object first to indicate a direction + + DraftCircularArrayTaskPanel - + Circular array - + The coordinates of the point through which the axis of rotation passes. Change the direction of the axis itself in the property editor. - + Center of rotation - + Z - + X - + Y - + Reset the coordinates of the center of rotation. - + Reset point - + If checked, the resulting objects in the array will be fused if they touch each other. This only works if "Link array" is off. - + Fuse - + If checked, the resulting object will be a "Link array" instead of a regular array. A Link array is more efficient when creating multiple copies, but it cannot be fused together. - + Link array - + Distance from one element in one ring of the array to the next element in the same ring. It cannot be zero. - + Tangential distance - + Distance from one layer of objects to the next layer of objects. - + Radial distance - + The number of symmetry lines in the circular array. - + Number of circular layers or rings to create, including a copy of the original object. It must be at least 2. - + Number of circular layers - + Symmetry - + (Placeholder for the icon) @@ -424,116 +1617,116 @@ It must be at least 2. DraftOrthoArrayTaskPanel - + Orthogonal array - + Distance between the elements in the Z direction. Normally, only the Z value is necessary; the other two values can give an additional shift in their respective directions. Negative values will result in copies produced in the negative direction. - + Z intervals - + Z - + Y - + X - + Reset the distances. - + Reset Z - + If checked, the resulting objects in the array will be fused if they touch each other. This only works if "Link array" is off. - + Fuse - + If checked, the resulting object will be a "Link array" instead of a regular array. A Link array is more efficient when creating multiple copies, but it cannot be fused together. - + Link array - + (Placeholder for the icon) - + Distance between the elements in the X direction. Normally, only the X value is necessary; the other two values can give an additional shift in their respective directions. Negative values will result in copies produced in the negative direction. - + X intervals - + Reset X - + Distance between the elements in the Y direction. Normally, only the Y value is necessary; the other two values can give an additional shift in their respective directions. Negative values will result in copies produced in the negative direction. - + Y intervals - + Reset Y - + Number of elements in the array in the specified direction, including a copy of the original object. The number must be at least 1 in each direction. - + Number of elements @@ -541,93 +1734,93 @@ The number must be at least 1 in each direction. DraftPolarArrayTaskPanel - + Polar array - + The coordinates of the point through which the axis of rotation passes. Change the direction of the axis itself in the property editor. - + Center of rotation - + Z - + X - + Y - + Reset the coordinates of the center of rotation. - + Reset point - + If checked, the resulting objects in the array will be fused if they touch each other. This only works if "Link array" is off. - + Fuse - + If checked, the resulting object will be a "Link array" instead of a regular array. A Link array is more efficient when creating multiple copies, but it cannot be fused together. - + Link array - + Sweeping angle of the polar distribution. A negative angle produces a polar pattern in the opposite direction. The maximum absolute value is 360 degrees. - + Polar angle - + Number of elements in the array, including a copy of the original object. It must be at least 2. - + Number of elements - + (Placeholder for the icon) @@ -635,452 +1828,1618 @@ It must be at least 2. DraftShapeStringGui - + ShapeString - + Text to be made into ShapeString - + String - + Height - + Height of the result - + X - + Y - + Z - + Font file - + Enter coordinates or select point with mouse. - + Reset 3d point selection - + Reset Point + + Draft_AddConstruction + + + Add to Construction group + + + + + Adds the selected objects to the construction group, +and changes their appearance to the construction style. +It creates a construction group if it doesn't exist. + + + + + Draft_AddPoint + + + Add point + + + + + Adds a point to an existing Wire or B-spline. + + + + + Draft_AddToGroup + + + Ungroup + + + + + Move to group + + + + + Moves the selected objects to an existing group, or removes them from any group. +Create a group first to use this tool. + + + + + Draft_AnnotationStyleEditor + + + Annotation styles... + + + + + Draft_ApplyStyle + + + Apply current style + + + + + Applies the current style defined in the toolbar (line width and colors) to the selected objects and groups. + + + + + Draft_Arc + + + Arc + + + + + Creates a circular arc by a center point and a radius. +CTRL to snap, SHIFT to constrain. + + + + + Draft_ArcTools + + + Arc tools + + + + + Create various types of circular arcs. + + + + + Draft_Array + + + Array + + + + + Creates an array from a selected object. +By default, it is a 2x2 orthogonal array. +Once the array is created its type can be changed +to polar or circular, and its properties can be modified. + + + + + Draft_AutoGroup + + + Autogroup + + + + + Select a group to add all Draft and Arch objects to. + + + + + Draft_BSpline + + + B-spline + + + + + Creates a multiple-point B-spline. CTRL to snap, SHIFT to constrain. + + + + + Draft_BezCurve + + + Bezier curve + + + + + Creates an N-degree Bezier curve. The more points you pick, the higher the degree. +CTRL to snap, SHIFT to constrain. + + + + + Draft_BezierTools + + + Bezier tools + + + + + Create various types of Bezier curves. + + + + + Draft_Circle + + + Circle + + + + + Creates a circle (full circular arc). +CTRL to snap, ALT to select tangent objects. + + + + + Draft_Clone + + + Clone + + + + + Creates a clone of the selected objects. +The resulting clone can be scaled in each of its three directions. + + + + + Draft_CloseLine + + + Close Line + + + + + Closes the line being drawn, and finishes the operation. + + + + + Draft_CubicBezCurve + + + Cubic bezier curve + + + + + Creates a Bezier curve made of 2nd degree (quadratic) and 3rd degree (cubic) segments. Click and drag to define each segment. +After the curve is created you can go back to edit each control point and set the properties of each knot. +CTRL to snap, SHIFT to constrain. + + + + + Draft_DelPoint + + + Remove point + + + + + Removes a point from an existing Wire or B-spline. + + + + + Draft_Dimension + + + Dimension + + + + + Creates a dimension. + +- Pick three points to create a simple linear dimension. +- Select a straight line to create a linear dimension linked to that line. +- Select an arc or circle to create a radius or diameter dimension linked to that arc. +- Select two straight lines to create an angular dimension between them. +CTRL to snap, SHIFT to constrain, ALT to select an edge or arc. + +You may select a single line or single circular arc before launching this command +to create the corresponding linked dimension. +You may also select an 'App::MeasureDistance' object before launching this command +to turn it into a 'Draft Dimension' object. + + + + + Draft_Downgrade + + + Downgrade + + + + + Downgrades the selected objects into simpler shapes. +The result of the operation depends on the types of objects, which may be able to be downgraded several times in a row. +For example, it explodes the selected polylines into simpler faces, wires, and then edges. It can also subtract faces. + + + + + Draft_Draft2Sketch + + + Draft to Sketch + + + + + Convert bidirectionally between Draft objects and Sketches. +Many Draft objects will be converted into a single non-constrained Sketch. +However, a single sketch with disconnected traces will be converted into several individual Draft objects. + + + + + Draft_Drawing + + + Drawing + + + + + Creates a 2D projection on a Drawing Workbench page from the selected objects. +This command is OBSOLETE since the Drawing Workbench became obsolete in 0.17. +Use TechDraw Workbench instead for generating technical drawings. + + + + + Draft_Edit + + + Edit + + + + + Edits the active object. +Press E or ALT+LeftClick to display context menu +on supported nodes and on supported objects. + + + + + Draft_Ellipse + + + Ellipse + + + + + Creates an ellipse. CTRL to snap. + + + + + Draft_Facebinder + + + Facebinder + + + + + Creates a facebinder object from selected faces. + + + + + Draft_FinishLine + + + Finish line + + + + + Finishes a line without closing it. + + + + + Draft_FlipDimension + + + Flip dimension + + + + + Flip the normal direction of the selected dimensions (linear, radial, angular). +If other objects are selected they are ignored. + + + + + Draft_Heal + + + Heal + + + + + Heal faulty Draft objects saved with an earlier version of the program. +If an object is selected it will try to heal that object in particular, +otherwise it will try to heal all objects in the active document. + + + + + Draft_Join + + + Join + + + + + Joins the selected lines or polylines into a single object. +The lines must share a common point at the start or at the end for the operation to succeed. + + + + + Draft_Label + + + Label + + + + + Creates a label, optionally attached to a selected object or subelement. + +First select a vertex, an edge, or a face of an object, then call this command, +and then set the position of the leader line and the textual label. +The label will be able to display information about this object, and about the selected subelement, +if any. + +If many objects or many subelements are selected, only the first one in each case +will be used to provide information to the label. + + + + + Draft_Layer + + + Layer + + + + + Adds a layer to the document. +Objects added to this layer can share the same visual properties such as line color, line width, and shape color. + + + + + Draft_Line + + + Line + + + + + Creates a 2-point line. CTRL to snap, SHIFT to constrain. + + + + + Draft_LinkArray + + + LinkArray + + + + + Like the Array tool, but creates a 'Link array' instead. +A 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used. + + + + + Draft_Mirror + + + Mirror + + + + + Mirrors the selected objects along a line defined by two points. + + + + + Draft_Move + + + Move + + + + + Moves the selected objects from one base point to another point. +If the "copy" option is active, it will create displaced copies. +CTRL to snap, SHIFT to constrain. + + + + + Draft_Offset + + + Offset + + + + + Offsets of the selected object. +It can also create an offset copy of the original object. +CTRL to snap, SHIFT to constrain. Hold ALT and click to create a copy with each click. + + + + + Draft_PathArray + + + Path array + + + + + Creates copies of the selected object along a selected path. +First select the object, and then select the path. +The path can be a polyline, B-spline, Bezier curve, or even edges from other objects. + + + + + Draft_PathLinkArray + + + Path Link array + + + + + Like the PathArray tool, but creates a 'Link array' instead. +A 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used. + + + + + Draft_PathTwistedArray + + + Path twisted array + + + + + Creates copies of the selected object along a selected path, and twists the copies. +First select the object, and then select the path. +The path can be a polyline, B-spline, Bezier curve, or even edges from other objects. + + + + + Draft_PathTwistedLinkArray + + + Path twisted Link array + + + + + Like the PathTwistedArray tool, but creates a 'Link array' instead. +A 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used. + + + + + Draft_Point + + + Point + + + + + Creates a point object. Click anywhere on the 3D view. + + + + + Draft_PointArray + + + Point array + + + + + Creates copies of the selected object, and places the copies at the position of various points. + +The points need to be grouped under a compound of points before using this tool. +To create this compound, select various points and then use the Part Compound tool, +or use the Draft Upgrade tool to create a 'Block', or create a Sketch and add simple points to it. + +Select the base object, and then select the compound or the sketch to create the point array. + + + + + Draft_PointLinkArray + + + PointLinkArray + + + + + Like the PointArray tool, but creates a 'Point link array' instead. +A 'Point link array' is more efficient when handling many copies. + + + + + Draft_Polygon + + + Polygon + + + + + Creates a regular polygon (triangle, square, pentagon, ...), by defining the number of sides and the circumscribed radius. +CTRL to snap, SHIFT to constrain + + + + + Draft_Rectangle + + + Rectangle + + + + + Creates a 2-point rectangle. CTRL to snap. + + + + + Draft_Rotate + + + Rotate + + + + + Rotates the selected objects. Choose the center of rotation, then the initial angle, and then the final angle. +If the "copy" option is active, it will create rotated copies. +CTRL to snap, SHIFT to constrain. Hold ALT and click to create a copy with each click. + + + + + Draft_Scale + + + Scale + + + + + Scales the selected objects from a base point. +CTRL to snap, SHIFT to constrain, ALT to copy. + + + + + Draft_SelectGroup + + + Select group + + + + + Draft_SelectPlane + + + SelectPlane + + + + + Select the face of solid body to create a working plane on which to sketch Draft objects. +You may also select a three vertices or a Working Plane Proxy. + + + + + Draft_SetStyle + + + Set style + + + + + Sets default styles + + + + + Draft_SetWorkingPlaneProxy + + + Create working plane proxy + + + + + Creates a proxy object from the current working plane. +Once the object is created double click it in the tree view to restore the camera position and objects' visibilities. +Then you can use it to save a different camera position and objects' states any time you need. + + + + + Draft_Shape2DView + + + Shape 2D view + + + + + Creates a 2D projection of the selected objects on the XY plane. +The initial projection direction is the negative of the current active view direction. +You can select individual faces to project, or the entire solid, and also include hidden lines. +These projections can be used to create technical drawings with the TechDraw Workbench. + + + + + Draft_ShapeString + + + Shape from text + + + + + Creates a shape from a text string by choosing a specific font and a placement. +The closed shapes can be used for extrusions and boolean operations. + + + + + Draft_ShowSnapBar + + + Show snap toolbar + + + + + Show the snap toolbar if it is hidden. + + + + + Draft_Slope + + + Set slope + + + + + Sets the slope of the selected line by changing the value of the Z value of one of its points. +If a polyline is selected, it will apply the slope transformation to each of its segments. + +The slope will always change the Z value, therefore this command only works well for +straight Draft lines that are drawn in the XY plane. Selected objects that aren't single lines will be ignored. + + + + + Draft_Snap + + + Toggles Grid On/Off + + + + + Toggle Draft Grid + + + + + Draft_Snap_Angle + + + Angle + + + + + Set snapping to points in a circular arc located at multiples of 30 and 45 degree angles. + + + + + Draft_Snap_Center + + + Center + + + + + Set snapping to the center of a circular arc. + + + + + Draft_Snap_Dimensions + + + Show dimensions + + + + + Show temporary linear dimensions when editing an object and using other snapping methods. + + + + + Draft_Snap_Endpoint + + + Endpoint + + + + + Set snapping to endpoints of an edge. + + + + + Draft_Snap_Extension + + + Extension + + + + + Set snapping to the extension of an edge. + + + + + Draft_Snap_Grid + + + Grid + + + + + Set snapping to the intersection of grid lines. + + + + + Draft_Snap_Intersection + + + Intersection + + + + + Set snapping to the intersection of edges. + + + + + Draft_Snap_Lock + + + Main snapping toggle On/Off + + + + + Activates or deactivates all snap methods at once. + + + + + Draft_Snap_Midpoint + + + Midpoint + + + + + Set snapping to the midpoint of an edge. + + + + + Draft_Snap_Near + + + Nearest + + + + + Set snapping to the nearest point of an edge. + + + + + Draft_Snap_Ortho + + + Orthogonal + + + + + Set snapping to a direction that is a multiple of 45 degrees from a point. + + + + + Draft_Snap_Parallel + + + Parallel + + + + + Set snapping to a direction that is parallel to an edge. + + + + + Draft_Snap_Perpendicular + + + Perpendicular + + + + + Set snapping to a direction that is perpendicular to an edge. + + + + + Draft_Snap_Special + + + Special + + + + + Set snapping to the special points defined inside an object. + + + + + Draft_Snap_WorkingPlane + + + Working plane + + + + + Restricts snapping to a point in the current working plane. +If you select a point outside the working plane, for example, by using other snapping methods, +it will snap to that point's projection in the current working plane. + + + + + Draft_Split + + + Split + + + + + Splits the selected line or polyline into two independent lines +or polylines by clicking anywhere along the original object. +It works best when choosing a point on a straight segment and not a corner vertex. + + + + + Draft_Stretch + + + Stretch + + + + + Stretches the selected objects. +Select an object, then draw a rectangle to pick the vertices that will be stretched, +then draw a line to specify the distance and direction of stretching. + + + + + Draft_SubelementHighlight + + + Subelement highlight + + + + + Highlight the subelements of the selected objects, so that they can then be edited with the move, rotate, and scale tools. + + + + + Draft_Text + + + Text + + + + + Creates a multi-line annotation. CTRL to snap. + + + + + Draft_ToggleConstructionMode + + + Toggle construction mode + + + + + Toggles the Construction mode. +When this is active, the following objects created will be included in the construction group, and will be drawn with the specified color and properties. + + + + + Draft_ToggleContinueMode + + + Toggle continue mode + + + + + Toggles the Continue mode. +When this is active, any drawing tool that is terminated will automatically start again. +This can be used to draw several objects one after the other in succession. + + + + + Draft_ToggleDisplayMode + + + Toggle normal/wireframe display + + + + + Switches the display mode of selected objects from flatlines to wireframe and back. +This is helpful to quickly visualize objects that are hidden by other objects. +This is intended to be used with closed shapes and solids, and doesn't affect open wires. + + + + + Draft_ToggleGrid + + + Toggle grid + + + + + Toggles the Draft grid on and off. + + + + + Draft_Trimex + + + Trimex + + + + + Trims or extends the selected object, or extrudes single faces. +CTRL snaps, SHIFT constrains to current segment or to normal, ALT inverts. + + + + + Draft_UndoLine + + + Undo last segment + + + + + Undoes the last drawn segment of the line being drawn. + + + + + Draft_Upgrade + + + Upgrade + + + + + Upgrades the selected objects into more complex shapes. +The result of the operation depends on the types of objects, which may be able to be upgraded several times in a row. +For example, it can join the selected objects into one, convert simple edges into parametric polylines, +convert closed edges into filled faces and parametric polygons, and merge faces into a single face. + + + + + Draft_Wire + + + Polyline + + + + + Creates a multiple-points line (polyline). CTRL to snap, SHIFT to constrain. + + + + + Draft_WireToBSpline + + + Wire to B-spline + + + + + Converts a selected polyline to a B-spline, or a B-spline to a polyline. + + + Form - + Working plane setup - + Select a face or working plane proxy or 3 vertices. Or choose one of the options below - + Sets the working plane to the XY plane (ground plane) - + Top (XY) - + Sets the working plane to the XZ plane (front plane) - + Front (XZ) - + Sets the working plane to the YZ plane (side plane) - + Side (YZ) - + Sets the working plane facing the current view - + Align to view - + The working plane will align to the current view each time a command is started - + Automatic - + An optional offset to give to the working plane above its base position. Use this together with one of the buttons above - + Offset - + If this is selected, the working plane will be centered on the current view when pressing one of the buttons above - + Center plane on view - + Or select a single vertex to move the current working plane without changing its orientation. Then, press the button below - + Moves the working plane without changing its orientation. If no point is selected, the plane will be moved to the center of the view - + Move working plane - + The spacing between the smaller grid lines - + Grid spacing - + The number of squares between each main line of the grid - + Main line every - + The distance at which a point can be snapped to when approaching the mouse. You can also change this value by using the [ and ] keys while drawing - + Snapping radius - + Centers the view on the current working plane - + Center view - + Resets the working plane to its previous position - + Previous - + Grid extension - + lines - + Style settings - + Text color - + Shape color - + Line width - + The color of faces - + The type of dimension arrows - + Dot - + Circle - + Arrow - + Tick - + Tick-2 - + The color of texts and dimension texts - + The size of texts and dimension texts - + Show unit - + Line color - + The size of dimension arrows - + The font to use for texts and dimensions - + The line style - + Solid - + Dashed - + Dotted - + DashDot - + Text size - + Unit override - + The unit to use for dimensions. Leave blank to use current FreeCAD unit - + The transparency of faces - + % - + Transparency - + Display mode - + Text font - + Arrow size - + The display mode for faces - + Flat Lines - + Wireframe - + Shaded - + Points - + Draw style - + The color of lines - + Arrow style - + px - + Apply to selected objects - + Lines and faces - + Annotations - + If the unit suffix is shown on dimension texts or not @@ -1088,67 +3447,67 @@ value by using the [ and ] keys while drawing Gui::Dialog::DlgSettingsDraft - + General Draft Settings - + This is the default color for objects being drawn while in construction mode. - + This is the default group name for construction geometry - + Construction - + Save current color and linewidth across sessions - + Global copy mode - + Default working plane - + None - + XY (Top) - + XZ (Front) - + YZ (Side) - + Default height for texts and dimensions - + This is the default font name for all Draft texts and dimensions. It can be a font name such as "Arial", a default style such as "sans", "serif" or "mono", or a family such as "Arial,Helvetica,sans" or a name with a style @@ -1156,1148 +3515,1148 @@ such as "Arial:Bold" - + Default template sheet - + The default template to use when creating a new drawing sheet - + Import style - + None (fastest) - + Use default color and linewidth - + Original color and linewidth - + Check this if you want the areas (3D faces) to be imported too. - + Import OCA areas - + General settings - + Construction group name - + Tolerance - + Join geometry - + Alternate SVG Patterns location - + Here you can specify a directory containing SVG files containing <pattern> definitions that can be added to the standard Draft hatch patterns - + Constrain mod - + The Constraining modifier key - + Snap mod - + The snap modifier key - + Alt mod - + Select base objects after copying - + If checked, a grid will appear when drawing - + Use grid - + Grid spacing - + The spacing between each grid line - + Main lines every - + Mainlines will be drawn thicker. Specify here how many squares between mainlines. - + Internal precision level - + This is the orientation of the dimension texts when those dimensions are vertical. Default is left, which is the ISO standard. - + Left (ISO standard) - + Right - + Group layers into blocks - + Export 3D objects as polyface meshes - + If checked, the Snap toolbar will be shown whenever you use snapping - + Show Draft Snap toolbar - + Hide Draft snap toolbar after use - + Show Working Plane tracker - + If checked, the Draft grid will always be visible when the Draft workbench is active. Otherwise only when using a command - + Use standard font size for texts - + Import hatch boundaries as wires - + Render polylines with width - + Translated (for print & display) - + Raw (for CAM) - + Translate white line color to black - + Use Part Primitives when available - + Snapping - + If this is checked, snapping is activated without the need to press the snap mod key - + Always snap (disable snap mod) - + Construction geometry color - + Import - + texts and dimensions - + points - + layouts - + *blocks - + Project exported objects along current view direction - + Visual settings - + Visual Settings - + Snap symbols style - + Draft classic style - + Bitsnpieces style - + Color - + Hatch patterns resolution - + Grid - + Always show the grid - + Texts and dimensions - + Internal font - + Dot - + Circle - + Arrow - + The default size of arrows - + The default size of dimensions extension lines - + The space between the dimension line and the dimension text - + Select a font file - + Fill objects with faces whenever possible - + Create - + simple Part shapes - + Draft objects - + Sketches - + Get original colors from the DXF file - + Treat ellipses and splines as polylines - + Export style - + Show the unit suffix in dimensions - + Allow FreeCAD to automatically download and update the DXF libraries - + mm - + Grid size - + lines - + text above (2D) - + text inside (3D) - + Dashed line definition - + 0.09,0.05 - + Dashdot line definition - + 0.09,0.05,0.02,0.05 - + Dotted line definition - + 0.02,0.02 - + Grid and snapping - + Text settings - + Font family - + Font size - + Dimension settings - + Display mode - + Arrows style - + Arrows size - + Text orientation - + Text spacing - + ShapeString settings - + Default ShapeString font file - + Drawing view line definitions - + DWG - + DWG conversion - + <html><head/><body><p><span style=" font-weight:600;">Note:</span> DXF options apply to DWG files as well.</p></body></html> - + DXF - + Import options - + Use legacy python importer - + Export options - + OCA - + SVG - + Disable units scaling - + Export Drawing Views as blocks - + Note: Not all the options below are used by the new importer yet - + Show this dialog when importing and exporting - + Automatic update (legacy importer only) - + Prefix labels of Clones with: - + Scale factor to apply to imported files - + Max segment length for discretized arcs - + Number of decimals - + Shift - + Ctrl - + Alt - + The Alt modifier key - + The number of horizontal or vertical lines of the grid - + The default color for snap symbols - + Check this if you want to use the color/linewidth from the toolbar as default - + If checked, a widget indicating the current working plane orientation appears during drawing operations - + An SVG linestyle definition - + Extension lines size - + Extension line overshoot - + The default length of extension line above dimension line - + Dimension line overshoot - + The default distance the dimension line is extended past extension lines - + Tick - + Tick-2 - + Check this if you want to preserve colors of faces while doing downgrade and upgrade (splitFaces and makeShell only) - + Preserve colors of faces during downgrade/upgrade - + Check this if you want the face names to derive from the originating object name and vice versa while doing downgrade/upgrade (splitFaces and makeShell only) - + Preserve names of faces during downgrade/upgrade - + The path to your ODA (formerly Teigha) File Converter executable - + Ellipse export is poorly supported. Use this to export them as polylines instead. - + Max Spline Segment: - + The number of decimals in internal coordinates operations (for ex. 3 = 0.001). Values between 6 and 8 are usually considered the best trade-off among FreeCAD users. - + This is the value used by functions that use a tolerance. Values with differences below this value will be treated as same. This value will be obsoleted soon so the precision level above controls both. - + Use legacy python exporter - + If this option is set, when creating Draft objects on top of an existing face of another object, the "Support" property of the Draft object will be set to the base object. This was the standard behaviour before FreeCAD 0.19 - + Construction Geometry - + In-Command Shortcuts - + Relative - + R - + Continue - + T - + Close - + O - + Copy - + P - + Subelement Mode - + D - + Fill - + L - + Exit - + A - + Select Edge - + E - + Add Hold - + Q - + Length - + H - + Wipe - + W - + Set WP - + U - + Cycle Snap - + ` - + Snap - + S - + Increase Radius - + [ - + Decrease Radius - + ] - + Restrict X - + X - + Restrict Y - + Y - + Restrict Z - + Z - + If this option is checked, the layers drop-down list will also show groups, allowing you to automatically add objects to groups too. - + Show groups in layers list drop-down button - + Draft tools options - + When drawing lines, set focus on Length instead of X coordinate. This allows to point the direction and type the distance. - + Set focus on Length instead of X coordinate - + Set the Support property when possible - + If this is checked, objects will appear as filled by default. Otherwise, they will appear as wireframe - + Normally, after copying objects, the copies get selected. If this option is checked, the base objects will be selected instead. - + If this is checked, copy mode will be kept across command, otherwise commands will always start in no-copy mode - + Force Draft Tools to create Part primitives instead of Draft objects. Note that this is not fully supported, and many object will be not editable with Draft Modifiers. - + User interface settings - + Enable draft statusbar customization - + Draft Statusbar - + Enable snap statusbar widget - + Draft snap widget - + Enable draft statusbar annotation scale widget - + Annotation scale widget - + Draft Edit preferences - + Edit - + Maximum number of contemporary edited objects - + <html><head/><body><p>Sets the maximum number of objects Draft Edit</p><p>can process at the same time</p></body></html> - + Draft edit pick radius - + Controls pick radius of edit nodes - + Path to ODA file converter - + This preferences dialog will be shown when importing/ exporting DXF files - + Python importer is used, otherwise the newer C++ is used. Note: C++ importer is faster, but is not as featureful yet - + Python exporter is used, otherwise the newer C++ is used. Note: C++ importer is faster, but is not as featureful yet - + Allow FreeCAD to download the Python converter for DXF import and export. You can also do this manually by installing the "dxf_library" workbench from the Addon Manager. - + If unchecked, texts and mtexts won't be imported - + If unchecked, points won't be imported - + If checked, paper space objects will be imported too - + If you want the non-named blocks (beginning with a *) to be imported too - + Only standard Part objects will be created (fastest) - + Parametric Draft objects will be created whenever possible - + Sketches will be created whenever possible - + Scale factor to apply to DXF files on import. The factor is the conversion between the unit of your DXF file and millimeters. Example: for files in millimeters: 1, in centimeters: 10, @@ -2305,157 +4664,157 @@ Example: for files in millimeters: 1, in centimeters: 10, - + Colors will be retrieved from the DXF objects whenever possible. Otherwise default colors will be applied. - + FreeCAD will try to join coincident objects into wires. Note that this can take a while! - + Objects from the same layers will be joined into Draft Blocks, turning the display faster, but making them less easily editable - + Imported texts will get the standard Draft Text size, instead of the size they have in the DXF document - + If this is checked, DXF layers will be imported as Draft Layers - + Use Layers - + Hatches will be converted into simple wires - + If polylines have a width defined, they will be rendered as closed wires with correct width - + Maximum length of each of the polyline segments. If it is set to '0' the whole spline is treated as a straight segment. - + All objects containing faces will be exported as 3D polyfaces - + Drawing Views will be exported as blocks. This might fail for post DXF R12 templates. - + Exported objects will be projected to reflect the current view direction - + Method chosen for importing SVG object color to FreeCAD - + If checked, no units conversion will occur. One unit in the SVG file will translate as one millimeter. - + Style of SVG file to write when exporting a sketch - + All white lines will appear in black in the SVG for better readability against white backgrounds - + Versions of Open CASCADE older than version 6.8 don't support arc projection. In this case arcs will be discretized into small line segments. This value is the maximum segment length. - + If checked, an additional border is displayed around the grid, showing the main square size in the bottom left border - + Show grid border - + Override unit - + By leaving this field blank, the dimension measurements will be shown in the current unit defined in FreeCAD. By indicating a unit here such as m or cm, you can force new dimensions to be shown in that unit. - + The resolution to draw the patterns in. Default value is 128. Higher values give better resolutions, lower values make drawing faster - + Hatch Pattern default size - + The default size of hatch patterns - + If set, the grid will have its two main axes colored in red, green or blue when they match global axes - + Use colored axes - + Grid color and transparency - + The color of the grid - + The overall transparency of the grid @@ -2463,12 +4822,12 @@ This value is the maximum segment length. ImportDWG - + Converting: - + Conversion successful @@ -2476,345 +4835,353 @@ This value is the maximum segment length. ImportSVG - + Unknown SVG export style, switching to Translated - + The export list contains no object with a valid bounding box + + Workbench + + + Draft Snap + + + draft - + Draft Command Bar - + Toggle construction mode - + Autogroup off - + active command: - + None - + Active Draft command - + X coordinate of next point - + X - + Y - + Z - + Y coordinate of next point - + Z coordinate of next point - + Enter point - + Enter a new point with the given coordinates - + Length - + Angle - + Length of current segment - + Angle of current segment - + Radius - + Radius of Circle - + If checked, command will not finish until you press the command button again - + If checked, an OCC-style offset will be performed instead of the classic offset - + &OCC-style offset - + Sides - + Number of sides - + Offset - + Auto - + Text string to draw - + String - + Height of text - + Height - + Intercharacter spacing - + Tracking - + Full path to font file: - + Open a FileChooser for font file - + Line - + DWire - + Circle - + Center X - + Arc - + Point - + Label - + Distance - + Trim - + Pick Object - + Edit - + Global X - + Global Y - + Global Z - + Local X - + Local Y - + Local Z - + Invalid Size value. Using 200.0. - + Invalid Tracking value. Using 0. - + Please enter a text string. - + Select a Font file - + Please enter a font file. - + Autogroup: - + Faces - + Remove - + Add - + Facebinder elements - + BSpline - + BezCurve - + Copy - + The DXF import/export libraries needed by FreeCAD to handle the DXF format were not found on this system. Please either enable FreeCAD to download these libraries: @@ -2826,270 +5193,2009 @@ To enabled FreeCAD to download these libraries, answer Yes. - + Relative - + Continue - + Close - + Fill - + Exit - + Snap On/Off - + Increase snap radius - + Decrease snap radius - + Restrict X - + Restrict Y - + Restrict Z - + Select edge - + Add custom snap point - + Length mode - + Wipe - + Set Working Plane - + Cycle snap object - + Check this to lock the current angle - + Coordinates relative to last point or absolute - + Filled - + Finish - + Finishes the current drawing or editing operation - + &Undo (CTRL+Z) - + Undo the last segment - + Finishes and closes the current line - + Wipes the existing segments of this line and starts again from the last point - + Set WP - + Reorients the working plane on the last segment - + Selects an existing edge to be measured by this dimension - + If checked, objects will be copied instead of moved. Preferences -> Draft -> Global copy mode to keep this mode in next commands - + Subelement mode - + Modify subelements - + If checked, subelements will be modified instead of entire objects - + CubicBezCurve - + Top - + Front - + Side - + Current working plane - + Check this if the object should appear as filled, otherwise it will appear as wireframe. Not available if Draft preference option 'Use Part Primitives' is enabled - + Polyline - + Draft - + Toggle near snap on/off - + Create text - + Press this button to create the text object, or finish your text with two blank lines - + Center Y - + Center Z - + Offset distance - + Trim distance - + Wire - + Change default style for new objects + + + No active document. Aborting. + + + + + Object must be a closed shape + + + + + No solid object created + + + + + Faces must be coplanar to be refined + + + + + Upgrade: Unknown force method: + + + + + Found groups: closing each open object inside + + + + + Found meshes: turning into Part shapes + + + + + Found 1 solidifiable object: solidifying it + + + + + Found 2 objects: fusing them + + + + + Found object with several coplanar faces: refine them + + + + + Found 1 non-parametric objects: draftifying it + + + + + Found 1 closed sketch object: creating a face from it + + + + + Found closed wires: creating faces + + + + + Found several wires or edges: wiring them + + + + + trying: closing it + + + + + Found 1 open wire: closing it + + + + + Found 1 object: draftifying it + + + + + Found points: creating compound + + + + + Found several non-treatable objects: creating compound + + + + + Unable to upgrade these objects. + + + + + No object given + + + + + The two points are coincident + + + + + mirrored) + + + + + Found 1 block: exploding it + + + + + Found 1 multi-solids compound: exploding it + + + + + Found 1 parametric object: breaking its dependencies + + + + + Found 2 objects: subtracting them + + + + + Found several faces: splitting them + + + + + Found several objects: subtracting them from the first one + + + + + Found 1 face: extracting its wires + + + + + Found only wires: extracting their edges + + + + + No more downgrade possible + + + + + Wrong input: object not in document. + + + + + Wrong input: point object doesn't have 'Geometry', 'Links', or 'Components'. + + + + + Wrong input: must be a placement, a vector, or a rotation. + + + + + Points: + + + + + Wrong input: must be list or tuple of three points exactly. + + + + + Placement: + + + + + Wrong input: incorrect type of placement. + + + + + Wrong input: incorrect type of points. + + + + + Cannot generate shape: + + + + + Radius: + + + + + Center: + + + + + Create primitive object + + + + + Final placement: + + + + + Face: True + + + + + Support: + + + + + Map mode: + + + + + length: + + + + + Two elements are needed. + + + + + Radius is too large + + + + + Segment + + + + + Removed original objects. + + + + + Wrong input: must be a list of strings or a single string. + + + + + Circular array + + + + + Wrong input: must be a number or quantity. + + + + + Wrong input: must be an integer number. + + + + + Wrong input: must be a vector. + + + + + Polar array + + + + + Wrong input: must be a number. + + + + + This function is deprecated. Do not use this function directly. + + + + + Use one of 'make_linear_dimension', or 'make_linear_dimension_obj'. + + + + + Wrong input: object must not be a list. + + + + + Wrong input: object doesn't have a 'Shape' to measure. + + + + + Wrong input: object doesn't have at least one element in 'Vertexes' to use for measuring. + + + + + Wrong input: must be an integer. + + + + + i1: values below 1 are not allowed; will be set to 1. + + + + + Wrong input: vertex not in object. + + + + + i2: values below 1 are not allowed; will be set to the last vertex in the object. + + + + + Wrong input: object doesn't have at least one element in 'Edges' to use for measuring. + + + + + index: values below 1 are not allowed; will be set to 1. + + + + + Wrong input: index doesn't correspond to an edge in the object. + + + + + Wrong input: index doesn't correspond to a circular edge. + + + + + Wrong input: must be a string, 'radius' or 'diameter'. + + + + + Wrong input: must be a list with two angles. + + + + + Layers + + + + + Layer + + + + + Wrong input: it must be a string. + + + + + Wrong input: must be a tuple of three floats 0.0 to 1.0. + + + + + Wrong input: must be 'Solid', 'Dashed', 'Dotted', or 'Dashdot'. + + + + + Wrong input: must be a number between 0 and 100. + + + + + Wrong input: must be a list or tuple of strings, or a single string. + + + + + Wrong input: must be 'Original', 'Frenet', or 'Tangent'. + + + + + No shape found + + + + + + All Shapes must be planar + + + + + + All Shapes must be coplanar + + + + + + Internal orthogonal array + + + + + Wrong input: must be a number or vector. + + + + + Input: single value expanded to vector. + + + + + Input: number of elements must be at least 1. It is set to 1. + + + + + Orthogonal array + + + + + Orthogonal array 2D + + + + + Rectangular array + + + + + Rectangular array 2D + + + + + Wrong input: subelement not in object. + + + + + Wrong input: must be a string, 'Custom', 'Name', 'Label', 'Position', 'Length', 'Area', 'Volume', 'Tag', or 'Material'. + + + + + Wrong input: must be a string. + + + + + Wrong input: must be a string, 'Horizontal', 'Vertical', or 'Custom'. + + + + + Wrong input: must be a list of at least two vectors. + + + + + Direction is not 'Custom'; points won't be used. + + + + + Wrong input: must be a list of two elements. For example, [object, 'Edge1']. + + + + + ShapeString: string has no wires + + + + + added property 'ExtraPlacement' + + + + + , path object doesn't have 'Edges'. + + + + + 'PathObj' property will be migrated to 'PathObject' + + + + + Cannot calculate path tangent. Copy not aligned. + + + + + Tangent and normal are parallel. Copy not aligned. + + + + + Cannot calculate path normal, using default. + + + + + Cannot calculate path binormal. Copy not aligned. + + + + + AlignMode {} is not implemented + + + + + added view property 'ScaleMultiplier' + + + + + migrated 'DraftText' type to 'Text' + + + + + Activate this layer + + + + + Select layer contents + + + + + custom + + + + + Unable to convert input into a scale factor + + + + + Set custom annotation scale in format x:x, x=x + + + + + Task panel: + + + + + At least one element must be selected. + + + + + Selection is not suitable for array. + + + + + Object: + + + + + Number of elements must be at least 2. + + + + + The angle is above 360 degrees. It is set to this value to proceed. + + + + + The angle is below -360 degrees. It is set to this value to proceed. + + + + + Center reset: + + + + + Fuse: + + + + + Create Link array: + + + + + Number of elements: + + + + + Polar angle: + + + + + Center of rotation: + + + + + Aborted: + + + + + Number of layers must be at least 2. + + + + + Radial distance is zero. Resulting array may not look correct. + + + + + Radial distance is negative. It is made positive to proceed. + + + + + Tangential distance cannot be zero. + + + + + Tangential distance is negative. It is made positive to proceed. + + + + + Radial distance: + + + + + Tangential distance: + + + + + Number of circular layers: + + + + + Symmetry parameter: + + + + + Number of elements must be at least 1. + + + + + Interval X reset: + + + + + Interval Y reset: + + + + + Interval Z reset: + + + + + Number of X elements: + + + + + Interval X: + + + + + Number of Y elements: + + + + + Interval Y: + + + + + Number of Z elements: + + + + + Interval Z: + + + + + ShapeString + + + + + Default + + + + + Pick ShapeString location point: + + + + + Create ShapeString + + + + + Downgrade + + + + + Select an object to upgrade + + + + + Clone + + + + + Select an object to clone + + + + + Ellipse + + + + + Pick first point + + + + + Create Ellipse + + + + + Pick opposite point + + + + + Create Line + + + + + Create Wire + + + + + Pick next point + + + + + Unable to create a Wire from selected objects + + + + + Convert to Wire + + + + + This object does not support possible coincident points, please try again. + + + + + Active object must have more than two points/nodes + + + + + Selection is not a Knot + + + + + Endpoint of BezCurve can't be smoothed + + + + + Sketch is too complex to edit: it is suggested to use sketcher default editor + + + + + Facebinder + + + + + Select faces from existing objects + + + + + Change slope + + + + + Subelement highlight + + + + + Select an object to edit + + + + + Dimension + + + + + Create Dimension + + + + + Create Dimension (radial) + + + + + Edges don't intersect! + + + + + Drawing + + + + + The Drawing Workbench is obsolete since 0.17, consider using the TechDraw Workbench instead. + + + + + Select an object to project + + + + + Annotation style editor + + + + + Open styles file + + + + + JSON file (*.json) + + + + + Save styles file + + + + + Upgrade + + + + + Move + + + + + Select an object to move + + + + + Pick start point + + + + + Pick end point + + + + + Some subelements could not be moved. + + + + + Point array + + + + + Please select exactly two objects, the base object and the point object, before calling this command. + + + + + No active Draft Toolbar. + + + + + Construction mode + + + + + Continue mode + + + + + Toggle display mode + + + + + Convert polyline/B-spline + + + + + Main toggle snap + + + + + Midpoint snap + + + + + Perpendicular snap + + + + + Grid snap + + + + + Intersection snap + + + + + Parallel snap + + + + + Endpoint snap + + + + + Angle snap (30 and 45 degrees) + + + + + Arc center snap + + + + + Edge extension snap + + + + + Near snap + + + + + Orthogonal snap + + + + + Special point snap + + + + + Dimension display + + + + + Working plane snap + + + + + Show snap toolbar + + + + + Array + + + + + Select an object to array + + + + + Link array + + + + + Polygon + + + + + Pick center point + + + + + Pick radius + + + + + Create Polygon (Part) + + + + + Create Polygon + + + + + Mirror + + + + + Select an object to mirror + + + + + Pick start point of mirror line + + + + + Pick end point of mirror line + + + + + Create Point + + + + + Scale + + + + + Select an object to scale + + + + + Pick base point + + + + + Pick reference distance from base point + + + + + Some subelements could not be scaled. + + + + + Unable to scale object: + + + + + Unable to scale objects: + + + + + This object type cannot be scaled directly. Please use the clone method. + + + + + Pick new distance from base point + + + + + Project 2D view + + + + + Create 2D view + + + + + Bezier curve has been closed + + + + + Last point has been removed + + + + + Pick next point, or finish (A) or close (O) + + + + + Create BezCurve + + + + + Click and drag to define next knot + + + + + Click and drag to define next knot, or finish (A) or close (O) + + + + + Flip dimension + + + + + Stretch + + + + + Select an object to stretch + + + + + Pick first point of selection rectangle + + + + + Pick opposite point of selection rectangle + + + + + Pick start point of displacement + + + + + Pick end point of displacement + + + + + Turning one Rectangle into a Wire + + + + + Toggle grid + + + + + Rectangle + + + + + Create Plane + + + + + Create Rectangle + + + + + Convert Draft/Sketch + + + + + Select an object to convert. + + + + + Convert to Sketch + + + + + Convert to Draft + + + + + Heal + + + + + Pick target point + + + + + Create Label + + + + + Pick endpoint of leader line + + + + + Pick text position + + + + + Select a Draft object to edit + + + + + No edit point found for selected object + + + + + Too many objects selected, max number set to: + + + + + : this object is not editable + + + + + Path array + + + + + Please select exactly two objects, the base object and the path object, before calling this command. + + + + + Path link array + + + + + Path twisted array + + + + + Path twisted link array + + + + + Trimex + + + + + Select objects to trim or extend + + + + + Pick distance + + + + + The offset distance + + + + + The offset angle + + + + + Unable to trim these objects, only Draft wires and arcs are supported. + + + + + Unable to trim these objects, too many wires + + + + + These objects don't intersect. + + + + + Too many intersection points. + + + + + Join + + + + + Select an object to join + + + + + Join lines + + + + + Selection: + + + + + Spline has been closed + + + + + Create B-spline + + + + + Pick a face, 3 vertices or a WP Proxy to define the drawing plane + + + + + Working plane aligned to global placement of + + + + + Dir + + + + + Custom + + + + + No active command. + + + + + Finish line + + + + + Close line + + + + + Undo line + + + + + Split + + + + + Click anywhere on a line to split it. + + + + + Split line + + + + + Fillet radius + + + + + Radius of fillet + + + + + Enter radius. + + + + + Delete original objects: + + + + + Chamfer mode: + + + + + Two elements needed. + + + + + Test object + + + + + Test object removed + + + + + Fillet cannot be created + + + + + Create fillet + + + + + Pick ShapeString location point + + + + + Apply style + + + + + Change Style + + + + + Add to group + + + + + Select group + + + + + Autogroup + + + + + Add new Layer + + + + + Add to construction group + + + + + Select an object to offset + + + + + Offset only works on one object at a time. + + + + + Cannot offset this object type + + + + + Offset of Bezier curves is currently not supported + + + + + Start angle + + + + + Pick start angle + + + + + Aperture angle + + + + + Pick aperture + + + + + Create Circle (Part) + + + + + Create Circle + + + + + Create Arc (Part) + + + + + Create Arc + + + + + Pick aperture angle + + + + + Arc by 3 points + + + + + Text + + + + + Pick location point + + + + + Create Text + + + + + Rotate + + + + + Select an object to rotate + + + + + Pick rotation center + + + + + Base angle + + + + + The base angle you wish to start the rotation from + + + + + Pick base angle + + + + + Rotation + + + + + The amount of rotation you wish to perform. +The final angle will be the base angle plus this amount. + + + + + Pick rotation angle + + importOCA - + OCA error: couldn't determine character encoding - + OCA: found no data to export - + successfully exported diff --git a/src/Mod/Draft/draftfunctions/cut.py b/src/Mod/Draft/draftfunctions/cut.py index e12d85d551..47c9342ac4 100644 --- a/src/Mod/Draft/draftfunctions/cut.py +++ b/src/Mod/Draft/draftfunctions/cut.py @@ -30,7 +30,7 @@ import FreeCAD as App import draftutils.gui_utils as gui_utils -from draftutils.translate import _tr +from draftutils.translate import translate from draftutils.messages import _err @@ -54,7 +54,7 @@ def cut(object1, object2): If there is a problem and the new object can't be created. """ if not App.activeDocument(): - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return obj = App.activeDocument().addObject("Part::Cut", "Cut") diff --git a/src/Mod/Draft/draftfunctions/downgrade.py b/src/Mod/Draft/draftfunctions/downgrade.py index 75ec6e7750..49cf59b28a 100644 --- a/src/Mod/Draft/draftfunctions/downgrade.py +++ b/src/Mod/Draft/draftfunctions/downgrade.py @@ -36,7 +36,7 @@ import draftutils.gui_utils as gui_utils import draftfunctions.cut as cut from draftutils.messages import _msg -from draftutils.translate import _tr +from draftutils.translate import translate def downgrade(objects, delete=False, force=None): @@ -227,7 +227,7 @@ def downgrade(objects, delete=False, force=None): shapify = utils.shapify result = eval(force)(objects) else: - _msg(_tr("Upgrade: Unknown force method:") + " " + force) + _msg(translate("draft","Upgrade: Unknown force method:") + " " + force) result = None else: # applying transformation automatically @@ -235,7 +235,7 @@ def downgrade(objects, delete=False, force=None): if len(objects) == 1 and utils.get_type(objects[0]) == "Block": result = explode(objects[0]) if result: - _msg(_tr("Found 1 block: exploding it")) + _msg(translate("draft","Found 1 block: exploding it")) # we have one multi-solids compound object: extract its solids elif (len(objects) == 1 and hasattr(objects[0], 'Shape') @@ -243,15 +243,14 @@ def downgrade(objects, delete=False, force=None): result = splitCompounds(objects) # print(result) if result: - _msg(_tr("Found 1 multi-solids compound: exploding it")) + _msg(translate("draft","Found 1 multi-solids compound: exploding it")) # special case, we have one parametric object: we "de-parametrize" it elif (len(objects) == 1 and hasattr(objects[0], 'Shape') and hasattr(objects[0], 'Base')): result = utils.shapify(objects[0]) if result: - _msg(_tr("Found 1 parametric object: " - "breaking its dependencies")) + _msg(translate("draft","Found 1 parametric object: breaking its dependencies")) add_list.append(result) # delete_list.append(objects[0]) @@ -259,35 +258,34 @@ def downgrade(objects, delete=False, force=None): elif len(objects) == 2: result = cut2(objects) if result: - _msg(_tr("Found 2 objects: subtracting them")) + _msg(translate("draft","Found 2 objects: subtracting them")) elif len(faces) > 1: # one object with several faces: split it if len(objects) == 1: result = splitFaces(objects) if result: - _msg(_tr("Found several faces: splitting them")) + _msg(translate("draft","Found several faces: splitting them")) # several objects: remove all the faces from the first one else: result = subtr(objects) if result: - _msg(_tr("Found several objects: " - "subtracting them from the first one")) + _msg(translate("draft","Found several objects: subtracting them from the first one")) # only one face: we extract its wires elif len(faces) > 0: result = getWire(objects[0]) if result: - _msg(_tr("Found 1 face: extracting its wires")) + _msg(translate("draft","Found 1 face: extracting its wires")) # no faces: split wire into single edges elif not onlyedges: result = splitWires(objects) if result: - _msg(_tr("Found only wires: extracting their edges")) + _msg(translate("draft","Found only wires: extracting their edges")) # no result has been obtained if not result: - _msg(_tr("No more downgrade possible")) + _msg(translate("draft","No more downgrade possible")) if delete: names = [] diff --git a/src/Mod/Draft/draftfunctions/mirror.py b/src/Mod/Draft/draftfunctions/mirror.py index a58422cd7b..189e424424 100644 --- a/src/Mod/Draft/draftfunctions/mirror.py +++ b/src/Mod/Draft/draftfunctions/mirror.py @@ -37,7 +37,7 @@ import draftutils.utils as utils import draftutils.gui_utils as gui_utils from draftutils.messages import _err -from draftutils.translate import _tr +from draftutils.translate import translate if App.GuiUp: import FreeCADGui as Gui @@ -87,11 +87,11 @@ def mirror(objlist, p1, p2): utils.print_header('mirror', "Create mirror") if not objlist: - _err(_tr("No object given")) + _err(translate("draft","No object given")) return if p1 == p2: - _err(_tr("The two points are coincident")) + _err(translate("draft","The two points are coincident")) return if not isinstance(objlist, list): @@ -110,7 +110,7 @@ def mirror(objlist, p1, p2): for obj in objlist: mir = App.ActiveDocument.addObject("Part::Mirroring", "mirror") - mir.Label = obj.Label + _tr(" (mirrored)") + mir.Label = obj.Label + " (" + translate("draft","mirrored" + ")") mir.Source = obj mir.Base = p1 mir.Normal = pnorm diff --git a/src/Mod/Draft/draftfunctions/upgrade.py b/src/Mod/Draft/draftfunctions/upgrade.py index e328fe7511..d42b979026 100644 --- a/src/Mod/Draft/draftfunctions/upgrade.py +++ b/src/Mod/Draft/draftfunctions/upgrade.py @@ -41,7 +41,7 @@ import draftmake.make_wire as make_wire import draftmake.make_block as make_block from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate from draftgeoutils.geometry import is_straight_line # Delay import of module until first use because it is heavy @@ -148,9 +148,9 @@ def upgrade(objects, delete=False, force=None): delete_list.append(obj) return newobj else: - _err(_tr("Object must be a closed shape")) + _err(translate("draft","Object must be a closed shape")) else: - _err(_tr("No solid object created")) + _err(translate("draft","No solid object created")) return None def closeWire(obj): @@ -273,7 +273,7 @@ def upgrade(objects, delete=False, force=None): if not checked: coplanarity = DraftGeomUtils.is_coplanar(faces, 1e-3) if not coplanarity: - _err(_tr("Faces must be coplanar to be refined")) + _err(translate("draft","Faces must be coplanar to be refined")) return None # fuse faces @@ -429,7 +429,7 @@ def upgrade(objects, delete=False, force=None): if force in all_func: result = all_func[force](objects) else: - _msg(_tr("Upgrade: Unknown force method:") + " " + force) + _msg(translate("draft","Upgrade: Unknown force method:") + " " + force) result = None else: @@ -447,13 +447,13 @@ def upgrade(objects, delete=False, force=None): if groups: result = closeGroupWires(groups) if result: - _msg(_tr("Found groups: closing each open object inside")) + _msg(translate("draft","Found groups: closing each open object inside")) # if we have meshes, we try to turn them into shapes elif meshes: result = turnToParts(meshes) if result: - _msg(_tr("Found meshes: turning into Part shapes")) + _msg(translate("draft","Found meshes: turning into Part shapes")) # we have only faces here, no lone edges elif faces and (len(wires) + len(openwires) == len(facewires)): @@ -461,31 +461,29 @@ def upgrade(objects, delete=False, force=None): if len(objects) == 1 and len(faces) > 3 and not faces_coplanarity: result = makeSolid(objects[0]) if result: - _msg(_tr("Found 1 solidifiable object: solidifying it")) + _msg(translate("draft","Found 1 solidifiable object: solidifying it")) # we have exactly 2 objects: we fuse them elif len(objects) == 2 and not curves and not faces_coplanarity: result = makeFusion(objects[0], objects[1]) if result: - _msg(_tr("Found 2 objects: fusing them")) + _msg(translate("draft","Found 2 objects: fusing them")) # we have many separate faces: we try to make a shell or compound elif len(objects) >= 2 and len(faces) > 1 and not loneedges: result = makeShell(objects) if result: - _msg(_tr("Found several objects: creating a " + _msg(translate("draft","Found several objects: creating a " + str(result.Shape.ShapeType))) # we have faces: we try to join them if they are coplanar elif len(objects) == 1 and len(faces) > 1: result = joinFaces(objects, faces_coplanarity, True) if result: - _msg(_tr("Found object with several coplanar faces: " - "refine them")) + _msg(translate("draft","Found object with several coplanar faces: refine them")) # only one object: if not parametric, we "draftify" it elif (len(objects) == 1 and not objects[0].isDerivedFrom("Part::Part2DObjectPython")): result = ext_draftify.draftify(objects[0]) if result: - _msg(_tr("Found 1 non-parametric objects: " - "draftifying it")) + _msg(translate("draft","Found 1 non-parametric objects: draftifying it")) # in the following cases there are no faces elif not faces: @@ -496,25 +494,24 @@ def upgrade(objects, delete=False, force=None): and objects[0].isDerivedFrom("Sketcher::SketchObject")): result = makeSketchFace(objects[0]) if result: - _msg(_tr("Found 1 closed sketch object: " - "creating a face from it")) + _msg(translate("draft","Found 1 closed sketch object: creating a face from it")) # only closed wires else: result = makeFaces(objects) if result: - _msg(_tr("Found closed wires: creating faces")) + _msg(translate("draft","Found closed wires: creating faces")) # wires or edges: we try to join them elif len(objects) > 1 and len(edges) > 1: result = makeWires(objects) if result: - _msg(_tr("Found several wires or edges: wiring them")) + _msg(translate("draft","Found several wires or edges: wiring them")) # special case, we have only one open wire. We close it, # unless it has only 1 edge! elif len(objects) == 1 and len(openwires) == 1: result = closeWire(objects[0]) - _msg(_tr("trying: closing it")) + _msg(translate("draft","trying: closing it")) if result: - _msg(_tr("Found 1 open wire: closing it")) + _msg(translate("draft","Found 1 open wire: closing it")) # we have only one object that contains one edge # TODO: improve draftify function # only one object: if not parametric, we "draftify" it @@ -522,8 +519,7 @@ def upgrade(objects, delete=False, force=None): # and not objects[0].isDerivedFrom("Part::Part2DObjectPython")): # result = ext_draftify.draftify(objects[0]) # if result: - # _msg(_tr("Found 1 non-parametric objects: " - # "draftifying it")) + # _msg(translate("draft","Found 1 non-parametric objects: draftifying it")) elif (len(objects) == 1 and len(edges) == 1 and not objects[0].isDerivedFrom("Part::Part2DObjectPython")): e = objects[0].Shape.Edges[0] @@ -532,21 +528,20 @@ def upgrade(objects, delete=False, force=None): if edge_type in ("Line", "Circle"): result = ext_draftify.draftify(objects[0]) if result: - _msg(_tr("Found 1 object: draftifying it")) + _msg(translate("draft","Found 1 object: draftifying it")) # only points, no edges elif not edges and len(objects) > 1: result = makeCompound(objects) if result: - _msg(_tr("Found points: creating compound")) + _msg(translate("draft","Found points: creating compound")) # all other cases, if more than 1 object, make a compound elif len(objects) > 1: result = makeCompound(objects) if result: - _msg(_tr("Found several non-treatable objects: " - "creating compound")) + _msg(translate("draft","Found several non-treatable objects: creating compound")) # no result has been obtained if not result: - _msg(_tr("Unable to upgrade these objects.")) + _msg(translate("draft","Unable to upgrade these objects.")) if delete: names = [] diff --git a/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py b/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py index f7fa02ef8d..cc77853656 100644 --- a/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py +++ b/src/Mod/Draft/draftguitools/gui_annotationstyleeditor.py @@ -35,7 +35,7 @@ import FreeCADGui as Gui import draftguitools.gui_base as gui_base from FreeCAD import Units as U -from draftutils.translate import _tr +from draftutils.translate import translate from draftutils.utils import ANNOTATION_STYLE as DEFAULT param = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft") @@ -65,7 +65,7 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest): """ def __init__(self): - super(AnnotationStyleEditor, self).__init__(name=_tr("Annotation style editor")) + super(AnnotationStyleEditor, self).__init__(name=translate("draft","Annotation style editor")) self.doc = None self.styles = {} self.renamed = {} @@ -289,9 +289,9 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest): """imports styles from a json file""" filename = QtGui.QFileDialog.getOpenFileName( QtGui.QApplication.activeWindow(), - _tr("Open styles file"), + translate("draft","Open styles file"), None, - _tr("JSON file (*.json)")) + translate("draft","JSON file (*.json)")) if filename and filename[0]: with open(filename[0]) as f: nstyles = json.load(f) @@ -311,9 +311,9 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest): """exports styles to a json file""" filename = QtGui.QFileDialog.getSaveFileName( QtGui.QApplication.activeWindow(), - _tr("Save styles file"), + translate("draft","Save styles file"), None, - _tr("JSON file (*.json)")) + translate("draft","JSON file (*.json)")) if filename and filename[0]: with open(filename[0],"w") as f: json.dump(self.styles,f,indent=4) diff --git a/src/Mod/Draft/draftguitools/gui_arcs.py b/src/Mod/Draft/draftguitools/gui_arcs.py index 9352adb188..bb202aa1ea 100644 --- a/src/Mod/Draft/draftguitools/gui_arcs.py +++ b/src/Mod/Draft/draftguitools/gui_arcs.py @@ -45,7 +45,7 @@ import draftutils.utils as utils from FreeCAD import Units as U from draftutils.messages import _msg, _err -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -60,17 +60,15 @@ class Arc(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a circular arc by a center point and a radius.\n" - "CTRL to snap, SHIFT to constrain.") return {'Pixmap': 'Draft_Arc', 'Accel': "A, R", 'MenuText': QT_TRANSLATE_NOOP("Draft_Arc", "Arc"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Arc", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Arc", "Creates a circular arc by a center point and a radius.\nCTRL to snap, SHIFT to constrain.")} def Activated(self): """Execute when the command is called.""" - super(Arc, self).Activated(name=_tr(self.featureName)) + super(Arc, self).Activated(name=translate("draft","Arc") if self.ui: self.step = 0 self.center = None @@ -480,7 +478,7 @@ class Arc_3Points(gui_base.GuiCommandSimplest): """GuiCommand for the Draft_Arc_3Points tool.""" def __init__(self): - super(Arc_3Points, self).__init__(name=_tr("Arc by 3 points")) + super(Arc_3Points, self).__init__(name=translate("draft","Arc by 3 points")) def GetResources(self): """Set icon, menu and tooltip.""" @@ -596,11 +594,9 @@ class ArcGroup: def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Arc tools" - _tip = ("Create various types of circular arcs.") - return {'MenuText': QT_TRANSLATE_NOOP("Draft_ArcTools", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ArcTools", _tip)} + return {'MenuText': QT_TRANSLATE_NOOP("Draft_ArcTools", "Arc tools"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ArcTools", "Create various types of circular arcs.")} def GetCommands(self): """Return a tuple of commands in the group.""" diff --git a/src/Mod/Draft/draftguitools/gui_array_simple.py b/src/Mod/Draft/draftguitools/gui_array_simple.py index 3d2ddd26b2..248d287bff 100644 --- a/src/Mod/Draft/draftguitools/gui_array_simple.py +++ b/src/Mod/Draft/draftguitools/gui_array_simple.py @@ -41,7 +41,7 @@ import Draft_rc import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -63,16 +63,12 @@ class Array(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates an array from a selected object. " - "By default, it is a 2x2 orthogonal array.\n" - "Once the array is created its type can be changed " - "to polar or circular, and its properties can be modified.") return {'Pixmap': 'Draft_Array', 'MenuText': QT_TRANSLATE_NOOP("Draft_Array", "Array"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Array", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Array", "Creates an array from a selected object.\nBy default, it is a 2x2 orthogonal array.\nOnce the array is created its type can be changed\nto polar or circular, and its properties can be modified.")} - def Activated(self, name=_tr("Array")): + def Activated(self, name=translate("draft","Array")): """Execute when the command is called.""" super(Array, self).Activated(name=name) if not Gui.Selection.getSelection(): @@ -118,17 +114,14 @@ class LinkArray(Array): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Like the Array tool, but creates a 'Link array' instead.\n" - "A 'Link array' is more efficient when handling many copies " - "but the 'Fuse' option cannot be used.") return {'Pixmap': 'Draft_LinkArray', 'MenuText': QT_TRANSLATE_NOOP("Draft_LinkArray", "LinkArray"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_LinkArray", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_LinkArray", "Like the Array tool, but creates a 'Link array' instead.\nA 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used.")} def Activated(self): """Execute when the command is called.""" - super(LinkArray, self).Activated(name=_tr("Link array")) + super(LinkArray, self).Activated(name=translate("draft","Link array")) Gui.addCommand('Draft_LinkArray', LinkArray()) diff --git a/src/Mod/Draft/draftguitools/gui_arrays.py b/src/Mod/Draft/draftguitools/gui_arrays.py index fad669c793..bda4dc9a8f 100644 --- a/src/Mod/Draft/draftguitools/gui_arrays.py +++ b/src/Mod/Draft/draftguitools/gui_arrays.py @@ -60,13 +60,10 @@ class ArrayGroup: def GetResources(self): """Set icon, menu and tooltip.""" - _tooltip = ("Create various types of arrays, " - "including rectangular, polar, circular, " - "path, and point") return {'Pixmap': 'Draft_Array', 'MenuText': QT_TRANSLATE_NOOP("Draft", "Array tools"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft", _tooltip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft", "Create various types of arrays, including rectangular, polar, circular, path, and point")} def IsActive(self): """Return True when this command should be available.""" diff --git a/src/Mod/Draft/draftguitools/gui_beziers.py b/src/Mod/Draft/draftguitools/gui_beziers.py index d93a0f3c6a..044bb03615 100644 --- a/src/Mod/Draft/draftguitools/gui_beziers.py +++ b/src/Mod/Draft/draftguitools/gui_beziers.py @@ -58,15 +58,11 @@ class BezCurve(gui_lines.Line): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Bezier curve" - _tip = ("Creates an N-degree Bezier curve. " - "The more points you pick, the higher the degree.\n" - "CTRL to snap, SHIFT to constrain.") return {'Pixmap': 'Draft_BezCurve', 'Accel': "B, Z", - 'MenuText': QT_TRANSLATE_NOOP("Draft_BezCurve", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_BezCurve", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_BezCurve", "Bezier curve"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_BezCurve", "Creates an N-degree Bezier curve. The more points you pick, the higher the degree.\nCTRL to snap, SHIFT to constrain.")} def Activated(self): """Execute when the command is called. @@ -239,18 +235,13 @@ class CubicBezCurve(gui_lines.Line): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Cubic bezier curve" - _tip = ("Creates a Bezier curve made of 2nd degree (quadratic) " - "and 3rd degree (cubic) segments. " - "Click and drag to define each segment.\n" - "After the curve is created you can go back to edit " - "each control point and set the properties of each knot.\n" - "CTRL to snap, SHIFT to constrain.") + _menu = + _tip = () return {'Pixmap': 'Draft_CubicBezCurve', # 'Accel': "B, Z", - 'MenuText': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", "Cubic bezier curve"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_CubicBezCurve", "Creates a Bezier curve made of 2nd degree (quadratic) and 3rd degree (cubic) segments. Click and drag to define each segment.\nAfter the curve is created you can go back to edit each control point and set the properties of each knot.\nCTRL to snap, SHIFT to constrain.")} def Activated(self): """Execute when the command is called. @@ -481,11 +472,8 @@ class BezierGroup: def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Bezier tools" - _tip = ("Create various types of Bezier curves.") - - return {'MenuText': QT_TRANSLATE_NOOP("Draft_BezierTools", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_BezierTools", _tip)} + return {'MenuText': QT_TRANSLATE_NOOP("Draft_BezierTools", "Bezier tools"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_BezierTools", "Create various types of Bezier curves.")} def GetCommands(self): """Return a tuple of commands in the group.""" diff --git a/src/Mod/Draft/draftguitools/gui_circles.py b/src/Mod/Draft/draftguitools/gui_circles.py index 23378b2985..08b3cf507f 100644 --- a/src/Mod/Draft/draftguitools/gui_circles.py +++ b/src/Mod/Draft/draftguitools/gui_circles.py @@ -73,13 +73,11 @@ class Circle(gui_arcs.Arc): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a circle (full circular arc).\n" - "CTRL to snap, ALT to select tangent objects.") return {'Pixmap': 'Draft_Circle', 'Accel': "C, I", 'MenuText': QT_TRANSLATE_NOOP("Draft_Circle", "Circle"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Circle", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Circle", "Creates a circle (full circular arc).\nCTRL to snap, ALT to select tangent objects.")} Gui.addCommand('Draft_Circle', Circle()) diff --git a/src/Mod/Draft/draftguitools/gui_circulararray.py b/src/Mod/Draft/draftguitools/gui_circulararray.py index e98a8d0d31..cabd1c0ca8 100644 --- a/src/Mod/Draft/draftguitools/gui_circulararray.py +++ b/src/Mod/Draft/draftguitools/gui_circulararray.py @@ -37,7 +37,7 @@ import Draft_rc # include resources, icons, ui files import draftutils.todo as todo from draftutils.messages import _msg, _log -from draftutils.translate import _tr +from draftutils.translate import translate from draftguitools import gui_base from drafttaskpanels import task_circulararray @@ -61,16 +61,10 @@ class CircularArray(gui_base.GuiCommandBase): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates copies of the selected object, " - "and places the copies in a radial pattern\n" - "creating various circular layers.\n" - "\n" - "The array can be turned into an orthogonal " - "or a polar array by changing its type.") d = {'Pixmap': 'Draft_CircularArray', 'MenuText': QT_TRANSLATE_NOOP("Draft", "Circular array"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in a radial pattern\ncreating various circular layers.\n\nThe array can be turned into an orthogonal or a polar array by changing its type.")} return d def Activated(self): @@ -79,9 +73,9 @@ class CircularArray(gui_base.GuiCommandBase): We add callbacks that connect the 3D view with the widgets of the task panel. """ - _log("GuiCommand: {}".format(_tr(self.command_name))) - _msg("{}".format(16*"-")) - _msg("GuiCommand: {}".format(_tr(self.command_name))) + _log("GuiCommand: {}".format(self.command_name)) + #_msg("{}".format(16*"-")) + #_msg("GuiCommand: {}".format(self.command_name)) self.location = coin.SoLocation2Event.getClassTypeId() self.mouse_event = coin.SoMouseButtonEvent.getClassTypeId() diff --git a/src/Mod/Draft/draftguitools/gui_clone.py b/src/Mod/Draft/draftguitools/gui_clone.py index 1901c5c4e5..26797cefd3 100644 --- a/src/Mod/Draft/draftguitools/gui_clone.py +++ b/src/Mod/Draft/draftguitools/gui_clone.py @@ -49,7 +49,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils import draftutils.todo as todo from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -64,18 +64,15 @@ class Clone(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a clone of the selected objects.\n" - "The resulting clone can be scaled in each " - "of its three directions.") return {'Pixmap': 'Draft_Clone', 'Accel': "C,L", 'MenuText': QT_TRANSLATE_NOOP("Draft_Clone", "Clone"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Clone", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Clone", "Creates a clone of the selected objects.\nThe resulting clone can be scaled in each of its three directions.")} def Activated(self): """Execute when the command is called.""" - super(Clone, self).Activated(name=_tr("Clone")) + super(Clone, self).Activated(name=translate("draft","Clone")) if not Gui.Selection.getSelection(): if self.ui: self.ui.selectUi() diff --git a/src/Mod/Draft/draftguitools/gui_dimension_ops.py b/src/Mod/Draft/draftguitools/gui_dimension_ops.py index c19c75f5f3..6d6a7f96a5 100644 --- a/src/Mod/Draft/draftguitools/gui_dimension_ops.py +++ b/src/Mod/Draft/draftguitools/gui_dimension_ops.py @@ -39,7 +39,7 @@ import FreeCADGui as Gui import draftutils.utils as utils import draftguitools.gui_base as gui_base -from draftutils.translate import _tr +from draftutils.translate import translate class FlipDimension(gui_base.GuiCommandNeedsSelection): @@ -52,19 +52,16 @@ class FlipDimension(gui_base.GuiCommandNeedsSelection): """ def __init__(self): - super(Draft_FlipDimension, self).__init__(name=_tr("Flip dimension")) + super(Draft_FlipDimension, self).__init__(name=translate("draft","Flip dimension")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Flip the normal direction of the selected dimensions " - "(linear, radial, angular).\n" - "If other objects are selected they are ignored.") return {'Pixmap': 'Draft_FlipDimension', 'MenuText': QT_TRANSLATE_NOOP("Draft_FlipDimension", "Flip dimension"), 'ToolTip': QT_TRANSLATE_NOOP("Draft_FlipDimension", - _tip)} + "Flip the normal direction of the selected dimensions (linear, radial, angular).\nIf other objects are selected they are ignored.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_dimensions.py b/src/Mod/Draft/draftguitools/gui_dimensions.py index fcd4b61f2b..a4941e3915 100644 --- a/src/Mod/Draft/draftguitools/gui_dimensions.py +++ b/src/Mod/Draft/draftguitools/gui_dimensions.py @@ -77,29 +77,11 @@ class Dimension(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a dimension.\n" - "\n" - "- Pick three points to create a simple linear dimension.\n" - "- Select a straight line to create a linear dimension " - "linked to that line.\n" - "- Select an arc or circle to create a radius or diameter " - "dimension linked to that arc.\n" - "- Select two straight lines to create an angular dimension " - "between them.\n" - "CTRL to snap, SHIFT to constrain, " - "ALT to select an edge or arc.\n" - "\n" - "You may select a single line or single circular arc " - "before launching this command\n" - "to create the corresponding linked dimension.\n" - "You may also select an 'App::MeasureDistance' object " - "before launching this command\n" - "to turn it into a 'Draft Dimension' object.") return {'Pixmap': 'Draft_Dimension', 'Accel': "D, I", 'MenuText': QT_TRANSLATE_NOOP("Draft_Dimension", "Dimension"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Dimension", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Dimension", "Creates a dimension.\n\n- Pick three points to create a simple linear dimension.\n- Select a straight line to create a linear dimension linked to that line.\n- Select an arc or circle to create a radius or diameter dimension linked to that arc.\n- Select two straight lines to create an angular dimension between them.\nCTRL to snap, SHIFT to constrain, ALT to select an edge or arc.\n\nYou may select a single line or single circular arc before launching this command\nto create the corresponding linked dimension.\nYou may also select an 'App::MeasureDistance' object before launching this command\nto turn it into a 'Draft Dimension' object.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_downgrade.py b/src/Mod/Draft/draftguitools/gui_downgrade.py index dbc056165f..015717681d 100644 --- a/src/Mod/Draft/draftguitools/gui_downgrade.py +++ b/src/Mod/Draft/draftguitools/gui_downgrade.py @@ -41,7 +41,7 @@ import Draft_rc import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -52,21 +52,15 @@ class Downgrade(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Downgrades the selected objects into simpler shapes.\n" - "The result of the operation depends on the types of objects, " - "which may be able to be downgraded several times in a row.\n" - "For example, it explodes the selected polylines " - "into simpler faces, wires, and then edges. " - "It can also subtract faces.") return {'Pixmap': 'Draft_Downgrade', 'Accel': "D, N", 'MenuText': QT_TRANSLATE_NOOP("Draft_Downgrade", "Downgrade"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Downgrade", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Downgrade", "Downgrades the selected objects into simpler shapes.\nThe result of the operation depends on the types of objects, which may be able to be downgraded several times in a row.\nFor example, it explodes the selected polylines into simpler faces, wires, and then edges. It can also subtract faces.")} def Activated(self): """Execute when the command is called.""" - super(Downgrade, self).Activated(name=_tr("Downgrade")) + super(Downgrade, self).Activated(name=translate("draft","Downgrade")) if self.ui: if not Gui.Selection.getSelection(): self.ui.selectUi() diff --git a/src/Mod/Draft/draftguitools/gui_draft2sketch.py b/src/Mod/Draft/draftguitools/gui_draft2sketch.py index d5311d7dbb..2759e6e0ff 100644 --- a/src/Mod/Draft/draftguitools/gui_draft2sketch.py +++ b/src/Mod/Draft/draftguitools/gui_draft2sketch.py @@ -41,7 +41,7 @@ import Draft_rc import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -52,21 +52,14 @@ class Draft2Sketch(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Draft to Sketch" - _tip = ("Convert bidirectionally between Draft objects " - "and Sketches.\n" - "Many Draft objects will be converted into a single " - "non-constrained Sketch.\n" - "However, a single sketch with disconnected traces " - "will be converted into several individual Draft objects.") return {'Pixmap': 'Draft_Draft2Sketch', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", "Draft to Sketch"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Draft2Sketch", "Convert bidirectionally between Draft objects and Sketches.\nMany Draft objects will be converted into a single non-constrained Sketch.\nHowever, a single sketch with disconnected traces will be converted into several individual Draft objects.")} def Activated(self): """Execute when the command is called.""" - super(Draft2Sketch, self).Activated(name=_tr("Convert Draft/Sketch")) + super(Draft2Sketch, self).Activated(name=translate("draft","Convert Draft/Sketch")) if not Gui.Selection.getSelection(): if self.ui: self.ui.selectUi() diff --git a/src/Mod/Draft/draftguitools/gui_drawing.py b/src/Mod/Draft/draftguitools/gui_drawing.py index 2b4800636c..d34e3ee4e2 100644 --- a/src/Mod/Draft/draftguitools/gui_drawing.py +++ b/src/Mod/Draft/draftguitools/gui_drawing.py @@ -50,7 +50,7 @@ import draftutils.utils as utils import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg, _wrn -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -65,23 +65,16 @@ class Drawing(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a 2D projection on a Drawing Workbench page " - "from the selected objects.\n" - "This command is OBSOLETE since the Drawing Workbench " - "became obsolete in 0.17.\n" - "Use TechDraw Workbench instead for generating " - "technical drawings.") return {'Pixmap': 'Draft_Drawing', # 'Accel': "D, D", 'MenuText': QT_TRANSLATE_NOOP("Draft_Drawing", "Drawing"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Drawing", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Drawing", "Creates a 2D projection on a Drawing Workbench page from the selected objects.\nThis command is OBSOLETE since the Drawing Workbench became obsolete in 0.17.\nUse TechDraw Workbench instead for generating technical drawings.")} def Activated(self): """Execute when the command is called.""" - super(Drawing, self).Activated(name=_tr("Drawing")) - _wrn(_tr("The Drawing Workbench is obsolete since 0.17, " - "consider using the TechDraw Workbench instead.")) + super(Drawing, self).Activated(name=translate("draft","Drawing")) + _wrn(translate("draft","The Drawing Workbench is obsolete since 0.17, consider using the TechDraw Workbench instead.")) if not Gui.Selection.getSelection(): self.ghost = None self.ui.selectUi() diff --git a/src/Mod/Draft/draftguitools/gui_edit.py b/src/Mod/Draft/draftguitools/gui_edit.py index 5533e0da9a..8e7648b14a 100644 --- a/src/Mod/Draft/draftguitools/gui_edit.py +++ b/src/Mod/Draft/draftguitools/gui_edit.py @@ -270,13 +270,10 @@ class Edit(gui_base_original.Modifier): def GetResources(self): - tooltip = ("Edits the active object.\n" - "Press E or ALT+LeftClick to display context menu\n" - "on supported nodes and on supported objects.") return {'Pixmap': 'Draft_Edit', 'Accel': "D, E", 'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_Edit", "Edit"), - 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_Edit", tooltip) + 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_Edit", "Edits the active object.\nPress E or ALT+LeftClick to display context menu\non supported nodes and on supported objects.") } diff --git a/src/Mod/Draft/draftguitools/gui_ellipses.py b/src/Mod/Draft/draftguitools/gui_ellipses.py index 82014b69c1..569d66141c 100644 --- a/src/Mod/Draft/draftguitools/gui_ellipses.py +++ b/src/Mod/Draft/draftguitools/gui_ellipses.py @@ -53,12 +53,11 @@ class Ellipse(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Creates an ellipse. CTRL to snap." return {'Pixmap': 'Draft_Ellipse', 'Accel': "E, L", 'MenuText': QT_TRANSLATE_NOOP("Draft_Ellipse", "Ellipse"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Ellipse", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Ellipse", "Creates an ellipse. CTRL to snap.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_facebinders.py b/src/Mod/Draft/draftguitools/gui_facebinders.py index 7f1879c61b..7a8bf83f0c 100644 --- a/src/Mod/Draft/draftguitools/gui_facebinders.py +++ b/src/Mod/Draft/draftguitools/gui_facebinders.py @@ -43,7 +43,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -54,17 +54,16 @@ class Facebinder(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Creates a facebinder object from selected faces." d = {'Pixmap': 'Draft_Facebinder', 'Accel': "F,F", 'MenuText': QT_TRANSLATE_NOOP("Draft_Facebinder", "Facebinder"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Facebinder", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Facebinder", "Creates a facebinder object from selected faces.")} return d def Activated(self): """Execute when the command is called.""" - super(Facebinder, self).Activated(name=_tr("Facebinder")) + super(Facebinder, self).Activated(name=translate("draft","Facebinder")) if not Gui.Selection.getSelection(): if self.ui: diff --git a/src/Mod/Draft/draftguitools/gui_fillets.py b/src/Mod/Draft/draftguitools/gui_fillets.py index 9da0afe9f4..c4a13b0f81 100644 --- a/src/Mod/Draft/draftguitools/gui_fillets.py +++ b/src/Mod/Draft/draftguitools/gui_fillets.py @@ -44,7 +44,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg, _err -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -58,12 +58,11 @@ class Fillet(gui_base_original.Creator): self.featureName = "Fillet" def GetResources(self): - """Set icon, menu and tooltip.""" - _tip = "Creates a fillet between two selected wires or edges." + """Set icon, menu and tooltip.""" return {'Pixmap': 'Draft_Fillet', 'MenuText': QT_TRANSLATE_NOOP("Draft", "Fillet"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates a fillet between two selected wires or edges.")} def Activated(self, name=translate("Draft", "Fillet")): """Execute when the command is called.""" @@ -110,7 +109,7 @@ class Fillet(gui_base_original.Creator): # self.linetrack = trackers.lineTracker(dotted=True) # self.arctrack = trackers.arcTracker() # self.call = self.view.addEventCallback("SoEvent", self.action) - _msg(_tr("Enter radius.")) + _msg(translate("draft","Enter radius.")) def action(self, arg): """Scene event handler. CURRENTLY NOT USED. @@ -129,12 +128,12 @@ class Fillet(gui_base_original.Creator): def set_delete(self): """Execute as a callback when the delete checkbox changes.""" self.delete = self.ui.check_delete.isChecked() - _msg(_tr("Delete original objects: ") + str(self.delete)) + _msg(translate("draft","Delete original objects:") + " " + str(self.delete)) def set_chamfer(self): """Execute as a callback when the chamfer checkbox changes.""" self.chamfer = self.ui.check_chamfer.isChecked() - _msg(_tr("Chamfer mode: ") + str(self.chamfer)) + _msg(translate("draft","Chamfer mode:") + " " + str(self.chamfer)) def numericRadius(self, rad): """Validate the entry radius in the user interface. @@ -151,7 +150,7 @@ class Fillet(gui_base_original.Creator): wires = Gui.Selection.getSelection() if not wires or len(wires) != 2: - _err(_tr("Two elements needed.")) + _err(translate("draft","Two elements needed.")) return for o in wires: diff --git a/src/Mod/Draft/draftguitools/gui_grid.py b/src/Mod/Draft/draftguitools/gui_grid.py index d74d0bfdef..835a98cd2d 100644 --- a/src/Mod/Draft/draftguitools/gui_grid.py +++ b/src/Mod/Draft/draftguitools/gui_grid.py @@ -34,7 +34,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCADGui as Gui import draftguitools.gui_base as gui_base -from draftutils.translate import _tr +from draftutils.translate import translate class ToggleGrid(gui_base.GuiCommandSimplest): @@ -48,18 +48,15 @@ class ToggleGrid(gui_base.GuiCommandSimplest): """ def __init__(self): - super(ToggleGrid, self).__init__(name=_tr("Toggle grid")) + super(ToggleGrid, self).__init__(name=translate("draft","Toggle grid")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Toggles the Draft grid on and off." d = {'Pixmap': 'Draft_Grid', 'Accel': "G,R", - 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleGrid", - "Toggle grid"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleGrid", - _tip), + 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleGrid","Toggle grid"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleGrid","Toggles the Draft grid on and off."), 'CmdType': 'ForEdit'} return d diff --git a/src/Mod/Draft/draftguitools/gui_groups.py b/src/Mod/Draft/draftguitools/gui_groups.py index d580ce4e68..7e1039e450 100644 --- a/src/Mod/Draft/draftguitools/gui_groups.py +++ b/src/Mod/Draft/draftguitools/gui_groups.py @@ -44,7 +44,7 @@ import draftutils.utils as utils import draftutils.groups as groups import draftguitools.gui_base as gui_base -from draftutils.translate import _tr, translate +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -61,21 +61,16 @@ class AddToGroup(gui_base.GuiCommandNeedsSelection): """ def __init__(self): - super(AddToGroup, self).__init__(name=_tr("Add to group")) - self.ungroup = QT_TRANSLATE_NOOP("Draft_AddToGroup", - "Ungroup") + super(AddToGroup, self).__init__(name=translate("draft","Add to group")) + self.ungroup = QT_TRANSLATE_NOOP("Draft_AddToGroup","Ungroup") def GetResources(self): """Set icon, menu and tooltip.""" - _tooltip = ("Moves the selected objects to an existing group, " - "or removes them from any group.\n" - "Create a group first to use this tool.") + _tooltip = () d = {'Pixmap': 'Draft_AddToGroup', - 'MenuText': QT_TRANSLATE_NOOP("Draft_AddToGroup", - "Move to group")+"...", - 'ToolTip': QT_TRANSLATE_NOOP("Draft_AddToGroup", - _tooltip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_AddToGroup","Move to group")+"...", + 'ToolTip': QT_TRANSLATE_NOOP("Draft_AddToGroup","Moves the selected objects to an existing group, or removes them from any group.\nCreate a group first to use this tool.")} return d def Activated(self): @@ -161,24 +156,14 @@ class SelectGroup(gui_base.GuiCommandNeedsSelection): """ def __init__(self): - super(SelectGroup, self).__init__(name=_tr("Select group")) + super(SelectGroup, self).__init__(name=translate("draft","Select group")) def GetResources(self): """Set icon, menu and tooltip.""" - _tooltip = ("If the selection is a group, it selects all objects " - "that are inside this group, including those in " - "nested sub-groups.\n" - "\n" - "If the selection is a simple object inside a group, " - 'it will select the "brother" objects, that is,\n' - "those that are at the same level as this object, " - "including the upper group that contains them all.") d = {'Pixmap': 'Draft_SelectGroup', - 'MenuText': QT_TRANSLATE_NOOP("Draft_SelectGroup", - "Select group"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectGroup", - _tooltip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_SelectGroup","Select group"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectGroup","If the selection is a group, it selects all objects that are inside this group, including those in nested sub-groups.\n\nIf the selection is a simple object inside a group, it will select the "brother" objects, that is,\nthose that are at the same level as this object, including the upper group that contains them all.")} return d def Activated(self): @@ -244,15 +229,14 @@ class SetAutoGroup(gui_base.GuiCommandSimplest): """GuiCommand for the Draft_AutoGroup tool.""" def __init__(self): - super(SetAutoGroup, self).__init__(name=_tr("Autogroup")) + super(SetAutoGroup, self).__init__(name=translate("draft","Autogroup")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Select a group to add all Draft and Arch objects to." return {'Pixmap': 'Draft_AutoGroup', 'MenuText': QT_TRANSLATE_NOOP("Draft_AutoGroup", "Autogroup"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_AutoGroup", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_AutoGroup", "Select a group to add all Draft and Arch objects to.")} def Activated(self): """Execute when the command is called. @@ -349,18 +333,14 @@ class AddToConstruction(gui_base.GuiCommandSimplest): """ def __init__(self): - super(AddToConstruction, self).__init__(name=_tr("Add to construction group")) + super(AddToConstruction, self).__init__(name=translate("draft","Add to construction group")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Add to Construction group" - _tip = ("Adds the selected objects to the construction group,\n" - "and changes their appearance to the construction style.\n" - "It creates a construction group if it doesn't exist.") d = {'Pixmap': 'Draft_AddConstruction', - 'MenuText': QT_TRANSLATE_NOOP("Draft_AddConstruction", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_AddConstruction", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_AddConstruction", "Add to Construction group"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_AddConstruction", "Adds the selected objects to the construction group,\nand changes their appearance to the construction style.\nIt creates a construction group if it doesn't exist.")} return d def Activated(self): diff --git a/src/Mod/Draft/draftguitools/gui_heal.py b/src/Mod/Draft/draftguitools/gui_heal.py index 6849019dd5..e05c33bc04 100644 --- a/src/Mod/Draft/draftguitools/gui_heal.py +++ b/src/Mod/Draft/draftguitools/gui_heal.py @@ -35,7 +35,7 @@ import FreeCADGui as Gui import Draft import draftguitools.gui_base as gui_base -from draftutils.translate import _tr +from draftutils.translate import translate class Heal(gui_base.GuiCommandSimplest): @@ -48,20 +48,15 @@ class Heal(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Heal, self).__init__(name=_tr("Heal")) + super(Heal, self).__init__(name=translate("draft","Heal")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Heal faulty Draft objects saved with an earlier version " - "of the program.\n" - "If an object is selected it will try to heal that object " - "in particular,\n" - "otherwise it will try to heal all objects " - "in the active document.") + _tip = () return {'Pixmap': 'Draft_Heal', 'MenuText': QT_TRANSLATE_NOOP("Draft_Heal", "Heal"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Heal", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Heal", "Heal faulty Draft objects saved with an earlier version of the program.\nIf an object is selected it will try to heal that object in particular,\notherwise it will try to heal all objects in the active document.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_join.py b/src/Mod/Draft/draftguitools/gui_join.py index 62cfcb5919..ce2b6a4119 100644 --- a/src/Mod/Draft/draftguitools/gui_join.py +++ b/src/Mod/Draft/draftguitools/gui_join.py @@ -49,7 +49,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -60,19 +60,15 @@ class Join(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Joins the selected lines or polylines " - "into a single object.\n" - "The lines must share a common point at the start " - "or at the end for the operation to succeed.") return {'Pixmap': 'Draft_Join', 'Accel': "J, O", 'MenuText': QT_TRANSLATE_NOOP("Draft_Join", "Join"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Join", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Join", "Joins the selected lines or polylines into a single object.\nThe lines must share a common point at the start or at the end for the operation to succeed.")} def Activated(self): """Execute when the command is called.""" - super(Join, self).Activated(name=_tr("Join")) + super(Join, self).Activated(name=translate("draft","Join")) if not self.ui: return if not Gui.Selection.getSelection(): @@ -111,7 +107,7 @@ class Join(gui_base_original.Modifier): labels.append(obj.Label) labels = ", ".join(labels) - _msg(_tr("Selection:") + " {}".format(labels)) + _msg(translate("draft","Selection:") + " {}".format(labels)) Gui.addCommand('Draft_Join', Join()) diff --git a/src/Mod/Draft/draftguitools/gui_labels.py b/src/Mod/Draft/draftguitools/gui_labels.py index d3d0e6e8f2..0e6145a71c 100644 --- a/src/Mod/Draft/draftguitools/gui_labels.py +++ b/src/Mod/Draft/draftguitools/gui_labels.py @@ -58,25 +58,11 @@ class Label(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a label, " - "optionally attached to a selected object or subelement.\n" - "\n" - "First select a vertex, an edge, or a face of an object, " - "then call this command,\n" - "and then set the position of the leader line " - "and the textual label.\n" - "The label will be able to display information " - "about this object, and about the selected subelement,\n" - "if any.\n" - "\n" - "If many objects or many subelements are selected, " - "only the first one in each case\n" - "will be used to provide information to the label.") return {'Pixmap': 'Draft_Label', 'Accel': "D, L", 'MenuText': QT_TRANSLATE_NOOP("Draft_Label", "Label"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Label", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Label", "Creates a label, optionally attached to a selected object or subelement.\n\nFirst select a vertex, an edge, or a face of an object, then call this command,\nand then set the position of the leader line and the textual label.\nThe label will be able to display information about this object, and about the selected subelement,\nif any.\n\nIf many objects or many subelements are selected, only the first one in each case\nwill be used to provide information to the label.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_layers.py b/src/Mod/Draft/draftguitools/gui_layers.py index aff58f1d0b..ab66fa7347 100644 --- a/src/Mod/Draft/draftguitools/gui_layers.py +++ b/src/Mod/Draft/draftguitools/gui_layers.py @@ -34,7 +34,7 @@ import FreeCADGui as Gui import Draft_rc import draftguitools.gui_base as gui_base -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) bool(Draft_rc.__name__) @@ -44,18 +44,13 @@ class Layer(gui_base.GuiCommandSimplest): """GuiCommand to create a Layer object in the document.""" def __init__(self): - super(Layer, self).__init__(name=_tr("Layer")) + super(Layer, self).__init__(name=translate("draft","Layer")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = QT_TRANSLATE_NOOP("Draft_Layer", - "Adds a layer to the document.\n" - "Objects added to this layer can share " - "the same visual properties such as " - "line color, line width, and shape color.") return {'Pixmap': 'Draft_Layer', 'MenuText': QT_TRANSLATE_NOOP("Draft_Layer", "Layer"), - 'ToolTip': _tip} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Layer", "Adds a layer to the document.\nObjects added to this layer can share the same visual properties such as line color, line width, and shape color.")} def Activated(self): """Execute when the command is called. diff --git a/src/Mod/Draft/draftguitools/gui_line_add_delete.py b/src/Mod/Draft/draftguitools/gui_line_add_delete.py index 479bbee781..53aec152e2 100644 --- a/src/Mod/Draft/draftguitools/gui_line_add_delete.py +++ b/src/Mod/Draft/draftguitools/gui_line_add_delete.py @@ -52,12 +52,10 @@ class AddPoint(DraftTools.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Add point" - _tip = "Adds a point to an existing Wire or B-spline." return {'Pixmap': 'Draft_AddPoint', - 'MenuText': QT_TRANSLATE_NOOP("Draft_AddPoint", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_AddPoint", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_AddPoint", "Add point"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_AddPoint", "Adds a point to an existing Wire or B-spline.")} def IsActive(self): """Return True when there is selection and the command is active.""" @@ -86,12 +84,10 @@ class DelPoint(DraftTools.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Remove point" - _tip = "Removes a point from an existing Wire or B-spline." return {'Pixmap': 'Draft_DelPoint', - 'MenuText': QT_TRANSLATE_NOOP("Draft_DelPoint", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_DelPoint", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_DelPoint", "Remove point"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_DelPoint", "Removes a point from an existing Wire or B-spline.")} def IsActive(self): """Return True when there is selection and the command is active.""" diff --git a/src/Mod/Draft/draftguitools/gui_lineops.py b/src/Mod/Draft/draftguitools/gui_lineops.py index eeb5b41933..afa9f7722b 100644 --- a/src/Mod/Draft/draftguitools/gui_lineops.py +++ b/src/Mod/Draft/draftguitools/gui_lineops.py @@ -41,7 +41,7 @@ import Draft_rc import draftguitools.gui_base as gui_base from draftutils.messages import _msg -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -70,7 +70,7 @@ class LineAction(gui_base.GuiCommandSimplest): if hasattr(App, "activeDraftCommand"): _command = App.activeDraftCommand else: - _msg(_tr("No active command.")) + _msg(translate("draft","No active command.")) return if (_command is not None @@ -89,15 +89,14 @@ class FinishLine(LineAction): """GuiCommand to finish any running line drawing operation.""" def __init__(self): - super(FinishLine, self).__init__(name=_tr("Finish line")) + super(FinishLine, self).__init__(name=translate("draft","Finish line")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Finishes a line without closing it." d = {'Pixmap': 'Draft_Finish', 'MenuText': QT_TRANSLATE_NOOP("Draft_FinishLine", "Finish line"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_FinishLine", _tip), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_FinishLine", "Finishes a line without closing it."), 'CmdType': 'ForEdit'} return d @@ -116,15 +115,14 @@ class CloseLine(LineAction): """GuiCommand to close the line being drawn and finish the operation.""" def __init__(self): - super(CloseLine, self).__init__(name=_tr("Close line")) + super(CloseLine, self).__init__(name=translate("draft","Close line")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Closes the line being drawn, and finishes the operation." d = {'Pixmap': 'Draft_Lock', 'MenuText': QT_TRANSLATE_NOOP("Draft_CloseLine", "Close Line"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_CloseLine", _tip), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_CloseLine", "Closes the line being drawn, and finishes the operation."), 'CmdType': 'ForEdit'} return d @@ -143,16 +141,15 @@ class UndoLine(LineAction): """GuiCommand to undo the last drawn segment of a line.""" def __init__(self): - super(UndoLine, self).__init__(name=_tr("Undo line")) + super(UndoLine, self).__init__(name=translate("draft","Undo line")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Undoes the last drawn segment of the line being drawn." d = {'Pixmap': 'Draft_Rotate', 'MenuText': QT_TRANSLATE_NOOP("Draft_UndoLine", "Undo last segment"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_UndoLine", _tip), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_UndoLine", "Undoes the last drawn segment of the line being drawn."), 'CmdType': 'ForEdit'} return d diff --git a/src/Mod/Draft/draftguitools/gui_lines.py b/src/Mod/Draft/draftguitools/gui_lines.py index eba740fb45..f2be94a84a 100644 --- a/src/Mod/Draft/draftguitools/gui_lines.py +++ b/src/Mod/Draft/draftguitools/gui_lines.py @@ -58,12 +58,11 @@ class Line(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Creates a 2-point line. CTRL to snap, SHIFT to constrain." return {'Pixmap': 'Draft_Line', 'Accel': "L,I", 'MenuText': QT_TRANSLATE_NOOP("Draft_Line", "Line"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Line", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Line", "Creates a 2-point line. CTRL to snap, SHIFT to constrain.")} def Activated(self, name=translate("draft", "Line")): """Execute when the command is called.""" @@ -307,13 +306,11 @@ class Wire(Line): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a multiple-points line (polyline). " - "CTRL to snap, SHIFT to constrain.") return {'Pixmap': 'Draft_Wire', 'Accel': "P, L", 'MenuText': QT_TRANSLATE_NOOP("Draft_Wire", "Polyline"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Wire", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Wire", "Creates a multiple-points line (polyline). CTRL to snap, SHIFT to constrain.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_lineslope.py b/src/Mod/Draft/draftguitools/gui_lineslope.py index 3ce7f31329..443b2a1d02 100644 --- a/src/Mod/Draft/draftguitools/gui_lineslope.py +++ b/src/Mod/Draft/draftguitools/gui_lineslope.py @@ -42,7 +42,7 @@ import Draft_rc import draftutils.utils as utils import draftguitools.gui_base as gui_base -from draftutils.translate import _tr, translate +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -61,23 +61,14 @@ class LineSlope(gui_base.GuiCommandNeedsSelection): """ def __init__(self): - super(LineSlope, self).__init__(name=_tr("Change slope")) + super(LineSlope, self).__init__(name=translate("draft","Change slope")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Set slope" - _tip = ("Sets the slope of the selected line " - "by changing the value of the Z value of one of its points.\n" - "If a polyline is selected, it will apply the slope " - "transformation to each of its segments.\n\n" - "The slope will always change the Z value, therefore " - "this command only works well for\n" - "straight Draft lines that are drawn in the XY plane. " - "Selected objects that aren't single lines will be ignored.") return {'Pixmap': 'Draft_Slope', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Slope", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Slope", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Slope", "Set slope"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Slope", "Sets the slope of the selected line by changing the value of the Z value of one of its points.\nIf a polyline is selected, it will apply the slope transformation to each of its segments.\n\nThe slope will always change the Z value, therefore this command only works well for\nstraight Draft lines that are drawn in the XY plane. Selected objects that aren't single lines will be ignored.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_mirror.py b/src/Mod/Draft/draftguitools/gui_mirror.py index 7691a7df66..18afa9c9f7 100644 --- a/src/Mod/Draft/draftguitools/gui_mirror.py +++ b/src/Mod/Draft/draftguitools/gui_mirror.py @@ -57,13 +57,11 @@ class Mirror(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Mirrors the selected objects along a line " - "defined by two points.") return {'Pixmap': 'Draft_Mirror', 'Accel': "M, I", 'MenuText': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirror"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Mirror", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Mirror", "Mirrors the selected objects along a line defined by two points.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_move.py b/src/Mod/Draft/draftguitools/gui_move.py index 8c7458bb27..ccccbd5876 100644 --- a/src/Mod/Draft/draftguitools/gui_move.py +++ b/src/Mod/Draft/draftguitools/gui_move.py @@ -57,16 +57,11 @@ class Move(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Moves the selected objects from one base point " - "to another point.\n" - 'If the "copy" option is active, it will create ' - "displaced copies.\n" - "CTRL to snap, SHIFT to constrain.") return {'Pixmap': 'Draft_Move', 'Accel': "M, V", 'MenuText': QT_TRANSLATE_NOOP("Draft_Move", "Move"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Move", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Move", "Moves the selected objects from one base point to another point.\nIf the \"copy\" option is active, it will create displaced copies.\nCTRL to snap, SHIFT to constrain.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_offset.py b/src/Mod/Draft/draftguitools/gui_offset.py index 86e21b044d..50f8c928f4 100644 --- a/src/Mod/Draft/draftguitools/gui_offset.py +++ b/src/Mod/Draft/draftguitools/gui_offset.py @@ -46,7 +46,7 @@ import draftguitools.gui_tool_utils as gui_tool_utils import draftguitools.gui_trackers as trackers from draftutils.messages import _msg, _wrn, _err -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -57,20 +57,16 @@ class Offset(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Offsets of the selected object.\n" - "It can also create an offset copy of the original object.\n" - "CTRL to snap, SHIFT to constrain. " - "Hold ALT and click to create a copy with each click.") return {'Pixmap': 'Draft_Offset', 'Accel': "O, S", 'MenuText': QT_TRANSLATE_NOOP("Draft_Offset", "Offset"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Offset", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Offset", "Offsets of the selected object.\nIt can also create an offset copy of the original object.\nCTRL to snap, SHIFT to constrain. Hold ALT and click to create a copy with each click.")} def Activated(self): """Execute when the command is called.""" self.running = False - super(Offset, self).Activated(name=_tr("Offset")) + super(Offset, self).Activated(name=translate("draft","Offset")) self.ghost = None self.linetrack = None self.arctrack = None @@ -327,9 +323,7 @@ class Offset(gui_base_original.Modifier): self.finish() else: _err(translate("Draft", - "Offset direction is not defined. " - "Please move the mouse on either side " - "of the object first to indicate a direction")) + "Offset direction is not defined. Please move the mouse on either side of the object first to indicate a direction")) Gui.addCommand('Draft_Offset', Offset()) diff --git a/src/Mod/Draft/draftguitools/gui_orthoarray.py b/src/Mod/Draft/draftguitools/gui_orthoarray.py index 19ba415c8c..c85e737d65 100644 --- a/src/Mod/Draft/draftguitools/gui_orthoarray.py +++ b/src/Mod/Draft/draftguitools/gui_orthoarray.py @@ -37,7 +37,7 @@ import Draft_rc # include resources, icons, ui files import draftutils.todo as todo from draftutils.messages import _msg, _log -from draftutils.translate import _tr +from draftutils.translate import translate from draftguitools import gui_base from drafttaskpanels import task_orthoarray @@ -61,17 +61,10 @@ class OrthoArray(gui_base.GuiCommandBase): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates copies of the selected object, " - "and places the copies in an orthogonal pattern,\n" - "meaning the copies follow the specified direction " - "in the X, Y, Z axes.\n" - "\n" - "The array can be turned into a polar or a circular array " - "by changing its type.") d = {'Pixmap': 'Draft_Array', 'MenuText': QT_TRANSLATE_NOOP("Draft", "Array"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in an orthogonal pattern,\nmeaning the copies follow the specified direction in the X, Y, Z axes.\n\nThe array can be turned into a polar or a circular array by changing its type.")} return d def Activated(self): @@ -80,9 +73,9 @@ class OrthoArray(gui_base.GuiCommandBase): We add callbacks that connect the 3D view with the widgets of the task panel. """ - _log("GuiCommand: {}".format(_tr(self.command_name))) - _msg("{}".format(16*"-")) - _msg("GuiCommand: {}".format(_tr(self.command_name))) + _log("GuiCommand: {}".format(_self.command_name)) + #_msg("{}".format(16*"-")) + #_msg("GuiCommand: {}".format(self.command_name)) # self.location = coin.SoLocation2Event.getClassTypeId() self.mouse_event = coin.SoMouseButtonEvent.getClassTypeId() diff --git a/src/Mod/Draft/draftguitools/gui_patharray.py b/src/Mod/Draft/draftguitools/gui_patharray.py index 15a3d32448..3c061832ef 100644 --- a/src/Mod/Draft/draftguitools/gui_patharray.py +++ b/src/Mod/Draft/draftguitools/gui_patharray.py @@ -45,7 +45,7 @@ import DraftVecUtils import draftguitools.gui_base_original as gui_base_original from draftutils.messages import _err -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -68,18 +68,12 @@ class PathArray(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Path array" - _tip = ("Creates copies of the selected object " - "along a selected path.\n" - "First select the object, and then select the path.\n" - "The path can be a polyline, B-spline, Bezier curve, " - "or even edges from other objects.") return {'Pixmap': 'Draft_PathArray', - 'MenuText': QT_TRANSLATE_NOOP("Draft_PathArray", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathArray", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_PathArray", "Path array"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathArray", "Creates copies of the selected object along a selected path.\nFirst select the object, and then select the path.\nThe path can be a polyline, B-spline, Bezier curve, or even edges from other objects.")} - def Activated(self, name=_tr("Path array")): + def Activated(self, name=translate("draft","Path array")): """Execute when the command is called.""" super(PathArray, self).Activated(name=name) self.name = name @@ -105,9 +99,7 @@ class PathArray(gui_base_original.Modifier): """Proceed with the command if one object was selected.""" sel = Gui.Selection.getSelectionEx() if len(sel) != 2: - _err(_tr("Please select exactly two objects, " - "the base object and the path object, " - "before calling this command.")) + _err(translate("draft","Please select exactly two objects, the base object and the path object, before calling this command.")) else: base_object = sel[0].Object path_object = sel[1].Object @@ -148,7 +140,7 @@ class PathArray(gui_base_original.Modifier): _cmd_list = ["_obj_ = " + _cmd, "Draft.autogroup(_obj_)", "App.ActiveDocument.recompute()"] - self.commit(_tr(self.name), _cmd_list) + self.commit(translate("draft","Path array"), _cmd_list) # Commit the transaction and execute the commands # through the parent class @@ -166,19 +158,14 @@ class PathLinkArray(PathArray): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Path Link array" - _tip = ("Like the PathArray tool, but creates a 'Link array' " - "instead.\n" - "A 'Link array' is more efficient when handling many copies " - "but the 'Fuse' option cannot be used.") return {'Pixmap': 'Draft_PathLinkArray', - 'MenuText': QT_TRANSLATE_NOOP("Draft_PathLinkArray", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathLinkArray", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_PathLinkArray", "Path Link array"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathLinkArray", "Like the PathArray tool, but creates a 'Link array' instead.\nA 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used.")} def Activated(self): """Execute when the command is called.""" - super(PathLinkArray, self).Activated(name=_tr("Path link array")) + super(PathLinkArray, self).Activated(name=translate("draft","Path link array")) Gui.addCommand('Draft_PathLinkArray', PathLinkArray()) diff --git a/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py b/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py index daf0e81660..27d0943a7b 100644 --- a/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py +++ b/src/Mod/Draft/draftguitools/gui_pathtwistedarray.py @@ -38,7 +38,7 @@ import Draft_rc import draftguitools.gui_base_original as gui_base_original from draftutils.messages import _err -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -61,18 +61,12 @@ class PathTwistedArray(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Path twisted array" - _tip = ("Creates copies of the selected object " - "along a selected path, and twists the copies.\n" - "First select the object, and then select the path.\n" - "The path can be a polyline, B-spline, Bezier curve, " - "or even edges from other objects.") return {'Pixmap': 'Draft_PathTwistedArray', - 'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", "Path twisted array"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedArray", "Creates copies of the selected object along a selected path, and twists the copies.\nFirst select the object, and then select the path.\nThe path can be a polyline, B-spline, Bezier curve, or even edges from other objects.")} - def Activated(self, name=_tr("Path twisted array")): + def Activated(self, name=translate("draft","Path twisted array")): """Execute when the command is called.""" super(PathTwistedArray, self).Activated(name=name) self.name = name @@ -82,9 +76,7 @@ class PathTwistedArray(gui_base_original.Modifier): """Proceed with the command if one object was selected.""" sel = Gui.Selection.getSelectionEx() if len(sel) != 2: - _err(_tr("Please select exactly two objects, " - "the base object and the path object, " - "before calling this command.")) + _err(translate("draft","Please select exactly two objects, the base object and the path object, before calling this command.")) else: base_object = sel[0].Object path_object = sel[1].Object @@ -106,7 +98,7 @@ class PathTwistedArray(gui_base_original.Modifier): _cmd_list = ["_obj_ = " + _cmd, "Draft.autogroup(_obj_)", "App.ActiveDocument.recompute()"] - self.commit(_tr(self.name), _cmd_list) + self.commit(translate("draft","Path twisted array"), _cmd_list) # Commit the transaction and execute the commands # through the parent class @@ -124,22 +116,15 @@ class PathTwistedLinkArray(PathTwistedArray): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Path twisted Link array" - _tip = ("Like the PathTwistedArray tool, but creates a 'Link array' " - "instead.\n" - "A 'Link array' is more efficient when handling many copies " - "but the 'Fuse' option cannot be used.") return {'Pixmap': 'Draft_PathTwistedLinkArray', - 'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Path twisted Link array"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_PathTwistedLinkArray","Like the PathTwistedArray tool, but creates a 'Link array' instead.\nA 'Link array' is more efficient when handling many copies but the 'Fuse' option cannot be used.")} def Activated(self): """Execute when the command is called.""" super(PathTwistedLinkArray, - self).Activated(name=_tr("Path twisted link array")) + self).Activated(name=translate("draft","Path twisted link array")) Gui.addCommand('Draft_PathTwistedLinkArray', PathTwistedLinkArray()) diff --git a/src/Mod/Draft/draftguitools/gui_planeproxy.py b/src/Mod/Draft/draftguitools/gui_planeproxy.py index f3df16d97c..4615819136 100644 --- a/src/Mod/Draft/draftguitools/gui_planeproxy.py +++ b/src/Mod/Draft/draftguitools/gui_planeproxy.py @@ -45,17 +45,10 @@ class Draft_WorkingPlaneProxy: def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Create working plane proxy" - _tip = ("Creates a proxy object from the current working plane.\n" - "Once the object is created double click it in the tree view " - "to restore the camera position and objects' visibilities.\n" - "Then you can use it to save a different camera position " - "and objects' states any time you need.") + d = {'Pixmap': 'Draft_PlaneProxy', - 'MenuText': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy","Create working plane proxy"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_SetWorkingPlaneProxy","Creates a proxy object from the current working plane.\nOnce the object is created double click it in the tree view to restore the camera position and objects' visibilities.\nThen you can use it to save a different camera position and objects' states any time you need.")} return d def IsActive(self): diff --git a/src/Mod/Draft/draftguitools/gui_pointarray.py b/src/Mod/Draft/draftguitools/gui_pointarray.py index 7057afeb6c..c6488f623c 100644 --- a/src/Mod/Draft/draftguitools/gui_pointarray.py +++ b/src/Mod/Draft/draftguitools/gui_pointarray.py @@ -49,7 +49,7 @@ import Draft_rc import draftguitools.gui_base_original as gui_base_original from draftutils.messages import _err -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -71,28 +71,15 @@ class PointArray(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Point array" - _tip = ("Creates copies of the selected object, " - "and places the copies at the position of various points.\n" - "\n" - "The points need to be grouped under a compound of points " - "before using this tool.\n" - "To create this compound, select various points " - "and then use the Part Compound tool,\n" - "or use the Draft Upgrade tool to create a 'Block', " - "or create a Sketch and add simple points to it.\n" - "\n" - "Select the base object, and then select the compound " - "or the sketch to create the point array.") return {'Pixmap': 'Draft_PointArray', - 'MenuText': QT_TRANSLATE_NOOP("Draft_PointArray", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_PointArray", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_PointArray", "Point array"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_PointArray", "Creates copies of the selected object, and places the copies at the position of various points.\n\nThe points need to be grouped under a compound of points before using this tool.\nTo create this compound, select various points and then use the Part Compound tool,\nor use the Draft Upgrade tool to create a 'Block', or create a Sketch and add simple points to it.\n\nSelect the base object, and then select the compound or the sketch to create the point array.")} def Activated(self, name="Point array"): """Execute when the command is called.""" self.name = name - super(PointArray, self).Activated(name=_tr(self.name)) + super(PointArray, self).Activated(name=translate("draft","Point array")) # This was deactivated because it doesn't work correctly; # the selection needs to be made on two objects, but currently # it only selects one. @@ -115,9 +102,7 @@ class PointArray(gui_base_original.Modifier): """Proceed with the command if one object was selected.""" sel = Gui.Selection.getSelectionEx() if len(sel) != 2: - _err(_tr("Please select exactly two objects, " - "the base object and the point object, " - "before calling this command.")) + _err(translate("draft","Please select exactly two objects, the base object and the point object, before calling this command.")) else: base_object = sel[0].Object point_object = sel[1].Object @@ -135,7 +120,7 @@ class PointArray(gui_base_original.Modifier): _cmd_list = ["_obj_ = " + _cmd, "Draft.autogroup(_obj_)", "App.ActiveDocument.recompute()"] - self.commit(_tr(self.name), _cmd_list) + self.commit(translate("draft","Point array"), _cmd_list) # Commit the transaction and execute the commands # through the parent class @@ -152,12 +137,10 @@ class PointLinkArray(PointArray): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Like the PointArray tool, but creates a 'Point link array' instead.\n" - "A 'Point link array' is more efficient when handling many copies.") return {'Pixmap': 'Draft_PointLinkArray', 'MenuText': QT_TRANSLATE_NOOP("Draft_PointLinkArray", "PointLinkArray"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_PointLinkArray", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_PointLinkArray", "Like the PointArray tool, but creates a 'Point link array' instead.\nA 'Point link array' is more efficient when handling many copies.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_points.py b/src/Mod/Draft/draftguitools/gui_points.py index e6be1e317f..7f67ef614b 100644 --- a/src/Mod/Draft/draftguitools/gui_points.py +++ b/src/Mod/Draft/draftguitools/gui_points.py @@ -46,7 +46,7 @@ import draftutils.gui_utils as gui_utils import draftguitools.gui_base_original as gui_base_original import draftutils.todo as todo -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -57,15 +57,14 @@ class Point(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Creates a point object. Click anywhere on the 3D view." return {'Pixmap': 'Draft_Point', 'MenuText': QT_TRANSLATE_NOOP("Draft_Point", "Point"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Point", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Point", "Creates a point object. Click anywhere on the 3D view.")} def Activated(self): """Execute when the command is called.""" - super(Point, self).Activated(name=_tr("Point")) + super(Point, self).Activated(name=translate("draft","Point")) self.view = gui_utils.get3DView() self.stack = [] rot = self.view.getCameraNode().getField("orientation").getValue() diff --git a/src/Mod/Draft/draftguitools/gui_polararray.py b/src/Mod/Draft/draftguitools/gui_polararray.py index 0e2d465d34..6ed9e49dae 100644 --- a/src/Mod/Draft/draftguitools/gui_polararray.py +++ b/src/Mod/Draft/draftguitools/gui_polararray.py @@ -37,7 +37,7 @@ import Draft_rc # include resources, icons, ui files import draftutils.todo as todo from draftutils.messages import _msg, _log -from draftutils.translate import _tr +from draftutils.translate import translate from draftguitools import gui_base from drafttaskpanels import task_polararray @@ -61,16 +61,10 @@ class PolarArray(gui_base.GuiCommandBase): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates copies of the selected object, " - "and places the copies in a polar pattern\n" - "defined by a center of rotation and its angle.\n" - "\n" - "The array can be turned into an orthogonal " - "or a circular array by changing its type.") d = {'Pixmap': 'Draft_PolarArray', 'MenuText': QT_TRANSLATE_NOOP("Draft", "Polar array"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft", "Creates copies of the selected object, and places the copies in a polar pattern\ndefined by a center of rotation and its angle.\n\nThe array can be turned into an orthogonal or a circular array by changing its type.")} return d def Activated(self): @@ -79,9 +73,9 @@ class PolarArray(gui_base.GuiCommandBase): We add callbacks that connect the 3D view with the widgets of the task panel. """ - _log("GuiCommand: {}".format(_tr(self.command_name))) - _msg("{}".format(16*"-")) - _msg("GuiCommand: {}".format(_tr(self.command_name))) + _log("GuiCommand: {}".format(self.command_name)) + #_msg("{}".format(16*"-")) + #_msg("GuiCommand: {}".format(self.command_name)) self.location = coin.SoLocation2Event.getClassTypeId() self.mouse_event = coin.SoMouseButtonEvent.getClassTypeId() diff --git a/src/Mod/Draft/draftguitools/gui_polygons.py b/src/Mod/Draft/draftguitools/gui_polygons.py index 3011c7cf5b..5a8daa51e0 100644 --- a/src/Mod/Draft/draftguitools/gui_polygons.py +++ b/src/Mod/Draft/draftguitools/gui_polygons.py @@ -51,15 +51,11 @@ class Polygon(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a regular polygon (triangle, square, " - "pentagon, ...), by defining the number of sides " - "and the circumscribed radius.\n" - "CTRL to snap, SHIFT to constrain") return {'Pixmap': 'Draft_Polygon', 'Accel': "P, G", 'MenuText': QT_TRANSLATE_NOOP("Draft_Polygon", "Polygon"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Polygon", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Polygon", "Creates a regular polygon (triangle, square, pentagon, ...), by defining the number of sides and the circumscribed radius.\nCTRL to snap, SHIFT to constrain")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_rectangles.py b/src/Mod/Draft/draftguitools/gui_rectangles.py index aff2978189..f4e4b4a312 100644 --- a/src/Mod/Draft/draftguitools/gui_rectangles.py +++ b/src/Mod/Draft/draftguitools/gui_rectangles.py @@ -48,12 +48,11 @@ class Rectangle(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Creates a 2-point rectangle. CTRL to snap." return {'Pixmap': 'Draft_Rectangle', 'Accel': "R, E", 'MenuText': QT_TRANSLATE_NOOP("Draft_Rectangle", "Rectangle"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Rectangle", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Rectangle", "Creates a 2-point rectangle. CTRL to snap.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_rotate.py b/src/Mod/Draft/draftguitools/gui_rotate.py index 95286774a1..0f55cc5449 100644 --- a/src/Mod/Draft/draftguitools/gui_rotate.py +++ b/src/Mod/Draft/draftguitools/gui_rotate.py @@ -44,7 +44,7 @@ import draftguitools.gui_trackers as trackers from FreeCAD import Units as U from draftutils.messages import _msg, _err -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -55,22 +55,16 @@ class Rotate(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Rotates the selected objects. " - "Choose the center of rotation, then the initial angle, " - "and then the final angle.\n" - 'If the "copy" option is active, it will create ' - "rotated copies.\n" - "CTRL to snap, SHIFT to constrain. " - "Hold ALT and click to create a copy with each click.") + _tip = () return {'Pixmap': 'Draft_Rotate', 'Accel': "R, O", 'MenuText': QT_TRANSLATE_NOOP("Draft_Rotate", "Rotate"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Rotate", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Rotate", "Rotates the selected objects. Choose the center of rotation, then the initial angle, and then the final angle.\nIf the \"copy\" option is active, it will create rotated copies.\nCTRL to snap, SHIFT to constrain. Hold ALT and click to create a copy with each click.")} def Activated(self): """Execute when the command is called.""" - super(Rotate, self).Activated(name=_tr("Rotate")) + super(Rotate, self).Activated(name=translate("draft","Rotate")) if not self.ui: return self.ghosts = [] @@ -199,8 +193,7 @@ class Rotate(gui_base_original.Modifier): self.ui.radiusValue.setText(U.Quantity(0, U.Angle).UserString) self.ui.hasFill.hide() self.ui.labelRadius.setText(translate("draft", "Base angle")) - _tip = "The base angle you wish to start the rotation from" - self.ui.radiusValue.setToolTip(translate("draft", _tip)) + self.ui.radiusValue.setToolTip(translate("draft", "The base angle you wish to start the rotation from")) self.arctrack.setCenter(self.center) for ghost in self.ghosts: ghost.center(self.center) @@ -212,9 +205,7 @@ class Rotate(gui_base_original.Modifier): def set_start_point(self): """Set the starting point of the rotation.""" self.ui.labelRadius.setText(translate("draft", "Rotation")) - _tip = ("The amount of rotation you wish to perform.\n" - "The final angle will be the base angle plus this amount.") - self.ui.radiusValue.setToolTip(translate("draft", _tip)) + self.ui.radiusValue.setToolTip(translate("draft", "The amount of rotation you wish to perform.\nThe final angle will be the base angle plus this amount.")) self.rad = DraftVecUtils.dist(self.point, self.center) self.arctrack.on() self.arctrack.setStartPoint(self.point) @@ -397,8 +388,7 @@ class Rotate(gui_base_original.Modifier): self.ui.radiusUi() self.ui.hasFill.hide() self.ui.labelRadius.setText(translate("draft", "Base angle")) - _tip = "The base angle you wish to start the rotation from" - self.ui.radiusValue.setToolTip(translate("draft", _tip)) + self.ui.radiusValue.setToolTip(translate("draft", "The base angle you wish to start the rotation from")) self.ui.radiusValue.setText(U.Quantity(0, U.Angle).UserString) self.step = 1 _msg(translate("draft", "Pick base angle")) @@ -411,10 +401,7 @@ class Rotate(gui_base_original.Modifier): """ if self.step == 1: self.ui.labelRadius.setText(translate("draft", "Rotation")) - _tip = ("The amount of rotation you wish to perform.\n" - "The final angle will be the base angle " - "plus this amount.") - self.ui.radiusValue.setToolTip(translate("draft", _tip)) + self.ui.radiusValue.setToolTip(translate("draft", "The amount of rotation you wish to perform.\nThe final angle will be the base angle plus this amount.")) self.ui.radiusValue.setText(U.Quantity(0, U.Angle).UserString) self.firstangle = math.radians(rad) self.arctrack.setStartAngle(self.firstangle) diff --git a/src/Mod/Draft/draftguitools/gui_scale.py b/src/Mod/Draft/draftguitools/gui_scale.py index 650c4646c0..b4b689733a 100644 --- a/src/Mod/Draft/draftguitools/gui_scale.py +++ b/src/Mod/Draft/draftguitools/gui_scale.py @@ -65,13 +65,11 @@ class Scale(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Scales the selected objects from a base point.\n" - "CTRL to snap, SHIFT to constrain, ALT to copy.") return {'Pixmap': 'Draft_Scale', 'Accel': "S, C", 'MenuText': QT_TRANSLATE_NOOP("Draft_Scale", "Scale"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Scale", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Scale", "Scales the selected objects from a base point.\nCTRL to snap, SHIFT to constrain, ALT to copy.")} def Activated(self): """Execute when the command is called.""" @@ -337,9 +335,7 @@ class Scale(gui_base_original.Modifier): else: m = translate("draft", "Unable to scale objects: ") m += ", ".join([o.Label for o in bads]) - m += " - " + translate("draft", - "This object type cannot be scaled " - "directly. Please use the clone method.") + m += " - " + translate("draft","This object type cannot be scaled directly. Please use the clone method.") _err(m) if goods: _doc = 'FreeCAD.ActiveDocument.' diff --git a/src/Mod/Draft/draftguitools/gui_selectplane.py b/src/Mod/Draft/draftguitools/gui_selectplane.py index 6037046223..0f02e484c3 100644 --- a/src/Mod/Draft/draftguitools/gui_selectplane.py +++ b/src/Mod/Draft/draftguitools/gui_selectplane.py @@ -60,14 +60,10 @@ class Draft_SelectPlane: def GetResources(self): """Set icon, menu and tooltip.""" - _msg = ("Select the face of solid body to create a working plane " - "on which to sketch Draft objects.\n" - "You may also select a three vertices or " - "a Working Plane Proxy.") d = {'Pixmap': 'Draft_SelectPlane', 'Accel': "W, P", 'MenuText': QT_TRANSLATE_NOOP("Draft_SelectPlane", "SelectPlane"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectPlane", _msg)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_SelectPlane", "Select the face of solid body to create a working plane on which to sketch Draft objects.\nYou may also select a three vertices or a Working Plane Proxy.")} return d def IsActive(self): @@ -89,8 +85,7 @@ class Draft_SelectPlane: p = FreeCAD.DraftWorkingPlane self.states.append([p.u, p.v, p.axis, p.position]) - m = translate("draft", "Pick a face, 3 vertices " - "or a WP Proxy to define the drawing plane") + m = translate("draft", "Pick a face, 3 vertices or a WP Proxy to define the drawing plane") _msg(m) # Create task panel diff --git a/src/Mod/Draft/draftguitools/gui_shape2dview.py b/src/Mod/Draft/draftguitools/gui_shape2dview.py index fca56f6af7..80cacece0a 100644 --- a/src/Mod/Draft/draftguitools/gui_shape2dview.py +++ b/src/Mod/Draft/draftguitools/gui_shape2dview.py @@ -43,7 +43,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -54,23 +54,16 @@ class Shape2DView(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Shape 2D view" - _tip = ("Creates a 2D projection of the selected objects " - "on the XY plane.\n" - "The initial projection direction is the negative " - "of the current active view direction.\n" - "You can select individual faces to project, or " - "the entire solid, and also include hidden lines.\n" - "These projections can be used to create technical " - "drawings with the TechDraw Workbench.") + _menu = + _tip = () return {'Pixmap': 'Draft_2DShapeView', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Shape2DView", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Shape2DView", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Shape 2D view"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Shape2DView", "Creates a 2D projection of the selected objects on the XY plane.\nThe initial projection direction is the negative of the current active view direction.\nYou can select individual faces to project, or the entire solid, and also include hidden lines.\nThese projections can be used to create technical drawings with the TechDraw Workbench.")} def Activated(self): """Execute when the command is called.""" - super(Shape2DView, self).Activated(name=_tr("Project 2D view")) + super(Shape2DView, self).Activated(name=translate("draft","Project 2D view")) if not Gui.Selection.getSelection(): if self.ui: self.ui.selectUi() diff --git a/src/Mod/Draft/draftguitools/gui_shapestrings.py b/src/Mod/Draft/draftguitools/gui_shapestrings.py index 2d92c48c97..e1bf33abed 100644 --- a/src/Mod/Draft/draftguitools/gui_shapestrings.py +++ b/src/Mod/Draft/draftguitools/gui_shapestrings.py @@ -62,16 +62,13 @@ class ShapeString(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Shape from text" - _tip = ("Creates a shape from a text string by choosing " - "a specific font and a placement.\n" - "The closed shapes can be used for extrusions " - "and boolean operations.") + _menu = + _tip = () d = {'Pixmap': 'Draft_ShapeString', 'Accel': "S, S", - 'MenuText': QT_TRANSLATE_NOOP("Draft_ShapeString", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ShapeString", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_ShapeString", "Shape from text"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ShapeString", "Creates a shape from a text string by choosing a specific font and a placement.\nThe closed shapes can be used for extrusions and boolean operations.")} return d def Activated(self): diff --git a/src/Mod/Draft/draftguitools/gui_snaps.py b/src/Mod/Draft/draftguitools/gui_snaps.py index eccd8cafbf..362a2a1e9c 100644 --- a/src/Mod/Draft/draftguitools/gui_snaps.py +++ b/src/Mod/Draft/draftguitools/gui_snaps.py @@ -35,7 +35,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCADGui as Gui import draftguitools.gui_base as gui_base -from draftutils.translate import _tr +from draftutils.translate import translate # UTILITIES ----------------------------------------------------------------- @@ -106,18 +106,15 @@ class Draft_Snap_Lock(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Lock, self).__init__(name=_tr("Main toggle snap")) + super(Draft_Snap_Lock, self).__init__(name=translate("draft","Main toggle snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Main snapping toggle On/Off" - _tip = ("Activates or deactivates " - "all snap methods at once.") return {'Pixmap': 'Snap_Lock', 'Accel': "Shift+S", - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Lock", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Lock", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Lock", "Main snapping toggle On/Off"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Lock", "Activates or deactivates all snap methods at once.")} def Activated(self): """Execute when the command is called.""" @@ -140,16 +137,14 @@ class Draft_Snap_Midpoint(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Midpoint, self).__init__(name=_tr("Midpoint snap")) + super(Draft_Snap_Midpoint, self).__init__(name=translate("draft","Midpoint snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Midpoint" - _tip = "Set snapping to the midpoint of an edge." return {'Pixmap': 'Snap_Midpoint', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", "Midpoint"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Midpoint", "Set snapping to the midpoint of an edge.")} def Activated(self): """Execute when the command is called.""" @@ -172,18 +167,14 @@ class Draft_Snap_Perpendicular(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Perpendicular, self).__init__(name=_tr("Perpendicular snap")) + super(Draft_Snap_Perpendicular, self).__init__(name=translate("draft","Perpendicular snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Perpendicular" - _tip = "Set snapping to a direction that is perpendicular to an edge." return {'Pixmap': 'Snap_Perpendicular', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular", "Perpendicular"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Perpendicular", "Set snapping to a direction that is perpendicular to an edge.")} def Activated(self): """Execute when the command is called.""" @@ -206,15 +197,14 @@ class Draft_Snap_Grid(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Grid, self).__init__(name=_tr("Grid snap")) + super(Draft_Snap_Grid, self).__init__(name=translate("draft","Grid snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Set snapping to the intersection of grid lines." return {'Pixmap': 'Snap_Grid', 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Grid", "Grid"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Grid", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Grid", "Set snapping to the intersection of grid lines.")} def Activated(self): """Execute when the command is called.""" @@ -237,18 +227,14 @@ class Draft_Snap_Intersection(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Intersection, self).__init__(name=_tr("Intersection snap")) + super(Draft_Snap_Intersection, self).__init__(name=translate("draft","Intersection snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Intersection" - _tip = "Set snapping to the intersection of edges." return {'Pixmap': 'Snap_Intersection', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Intersection", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Intersection", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Intersection","Intersection"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Intersection","Set snapping to the intersection of edges.")} def Activated(self): """Execute when the command is called.""" @@ -271,16 +257,14 @@ class Draft_Snap_Parallel(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Parallel, self).__init__(name=_tr("Parallel snap")) + super(Draft_Snap_Parallel, self).__init__(name=translate("draft","Parallel snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Parallel" - _tip = "Set snapping to a direction that is parallel to an edge." return {'Pixmap': 'Snap_Parallel', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", "Parallel"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Parallel", "Set snapping to a direction that is parallel to an edge.")} def Activated(self): """Execute when the command is called.""" @@ -303,16 +287,14 @@ class Draft_Snap_Endpoint(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Endpoint, self).__init__(name=_tr("Endpoint snap")) + super(Draft_Snap_Endpoint, self).__init__(name=translate("draft","Endpoint snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Endpoint" - _tip = "Set snapping to endpoints of an edge." return {'Pixmap': 'Snap_Endpoint', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", "Endpoint"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Endpoint", "Set snapping to endpoints of an edge.")} def Activated(self): """Execute when the command is called.""" @@ -336,17 +318,14 @@ class Draft_Snap_Angle(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Angle, self).__init__(name=_tr("Angle snap (30 and 45 degrees)")) + super(Draft_Snap_Angle, self).__init__(name=translate("draft","Angle snap (30 and 45 degrees)")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Angles (30 and 45 degrees)" - _tip = ("Set snapping to points in a circular arc located " - "at multiples of 30 and 45 degree angles.") return {'Pixmap': 'Snap_Angle', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Angle", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Angle", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Angle", "Angle"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Angle", "Set snapping to points in a circular arc located at multiples of 30 and 45 degree angles.")} def Activated(self): """Execute when the command is called.""" @@ -369,15 +348,14 @@ class Draft_Snap_Center(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Center, self).__init__(name=_tr("Arc center snap")) + super(Draft_Snap_Center, self).__init__(name=translate("draft","Arc center snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Set snapping to the center of a circular arc." return {'Pixmap': 'Snap_Center', 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Center", "Center"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Center", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Center", "Set snapping to the center of a circular arc.")} def Activated(self): """Execute when the command is called.""" @@ -400,16 +378,14 @@ class Draft_Snap_Extension(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Extension, self).__init__(name=_tr("Edge extension snap")) + super(Draft_Snap_Extension, self).__init__(name=translate("draft","Edge extension snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Extension" - _tip = "Set snapping to the extension of an edge." return {'Pixmap': 'Snap_Extension', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Extension", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Extension", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Extension", "Extension"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Extension", "Set snapping to the extension of an edge.")} def Activated(self): """Execute when the command is called.""" @@ -432,15 +408,14 @@ class Draft_Snap_Near(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Near, self).__init__(name=_tr("Near snap")) + super(Draft_Snap_Near, self).__init__(name=translate("draft","Near snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Set snapping to the nearest point of an edge." return {'Pixmap': 'Snap_Near', 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Near", "Nearest"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Near", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Near", "Set snapping to the nearest point of an edge.")} def Activated(self): """Execute when the command is called.""" @@ -464,17 +439,14 @@ class Draft_Snap_Ortho(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Ortho, self).__init__(name=_tr("Orthogonal snap")) + super(Draft_Snap_Ortho, self).__init__(name=translate("draft","Orthogonal snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Orthogonal angles (45 degrees)" - _tip = ("Set snapping to a direction that is a multiple " - "of 45 degrees from a point.") return {'Pixmap': 'Snap_Ortho', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", "Orthogonal"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Ortho", "Set snapping to a direction that is a multiple of 45 degrees from a point.")} def Activated(self): """Execute when the command is called.""" @@ -497,16 +469,14 @@ class Draft_Snap_Special(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Special, self).__init__(name=_tr("Special point snap")) + super(Draft_Snap_Special, self).__init__(name=translate("draft","Special point snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Special" - _tip = "Set snapping to the special points defined inside an object." return {'Pixmap': 'Snap_Special', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Special", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Special", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Special", "Special"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Special", "Set snapping to the special points defined inside an object.")} def Activated(self): """Execute when the command is called.""" @@ -530,17 +500,14 @@ class Draft_Snap_Dimensions(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_Dimensions, self).__init__(name=_tr("Dimension display")) + super(Draft_Snap_Dimensions, self).__init__(name=translate("draft","Dimension display")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Show dimensions" - _tip = ("Show temporary linear dimensions when editing an object " - "and using other snapping methods.") return {'Pixmap': 'Snap_Dimensions', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", "Show dimensions"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_Dimensions", "Show temporary linear dimensions when editing an object and using other snapping methods.")} def Activated(self): """Execute when the command is called.""" @@ -566,23 +533,14 @@ class Draft_Snap_WorkingPlane(gui_base.GuiCommandSimplest): """ def __init__(self): - super(Draft_Snap_WorkingPlane, self).__init__(name=_tr("Working plane snap")) + super(Draft_Snap_WorkingPlane, self).__init__(name=translate("draft","Working plane snap")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Working plane" - _tip = ("Restricts snapping to a point in the current " - "working plane.\n" - "If you select a point outside the working plane, " - "for example, by using other snapping methods,\n" - "it will snap to that point's projection " - "in the current working plane.") return {'Pixmap': 'Snap_WorkingPlane', - 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane","Working plane"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Snap_WorkingPlane","Restricts snapping to a point in the current working plane.\nIf you select a point outside the working plane, for example, by using other snapping methods,\nit will snap to that point's projection in the current working plane.")} def Activated(self): """Execute when the command is called.""" @@ -605,17 +563,15 @@ class ShowSnapBar(gui_base.GuiCommandSimplest): """ def __init__(self): - super(ShowSnapBar, self).__init__(name=_tr("Show snap toolbar")) + super(ShowSnapBar, self).__init__(name=translate("draft","Show snap toolbar")) def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Show the snap toolbar if it is hidden." + _tip = return {'Pixmap': 'Draft_Snap', - 'MenuText': QT_TRANSLATE_NOOP("Draft_ShowSnapBar", - "Show snap toolbar"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ShowSnapBar", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_ShowSnapBar","Show snap toolbar"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ShowSnapBar","Show the snap toolbar if it is hidden.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_splines.py b/src/Mod/Draft/draftguitools/gui_splines.py index 925300e9d9..567ba54f20 100644 --- a/src/Mod/Draft/draftguitools/gui_splines.py +++ b/src/Mod/Draft/draftguitools/gui_splines.py @@ -54,13 +54,11 @@ class BSpline(gui_lines.Line): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Creates a multiple-point B-spline. " - "CTRL to snap, SHIFT to constrain.") return {'Pixmap': 'Draft_BSpline', 'Accel': "B, S", 'MenuText': QT_TRANSLATE_NOOP("Draft_BSpline", "B-spline"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_BSpline", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_BSpline", "Creates a multiple-point B-spline. CTRL to snap, SHIFT to constrain.")} def Activated(self): """Execute when the command is called. diff --git a/src/Mod/Draft/draftguitools/gui_split.py b/src/Mod/Draft/draftguitools/gui_split.py index 70f009335f..09e3f35f52 100644 --- a/src/Mod/Draft/draftguitools/gui_split.py +++ b/src/Mod/Draft/draftguitools/gui_split.py @@ -39,7 +39,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -50,21 +50,15 @@ class Split(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Splits the selected line or polyline " - "into two independent lines\n" - "or polylines by clicking anywhere " - "along the original object.\n" - "It works best when choosing a point on a straight segment " - "and not a corner vertex.") return {'Pixmap': 'Draft_Split', 'Accel': "S, P", 'MenuText': QT_TRANSLATE_NOOP("Draft_Split", "Split"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Split", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Split", "Splits the selected line or polyline into two independent lines\nor polylines by clicking anywhere along the original object.\nIt works best when choosing a point on a straight segment and not a corner vertex.")} def Activated(self): """Execute when the command is called.""" - super(Split, self).Activated(name=_tr("Split")) + super(Split, self).Activated(name=translate("draft","Split")) if not self.ui: return _msg(translate("draft", "Click anywhere on a line to split it.")) diff --git a/src/Mod/Draft/draftguitools/gui_stretch.py b/src/Mod/Draft/draftguitools/gui_stretch.py index 8f1e939f40..0139c067cf 100644 --- a/src/Mod/Draft/draftguitools/gui_stretch.py +++ b/src/Mod/Draft/draftguitools/gui_stretch.py @@ -47,7 +47,7 @@ import draftguitools.gui_tool_utils as gui_tool_utils import draftguitools.gui_trackers as trackers from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -58,20 +58,15 @@ class Stretch(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Stretches the selected objects.\n" - "Select an object, then draw a rectangle " - "to pick the vertices that will be stretched,\n" - "then draw a line to specify the distance " - "and direction of stretching.") return {'Pixmap': 'Draft_Stretch', 'Accel': "S, H", 'MenuText': QT_TRANSLATE_NOOP("Draft_Stretch", "Stretch"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Stretch", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Stretch", "Stretches the selected objects.\nSelect an object, then draw a rectangle to pick the vertices that will be stretched,\nthen draw a line to specify the distance and direction of stretching.")} def Activated(self): """Execute when the command is called.""" - super(Stretch, self).Activated(name=_tr("Stretch")) + super(Stretch, self).Activated(name=translate("draft","Stretch")) if self.ui: if not Gui.Selection.getSelection(): self.ui.selectUi() diff --git a/src/Mod/Draft/draftguitools/gui_styles.py b/src/Mod/Draft/draftguitools/gui_styles.py index d3431986d2..0c54884014 100644 --- a/src/Mod/Draft/draftguitools/gui_styles.py +++ b/src/Mod/Draft/draftguitools/gui_styles.py @@ -34,7 +34,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP import FreeCADGui as Gui import draftguitools.gui_base_original as gui_base_original -from draftutils.translate import translate, _tr +from draftutils.translate import translate class ApplyStyle(gui_base_original.Modifier): @@ -42,21 +42,17 @@ class ApplyStyle(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Apply current style" - _tip = ("Applies the current style defined in the toolbar " - "(line width and colors) " - "to the selected objects and groups.") return {'Pixmap': 'Draft_Apply', - 'MenuText': QT_TRANSLATE_NOOP("Draft_ApplyStyle", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ApplyStyle", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_ApplyStyle", "Apply current style"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ApplyStyle", "Applies the current style defined in the toolbar (line width and colors) to the selected objects and groups.")} def Activated(self): """Execute when the command is called. Activate the specific BSpline tracker. """ - super(ApplyStyle, self).Activated(name=_tr("Apply style")) + super(ApplyStyle, self).Activated(name=translate("draft","Apply style")) if self.ui: self.sel = Gui.Selection.getSelection() if len(self.sel) > 0: diff --git a/src/Mod/Draft/draftguitools/gui_subelements.py b/src/Mod/Draft/draftguitools/gui_subelements.py index 0455e6bb85..4abcc9770d 100644 --- a/src/Mod/Draft/draftguitools/gui_subelements.py +++ b/src/Mod/Draft/draftguitools/gui_subelements.py @@ -41,7 +41,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate class SubelementHighlight(gui_base_original.Modifier): @@ -54,25 +54,20 @@ class SubelementHighlight(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Subelement highlight" - _tip = ("Highlight the subelements " - "of the selected objects, " - "so that they can then be edited " - "with the move, rotate, and scale tools.") + _menu = + _tip = () return {'Pixmap': 'Draft_SubelementHighlight', 'Accel': "H, S", - 'MenuText': QT_TRANSLATE_NOOP("Draft_SubelementHighlight", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_SubelementHighlight", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_SubelementHighlight","Subelement highlight"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_SubelementHighlight","Highlight the subelements of the selected objects, so that they can then be edited with the move, rotate, and scale tools.")} def Activated(self): """Execute when the command is called.""" if self.is_running: return self.finish() self.is_running = True - super(SubelementHighlight, self).Activated(name=_tr("Subelement highlight")) + super(SubelementHighlight, self).Activated(name=translate("draft","Subelement highlight")) self.get_selection() def proceed(self): diff --git a/src/Mod/Draft/draftguitools/gui_texts.py b/src/Mod/Draft/draftguitools/gui_texts.py index 4cd0cacaf0..32523e04c8 100644 --- a/src/Mod/Draft/draftguitools/gui_texts.py +++ b/src/Mod/Draft/draftguitools/gui_texts.py @@ -54,12 +54,11 @@ class Text(gui_base_original.Creator): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = "Creates a multi-line annotation. CTRL to snap." return {'Pixmap': 'Draft_Text', 'Accel': "T, E", 'MenuText': QT_TRANSLATE_NOOP("Draft_Text", "Text"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Text", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Text", "Creates a multi-line annotation. CTRL to snap.")} def Activated(self): """Execute when the command is called.""" diff --git a/src/Mod/Draft/draftguitools/gui_togglemodes.py b/src/Mod/Draft/draftguitools/gui_togglemodes.py index 3f87ed1c1c..6798ed3550 100644 --- a/src/Mod/Draft/draftguitools/gui_togglemodes.py +++ b/src/Mod/Draft/draftguitools/gui_togglemodes.py @@ -40,7 +40,7 @@ import Draft_rc import draftguitools.gui_base as gui_base from draftutils.messages import _msg -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -70,7 +70,7 @@ class BaseMode(gui_base.GuiCommandSimplest): if hasattr(Gui, "draftToolBar"): _ui = Gui.draftToolBar else: - _msg(_tr("No active Draft Toolbar.")) + _msg(translate("draft","No active Draft Toolbar.")) return if _ui is not None: @@ -90,23 +90,15 @@ class ToggleConstructionMode(BaseMode): def __init__(self): super(ToggleConstructionMode, - self).__init__(name=_tr("Construction mode")) + self).__init__(name=translate("draft","Construction mode")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Toggle construction mode" - _tip = ("Toggles the Construction mode.\n" - "When this is active, the following objects created " - "will be included in the construction group, " - "and will be drawn with the specified color " - "and properties.") d = {'Pixmap': 'Draft_Construction', - 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode", - _menu), + 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode","Toggle construction mode"), 'Accel': "C, M", - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode", - _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleConstructionMode","Toggles the Construction mode.\nWhen this is active, the following objects created will be included in the construction group, and will be drawn with the specified color and properties.")} return d def Activated(self): @@ -130,22 +122,14 @@ class ToggleContinueMode(BaseMode): """ def __init__(self): - super(ToggleContinueMode, self).__init__(name=_tr("Continue mode")) + super(ToggleContinueMode, self).__init__(name=translate("draft","Continue mode")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Toggle continue mode" - _tip = ("Toggles the Continue mode.\n" - "When this is active, any drawing tool that is terminated " - "will automatically start again.\n" - "This can be used to draw several objects " - "one after the other in succession.") d = {'Pixmap': 'Draft_Continue', - 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode","Toggle continue mode"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleContinueMode","Toggles the Continue mode.\nWhen this is active, any drawing tool that is terminated will automatically start again.\nThis can be used to draw several objects one after the other in succession.")} return d def Activated(self): @@ -172,24 +156,15 @@ class ToggleDisplayMode(gui_base.GuiCommandNeedsSelection): def __init__(self): super(ToggleDisplayMode, - self).__init__(name=_tr("Toggle display mode")) + self).__init__(name=translate("draft","Toggle display mode")) def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Toggle normal/wireframe display" - _tip = ("Switches the display mode of selected objects " - "from flatlines to wireframe and back.\n" - "This is helpful to quickly visualize objects " - "that are hidden by other objects.\n" - "This is intended to be used with closed shapes " - "and solids, and doesn't affect open wires.") d = {'Pixmap': 'Draft_SwitchMode', 'Accel': "Shift+Space", - 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode", - _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode", - _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode","Toggle normal/wireframe display"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_ToggleDisplayMode","Switches the display mode of selected objects from flatlines to wireframe and back.\nThis is helpful to quickly visualize objects that are hidden by other objects.\nThis is intended to be used with closed shapes and solids, and doesn't affect open wires.")} return d def Activated(self): diff --git a/src/Mod/Draft/draftguitools/gui_trimex.py b/src/Mod/Draft/draftguitools/gui_trimex.py index 3fbd04a1ef..88546b0716 100644 --- a/src/Mod/Draft/draftguitools/gui_trimex.py +++ b/src/Mod/Draft/draftguitools/gui_trimex.py @@ -52,7 +52,7 @@ import draftguitools.gui_tool_utils as gui_tool_utils import draftguitools.gui_trackers as trackers from draftutils.messages import _msg, _err -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -70,19 +70,15 @@ class Trimex(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Trims or extends the selected object, " - "or extrudes single faces.\n" - "CTRL snaps, SHIFT constrains to current segment " - "or to normal, ALT inverts.") return {'Pixmap': 'Draft_Trimex', 'Accel': "T, R", 'MenuText': QT_TRANSLATE_NOOP("Draft_Trimex", "Trimex"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Trimex", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Trimex", "Trims or extends the selected object, or extrudes single faces.\nCTRL snaps, SHIFT constrains to current segment or to normal, ALT inverts.")} def Activated(self): """Execute when the command is called.""" - super(Trimex, self).Activated(name=_tr("Trimex")) + super(Trimex, self).Activated(name=translate("draft","Trimex")) self.edges = [] self.placement = None self.ghost = [] diff --git a/src/Mod/Draft/draftguitools/gui_upgrade.py b/src/Mod/Draft/draftguitools/gui_upgrade.py index 088f02721c..fbab4fa431 100644 --- a/src/Mod/Draft/draftguitools/gui_upgrade.py +++ b/src/Mod/Draft/draftguitools/gui_upgrade.py @@ -41,7 +41,7 @@ import draftguitools.gui_base_original as gui_base_original import draftguitools.gui_tool_utils as gui_tool_utils from draftutils.messages import _msg -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -52,23 +52,15 @@ class Upgrade(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _tip = ("Upgrades the selected objects into more complex shapes.\n" - "The result of the operation depends on the types of objects, " - "which may be able to be upgraded several times in a row.\n" - "For example, it can join the selected objects into one, " - "convert simple edges into parametric polylines,\n" - "convert closed edges into filled faces " - "and parametric polygons, and merge faces " - "into a single face.") return {'Pixmap': 'Draft_Upgrade', 'Accel': "U, P", 'MenuText': QT_TRANSLATE_NOOP("Draft_Upgrade", "Upgrade"), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_Upgrade", _tip)} + 'ToolTip': QT_TRANSLATE_NOOP("Draft_Upgrade", "Upgrades the selected objects into more complex shapes.\nThe result of the operation depends on the types of objects, which may be able to be upgraded several times in a row.\nFor example, it can join the selected objects into one, convert simple edges into parametric polylines,\nconvert closed edges into filled faces and parametric polygons, and merge faces into a single face.")} def Activated(self): """Execute when the command is called.""" - super(Upgrade, self).Activated(name=_tr("Upgrade")) + super(Upgrade, self).Activated(name=translate("draft","Upgrade")) if self.ui: if not Gui.Selection.getSelection(): self.ui.selectUi() diff --git a/src/Mod/Draft/draftguitools/gui_wire2spline.py b/src/Mod/Draft/draftguitools/gui_wire2spline.py index 37845ee79d..2c8c10e351 100644 --- a/src/Mod/Draft/draftguitools/gui_wire2spline.py +++ b/src/Mod/Draft/draftguitools/gui_wire2spline.py @@ -44,7 +44,7 @@ import Draft import draftutils.utils as utils import draftguitools.gui_base_original as gui_base_original -from draftutils.translate import translate, _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) True if Draft_rc.__name__ else False @@ -58,13 +58,10 @@ class WireToBSpline(gui_base_original.Modifier): def GetResources(self): """Set icon, menu and tooltip.""" - _menu = "Wire to B-spline" - _tip = ("Converts a selected polyline to a B-spline, " - "or a B-spline to a polyline.") return {'Pixmap': 'Draft_WireToBSpline', - 'MenuText': QT_TRANSLATE_NOOP("Draft_WireToBSpline", _menu), - 'ToolTip': QT_TRANSLATE_NOOP("Draft_WireToBSpline", _tip)} + 'MenuText': QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Wire to B-spline"), + 'ToolTip': QT_TRANSLATE_NOOP("Draft_WireToBSpline", "Converts a selected polyline to a B-spline, or a B-spline to a polyline.")} def Activated(self): """Execute when the command is called.""" @@ -79,7 +76,7 @@ class WireToBSpline(gui_base_original.Modifier): selection = Gui.Selection.getSelection() if selection: if utils.getType(selection[0]) in ['Wire', 'BSpline']: - super(WireToBSpline, self).Activated(name=_tr("Convert polyline/B-spline")) + super(WireToBSpline, self).Activated(name=translate("draft","Convert polyline/B-spline")) if self.doc: self.obj = Gui.Selection.getSelection() if self.obj: diff --git a/src/Mod/Draft/draftmake/make_arc_3points.py b/src/Mod/Draft/draftmake/make_arc_3points.py index c0a48abdf3..cb00898678 100644 --- a/src/Mod/Draft/draftmake/make_arc_3points.py +++ b/src/Mod/Draft/draftmake/make_arc_3points.py @@ -34,7 +34,7 @@ import Part import Draft import draftutils.utils as utils from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate import draftutils.gui_utils as gui_utils @@ -122,23 +122,21 @@ def make_arc_3points(points, placement=None, face=False, try: utils.type_check([(points, (list, tuple))], name=_name) except TypeError: - _err(_tr("Points: ") + "{}".format(points)) - _err(_tr("Wrong input: " - "must be list or tuple of three points exactly.")) + _err(translate("draft","Points: ") + "{}".format(points)) + _err(translate("draft","Wrong input: must be list or tuple of three points exactly.")) return None if len(points) != 3: - _err(_tr("Points: ") + "{}".format(points)) - _err(_tr("Wrong input: " - "must be list or tuple of three points exactly.")) + _err(translate("draft","Points: ") + "{}".format(points)) + _err(translate("draft","Wrong input: must be list or tuple of three points exactly.")) return None if placement is not None: try: utils.type_check([(placement, App.Placement)], name=_name) except TypeError: - _err(_tr("Placement: ") + "{}".format(placement)) - _err(_tr("Wrong input: incorrect type of placement.")) + _err(translate("draft","Placement: ") + "{}".format(placement)) + _err(translate("draft","Wrong input: incorrect type of placement.")) return None p1, p2, p3 = points @@ -152,24 +150,24 @@ def make_arc_3points(points, placement=None, face=False, (p2, App.Vector), (p3, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: incorrect type of points.")) + _err(translate("draft","Wrong input: incorrect type of points.")) return None try: _edge = Part.Arc(p1, p2, p3) except Part.OCCError as error: - _err(_tr("Cannot generate shape: ") + "{}".format(error)) + _err(translate("draft","Cannot generate shape: ") + "{}".format(error)) return None edge = _edge.toShape() radius = edge.Curve.Radius center = edge.Curve.Center - _msg(_tr("Radius: ") + "{}".format(radius)) - _msg(_tr("Center: ") + "{}".format(center)) + _msg(translate("draft","Radius:") + " " + "{}".format(radius)) + _msg(translate("draft","Center:") + " " + "{}".format(center)) if primitive: - _msg(_tr("Create primitive object")) + _msg(translate("draft","Create primitive object")) obj = App.ActiveDocument.addObject("Part::Feature", "Arc") obj.Shape = edge return obj @@ -192,18 +190,18 @@ def make_arc_3points(points, placement=None, face=False, if placement and not support: obj.Placement.Base = placement.Base - _msg(_tr("Final placement: ") + "{}".format(obj.Placement)) + _msg(translate("draft","Final placement:") + " " + "{}".format(obj.Placement)) if face: - _msg(_tr("Face: True")) + _msg(translate("draft","Face: True")) if support: - _msg(_tr("Support: ") + "{}".format(support)) - _msg(_tr("Map mode: " + "{}".format(map_mode))) + _msg(translate("draft","Support:") + " " + "{}".format(support)) + _msg(translate("draft","Map mode:") + " " + "{}".format(map_mode)) obj.MapMode = map_mode if placement: obj.AttachmentOffset.Base = placement.Base obj.AttachmentOffset.Rotation = original_placement.Rotation - _msg(_tr("Attachment offset: {}".format(obj.AttachmentOffset))) - _msg(_tr("Final placement: ") + "{}".format(obj.Placement)) + _msg(translate("draft","Attachment offset: {}".format(obj.AttachmentOffset))) + _msg(translate("draft","Final placement:") + " " + "{}".format(obj.Placement)) return obj diff --git a/src/Mod/Draft/draftmake/make_array.py b/src/Mod/Draft/draftmake/make_array.py index ab9982ff28..0109b6c322 100644 --- a/src/Mod/Draft/draftmake/make_array.py +++ b/src/Mod/Draft/draftmake/make_array.py @@ -35,7 +35,7 @@ import draftutils.utils as utils import draftutils.gui_utils as gui_utils from draftutils.messages import _wrn, _err -from draftutils.translate import _tr +from draftutils.translate import translate from draftobjects.array import Array if App.GuiUp: @@ -82,7 +82,7 @@ def make_array(base_object, """ found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if use_link: diff --git a/src/Mod/Draft/draftmake/make_circulararray.py b/src/Mod/Draft/draftmake/make_circulararray.py index f1611ecccd..9b7bde9e0c 100644 --- a/src/Mod/Draft/draftmake/make_circulararray.py +++ b/src/Mod/Draft/draftmake/make_circulararray.py @@ -32,7 +32,7 @@ import draftmake.make_array as make_array import draftutils.utils as utils from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate def make_circular_array(base_object, @@ -119,7 +119,7 @@ def make_circular_array(base_object, make_ortho_array, make_polar_array, make_path_array, make_point_array """ _name = "make_circular_array" - utils.print_header(_name, _tr("Circular array")) + utils.print_header(_name, translate("draft","Circular array")) if isinstance(base_object, str): base_object_str = base_object @@ -128,7 +128,7 @@ def make_circular_array(base_object, doc=App.activeDocument()) if not found: _msg("base_object: {}".format(base_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("base_object: {}".format(base_object.Label)) @@ -141,7 +141,7 @@ def make_circular_array(base_object, (tan_distance, (int, float, App.Units.Quantity))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a number or quantity.")) + _err(translate("draft","Wrong input: must be a number or quantity.")) return None _msg("number: {}".format(number)) @@ -151,7 +151,7 @@ def make_circular_array(base_object, utils.type_check([(number, int), (symmetry, int)], name=_name) except TypeError: - _err(_tr("Wrong input: must be an integer number.")) + _err(translate("draft","Wrong input: must be an integer number.")) return None _msg("axis: {}".format(axis)) @@ -161,7 +161,7 @@ def make_circular_array(base_object, utils.type_check([(axis, App.Vector), (center, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None use_link = bool(use_link) diff --git a/src/Mod/Draft/draftmake/make_dimension.py b/src/Mod/Draft/draftmake/make_dimension.py index 2f82422ef6..9cd4ebfe8d 100644 --- a/src/Mod/Draft/draftmake/make_dimension.py +++ b/src/Mod/Draft/draftmake/make_dimension.py @@ -40,7 +40,7 @@ import draftutils.utils as utils import draftutils.gui_utils as gui_utils from draftutils.messages import _msg, _wrn, _err -from draftutils.translate import _tr +from draftutils.translate import translate from draftobjects.dimension import (LinearDimension, AngularDimension) @@ -170,10 +170,8 @@ def make_dimension(p1, p2, p3=None, p4=None): def makeDimension(p1, p2, p3=None, p4=None): """Create a dimension. DEPRECATED. Use 'make_dimension'.""" - _wrn(_tr("This function is deprecated. " - "Do not use this function directly.")) - _wrn(_tr("Use one of 'make_linear_dimension', or " - "'make_linear_dimension_obj'.")) + _wrn(translate("draft","This function is deprecated. Do not use this function directly.")) + _wrn(translate("draft","Use one of 'make_linear_dimension', or 'make_linear_dimension_obj'.")) return make_dimension(p1, p2, p3, p4) @@ -214,21 +212,21 @@ def make_linear_dimension(p1, p2, dim_line=None): found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None _msg("p1: {}".format(p1)) try: utils.type_check([(p1, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None _msg("p2: {}".format(p2)) try: utils.type_check([(p2, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None _msg("dim_line: {}".format(dim_line)) @@ -236,7 +234,7 @@ def make_linear_dimension(p1, p2, dim_line=None): try: utils.type_check([(dim_line, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None else: diff = p2.sub(p1) @@ -307,7 +305,7 @@ def make_linear_dimension_obj(edge_object, i1=1, i2=2, dim_line=None): found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if isinstance(edge_object, str): @@ -315,56 +313,54 @@ def make_linear_dimension_obj(edge_object, i1=1, i2=2, dim_line=None): if isinstance(edge_object, (list, tuple)): _msg("edge_object: {}".format(edge_object)) - _err(_tr("Wrong input: object must not be a list.")) + _err(translate("draft","Wrong input: object must not be a list.")) return None found, edge_object = utils.find_object(edge_object, doc) if not found: _msg("edge_object: {}".format(edge_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("edge_object: {}".format(edge_object.Label)) if not hasattr(edge_object, "Shape"): - _err(_tr("Wrong input: object doesn't have a 'Shape' to measure.")) + _err(translate("draft","Wrong input: object doesn't have a 'Shape' to measure.")) return None if (not hasattr(edge_object.Shape, "Vertexes") or len(edge_object.Shape.Vertexes) < 1): - _err(_tr("Wrong input: object doesn't have at least one element " - "in 'Vertexes' to use for measuring.")) + _err(translate("draft","Wrong input: object doesn't have at least one element in 'Vertexes' to use for measuring.")) return None _msg("i1: {}".format(i1)) try: utils.type_check([(i1, int)], name=_name) except TypeError: - _err(_tr("Wrong input: must be an integer.")) + _err(translate("draft","Wrong input: must be an integer.")) return None if i1 < 1: i1 = 1 - _wrn(_tr("i1: values below 1 are not allowed; will be set to 1.")) + _wrn(translate("draft","i1: values below 1 are not allowed; will be set to 1.")) vx1 = edge_object.getSubObject("Vertex" + str(i1)) if not vx1: - _err(_tr("Wrong input: vertex not in object.")) + _err(translate("draft","Wrong input: vertex not in object.")) return None _msg("i2: {}".format(i2)) try: utils.type_check([(i2, int)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None if i2 < 1: i2 = len(edge_object.Shape.Vertexes) - _wrn(_tr("i2: values below 1 are not allowed; " - "will be set to the last vertex in the object.")) + _wrn(translate("draft","i2: values below 1 are not allowed; will be set to the last vertex in the object.")) vx2 = edge_object.getSubObject("Vertex" + str(i2)) if not vx2: - _err(_tr("Wrong input: vertex not in object.")) + _err(translate("draft","Wrong input: vertex not in object.")) return None _msg("dim_line: {}".format(dim_line)) @@ -372,7 +368,7 @@ def make_linear_dimension_obj(edge_object, i1=1, i2=2, dim_line=None): try: utils.type_check([(dim_line, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None else: diff = vx2.Point.sub(vx1.Point) @@ -439,7 +435,7 @@ def make_radial_dimension_obj(edge_object, index=1, mode="radius", found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if isinstance(edge_object, str): @@ -448,49 +444,47 @@ def make_radial_dimension_obj(edge_object, index=1, mode="radius", found, edge_object = utils.find_object(edge_object, doc) if not found: _msg("edge_object: {}".format(edge_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("edge_object: {}".format(edge_object.Label)) if not hasattr(edge_object, "Shape"): - _err(_tr("Wrong input: object doesn't have a 'Shape' to measure.")) + _err(translate("draft","Wrong input: object doesn't have a 'Shape' to measure.")) return None if (not hasattr(edge_object.Shape, "Edges") or len(edge_object.Shape.Edges) < 1): - _err(_tr("Wrong input: object doesn't have at least one element " - "in 'Edges' to use for measuring.")) + _err(translate("draft","Wrong input: object doesn't have at least one element in 'Edges' to use for measuring.")) return None _msg("index: {}".format(index)) try: utils.type_check([(index, int)], name=_name) except TypeError: - _err(_tr("Wrong input: must be an integer.")) + _err(translate("draft","Wrong input: must be an integer.")) return None if index < 1: index = 1 - _wrn(_tr("index: values below 1 are not allowed; will be set to 1.")) + _wrn(translate("draft","index: values below 1 are not allowed; will be set to 1.")) edge = edge_object.getSubObject("Edge" + str(index)) if not edge: - _err(_tr("Wrong input: index doesn't correspond to an edge " - "in the object.")) + _err(translate("draft","Wrong input: index doesn't correspond to an edge in the object.")) return None if not hasattr(edge, "Curve") or edge.Curve.TypeId != 'Part::GeomCircle': - _err(_tr("Wrong input: index doesn't correspond to a circular edge.")) + _err(translate("draft","Wrong input: index doesn't correspond to a circular edge.")) return None _msg("mode: {}".format(mode)) try: utils.type_check([(mode, str)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a string, 'radius' or 'diameter'.")) + _err(translate("draft","Wrong input: must be a string, 'radius' or 'diameter'.")) return None if mode not in ("radius", "diameter"): - _err(_tr("Wrong input: must be a string, 'radius' or 'diameter'.")) + _err(translate("draft","Wrong input: must be a string, 'radius' or 'diameter'.")) return None _msg("dim_line: {}".format(dim_line)) @@ -498,7 +492,7 @@ def make_radial_dimension_obj(edge_object, index=1, mode="radius", try: utils.type_check([(dim_line, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None else: center = edge_object.Shape.Edges[index - 1].Curve.Center @@ -563,14 +557,14 @@ def make_angular_dimension(center=App.Vector(0, 0, 0), found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None _msg("center: {}".format(center)) try: utils.type_check([(center, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None _msg("angles: {}".format(angles)) @@ -578,14 +572,14 @@ def make_angular_dimension(center=App.Vector(0, 0, 0), utils.type_check([(angles, (tuple, list))], name=_name) if len(angles) != 2: - _err(_tr("Wrong input: must be a list with two angles.")) + _err(translate("draft","Wrong input: must be a list with two angles.")) return None ang1, ang2 = angles utils.type_check([(ang1, (int, float)), (ang2, (int, float))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a list with two angles.")) + _err(translate("draft","Wrong input: must be a list with two angles.")) return None # If the angle is larger than 360 degrees, make sure @@ -598,7 +592,7 @@ def make_angular_dimension(center=App.Vector(0, 0, 0), try: utils.type_check([(dim_line, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None _msg("normal: {}".format(normal)) @@ -606,7 +600,7 @@ def make_angular_dimension(center=App.Vector(0, 0, 0), try: utils.type_check([(dim_line, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None if not normal: diff --git a/src/Mod/Draft/draftmake/make_fillet.py b/src/Mod/Draft/draftmake/make_fillet.py index 25b68aa4c5..4d95055488 100644 --- a/src/Mod/Draft/draftmake/make_fillet.py +++ b/src/Mod/Draft/draftmake/make_fillet.py @@ -35,7 +35,7 @@ import draftutils.gui_utils as gui_utils import draftobjects.fillet as fillet from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate if App.GuiUp: import draftviewproviders.view_fillet as view_fillet @@ -55,7 +55,7 @@ def _print_obj_length(obj, edge, num=1): name = num _msg("({0}): {1}; {2} {3}".format(num, name, - _tr("length:"), edge.Length)) + translate("draft","length:"), edge.Length)) def _extract_edges(objs): @@ -129,20 +129,20 @@ def make_fillet(objs, radius=100, chamfer=False, delete=False): utils.print_header(_name, "Fillet") if len(objs) != 2: - _err(_tr("Two elements are needed.")) + _err(translate("draft","Two elements are needed.")) return None e1, e2 = _extract_edges(objs) edges = DraftGeomUtils.fillet([e1, e2], radius, chamfer) if len(edges) < 3: - _err(_tr("Radius is too large") + ", r={}".format(radius)) + _err(translate("draft","Radius is too large") + ", r={}".format(radius)) return None lengths = [edges[0].Length, edges[1].Length, edges[2].Length] - _msg(_tr("Segment") + " 1, " + _tr("length:") + " {}".format(lengths[0])) - _msg(_tr("Segment") + " 2, " + _tr("length:") + " {}".format(lengths[1])) - _msg(_tr("Segment") + " 3, " + _tr("length:") + " {}".format(lengths[2])) + _msg(translate("draft","Segment") + " 1, " + translate("draft","length:") + " {}".format(lengths[0])) + _msg(translate("draft","Segment") + " 2, " + translate("draft","length:") + " {}".format(lengths[1])) + _msg(translate("draft","Segment") + " 3, " + translate("draft","length:") + " {}".format(lengths[2])) try: wire = Part.Wire(edges) @@ -162,7 +162,7 @@ def make_fillet(objs, radius=100, chamfer=False, delete=False): if delete: _doc.removeObject(objs[0].Name) _doc.removeObject(objs[1].Name) - _msg(_tr("Removed original objects.")) + _msg(translate("draft","Removed original objects.")) if App.GuiUp: view_fillet.ViewProviderFillet(obj.ViewObject) diff --git a/src/Mod/Draft/draftmake/make_label.py b/src/Mod/Draft/draftmake/make_label.py index aee4450d61..6a92c203e9 100644 --- a/src/Mod/Draft/draftmake/make_label.py +++ b/src/Mod/Draft/draftmake/make_label.py @@ -35,7 +35,7 @@ import draftutils.gui_utils as gui_utils import draftutils.utils as utils from draftutils.messages import _msg, _wrn, _err -from draftutils.translate import _tr +from draftutils.translate import translate from draftobjects.label import Label if App.GuiUp: @@ -191,7 +191,7 @@ def make_label(target_point=App.Vector(0, 0, 0), found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None _msg("target_point: {}".format(target_point)) @@ -200,7 +200,7 @@ def make_label(target_point=App.Vector(0, 0, 0), try: utils.type_check([(target_point, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None _msg("placement: {}".format(placement)) @@ -211,8 +211,7 @@ def make_label(target_point=App.Vector(0, 0, 0), App.Vector, App.Rotation))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a placement, a vector, " - "or a rotation.")) + _err(translate("draft","Wrong input: must be a placement, a vector, or a rotation.")) return None # Convert the vector or rotation to a full placement @@ -227,13 +226,13 @@ def make_label(target_point=App.Vector(0, 0, 0), if target_object: if isinstance(target_object, (list, tuple)): _msg("target_object: {}".format(target_object)) - _err(_tr("Wrong input: object must not be a list.")) + _err(translate("draft","Wrong input: object must not be a list.")) return None found, target_object = utils.find_object(target_object, doc) if not found: _msg("target_object: {}".format(target_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("target_object: {}".format(target_object.Label)) @@ -248,8 +247,7 @@ def make_label(target_point=App.Vector(0, 0, 0), utils.type_check([(subelements, (list, tuple, str))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a list or tuple of strings. " - "Or a single string.")) + _err(translate("draft","Wrong input: must be a list or tuple of strings, or a single string.")) return None # The subelements list is used to build a special list @@ -261,7 +259,7 @@ def make_label(target_point=App.Vector(0, 0, 0), _sub = target_object.getSubObject(sub) if not _sub: _err("subelement: {}".format(sub)) - _err(_tr("Wrong input: subelement not in object.")) + _err(translate("draft","Wrong input: subelement not in object.")) return None _msg("label_type: {}".format(label_type)) @@ -270,16 +268,12 @@ def make_label(target_point=App.Vector(0, 0, 0), try: utils.type_check([(label_type, str)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a string, " - "'Custom', 'Name', 'Label', 'Position', " - "'Length', 'Area', 'Volume', 'Tag', or 'Material'.")) + _err(translate("draft","Wrong input: must be a string, 'Custom', 'Name', 'Label', 'Position', 'Length', 'Area', 'Volume', 'Tag', or 'Material'.")) return None if label_type not in ("Custom", "Name", "Label", "Position", "Length", "Area", "Volume", "Tag", "Material"): - _err(_tr("Wrong input: must be a string, " - "'Custom', 'Name', 'Label', 'Position', " - "'Length', 'Area', 'Volume', 'Tag', or 'Material'.")) + _err(translate("draft","Wrong input: must be a string, 'Custom', 'Name', 'Label', 'Position', 'Length', 'Area', 'Volume', 'Tag', or 'Material'.")) return None _msg("custom_text: {}".format(custom_text)) @@ -288,7 +282,7 @@ def make_label(target_point=App.Vector(0, 0, 0), try: utils.type_check([(custom_text, str)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a string.")) + _err(translate("draft","Wrong input: must be a string.")) return None _msg("direction: {}".format(direction)) @@ -297,13 +291,11 @@ def make_label(target_point=App.Vector(0, 0, 0), try: utils.type_check([(direction, str)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a string, " - "'Horizontal', 'Vertical', or 'Custom'.")) + _err(translate("draft","Wrong input: must be a string, 'Horizontal', 'Vertical', or 'Custom'.")) return None if direction not in ("Horizontal", "Vertical", "Custom"): - _err(_tr("Wrong input: must be a string, " - "'Horizontal', 'Vertical', or 'Custom'.")) + _err(translate("draft","Wrong input: must be a string, 'Horizontal', 'Vertical', or 'Custom'.")) return None _msg("distance: {}".format(distance)) @@ -312,13 +304,13 @@ def make_label(target_point=App.Vector(0, 0, 0), try: utils.type_check([(distance, (int, float))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a number.")) + _err(translate("draft","Wrong input: must be a number.")) return None if points: _msg("points: {}".format(points)) - _err_msg = _tr("Wrong input: must be a list of at least two vectors.") + _err_msg = translate("draft","Wrong input: must be a list of at least two vectors.") try: utils.type_check([(points, (tuple, list))], name=_name) except TypeError: @@ -352,8 +344,7 @@ def make_label(target_point=App.Vector(0, 0, 0), new_obj.StraightDistance = distance if points: if direction != "Custom": - _wrn(_tr("Direction is not 'Custom'; " - "points won't be used.")) + _wrn(translate("draft","Direction is not 'Custom'; points won't be used.")) new_obj.Points = points if App.GuiUp: @@ -380,8 +371,7 @@ def makeLabel(targetpoint=None, target=None, direction=None, utils.type_check([(target, (tuple, list))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a list of two elements. " - "For example, [object, 'Edge1'].")) + _err(translate("draft","Wrong input: must be a list of two elements. For example, [object, 'Edge1'].")) return None # In the old function `target` is the original parameter, diff --git a/src/Mod/Draft/draftmake/make_layer.py b/src/Mod/Draft/draftmake/make_layer.py index 9c4ad734df..4a315bc5fc 100644 --- a/src/Mod/Draft/draftmake/make_layer.py +++ b/src/Mod/Draft/draftmake/make_layer.py @@ -32,7 +32,7 @@ import FreeCAD as App import draftutils.utils as utils from draftutils.messages import _msg, _err -from draftutils.translate import _tr, translate +from draftutils.translate import translate from draftobjects.layer import (Layer, LayerContainer) @@ -55,7 +55,7 @@ def get_layer_container(): """ found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None for obj in doc.Objects: @@ -142,11 +142,11 @@ def make_layer(name=None, If there is a problem it will return `None`. """ _name = "make_layer" - utils.print_header(_name, _tr("Layer")) + utils.print_header(_name, translate("draft","Layer")) found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if name: @@ -154,23 +154,21 @@ def make_layer(name=None, try: utils.type_check([(name, str)], name=_name) except TypeError: - _err(_tr("Wrong input: it must be a string.")) + _err(translate("draft","Wrong input: it must be a string.")) return None else: name = translate("draft", "Layer") - _info_color = ("Wrong input: " - "must be a tuple of three floats 0.0 to 1.0.") if line_color: _msg("line_color: {}".format(line_color)) try: utils.type_check([(line_color, tuple)], name=_name) except TypeError: - _err(_tr(_info_color)) + _err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0.")) return None if not all(isinstance(color, (int, float)) for color in line_color): - _err(_tr(_info_color)) + _err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0.")) return None else: c = view_group.GetUnsigned("DefaultShapeLineColor", 255) @@ -183,11 +181,11 @@ def make_layer(name=None, try: utils.type_check([(shape_color, tuple)], name=_name) except TypeError: - _err(_tr(_info_color)) + _err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0.")) return None if not all(isinstance(color, (int, float)) for color in shape_color): - _err(_tr(_info_color)) + _err(translate("draft","Wrong input: must be a tuple of three floats 0.0 to 1.0.")) return None else: c = view_group.GetUnsigned("DefaultShapeColor", 4294967295) @@ -200,20 +198,18 @@ def make_layer(name=None, utils.type_check([(line_width, (int, float))], name=_name) line_width = float(abs(line_width)) except TypeError: - _err(_tr("Wrong input: must be a number.")) + _err(translate("draft","Wrong input: must be a number.")) return None - _info_style = ("Wrong input: " - "must be 'Solid', 'Dashed', 'Dotted', or 'Dashdot'.") _msg("draw_style: {}".format(draw_style)) try: utils.type_check([(draw_style, str)], name=_name) except TypeError: - _err(_tr(_info_style)) + _err(translate("draft","Wrong input: must be 'Solid', 'Dashed', 'Dotted', or 'Dashdot'.")) return None if draw_style not in ('Solid', 'Dashed', 'Dotted', 'Dashdot'): - _err(_tr(_info_style)) + _err(translate("draft","Wrong input: must be 'Solid', 'Dashed', 'Dotted', or 'Dashdot'.")) return None _msg("transparency: {}".format(transparency)) @@ -221,7 +217,7 @@ def make_layer(name=None, utils.type_check([(transparency, (int, float))], name=_name) transparency = int(abs(transparency)) except TypeError: - _err(_tr("Wrong input: must be a number between 0 and 100.")) + _err(translate("draft","Wrong input: must be a number between 0 and 100.")) return None new_obj = doc.addObject("App::FeaturePython", "Layer") diff --git a/src/Mod/Draft/draftmake/make_orthoarray.py b/src/Mod/Draft/draftmake/make_orthoarray.py index af2299b43a..36ed7b8a59 100644 --- a/src/Mod/Draft/draftmake/make_orthoarray.py +++ b/src/Mod/Draft/draftmake/make_orthoarray.py @@ -32,7 +32,7 @@ import draftutils.utils as utils import draftmake.make_array as make_array from draftutils.messages import _msg, _wrn, _err -from draftutils.translate import _tr +from draftutils.translate import translate def _make_ortho_array(base_object, @@ -57,7 +57,7 @@ def _make_ortho_array(base_object, This should be handled by the subfunctions that use this one. """ _name = "_make_ortho_array" - utils.print_header(_name, _tr("Internal orthogonal array"), debug=False) + utils.print_header(_name, translate("draft","Internal orthogonal array"), debug=False) new_obj = make_array.make_array(base_object, arg1=v_x, arg2=v_y, arg3=v_z, @@ -84,19 +84,18 @@ def _are_vectors(v_x, v_y, v_z=None, name="Unknown"): (v_y, (int, float, App.Vector))], name=name) except TypeError: - _err(_tr("Wrong input: must be a number or vector.")) + _err(translate("draft","Wrong input: must be a number or vector.")) return False, v_x, v_y, v_z - _text = "Input: single value expanded to vector." if not isinstance(v_x, App.Vector): v_x = App.Vector(v_x, 0, 0) - _wrn(_tr(_text)) + _wrn(translate("draft","Input: single value expanded to vector.")) if not isinstance(v_y, App.Vector): v_y = App.Vector(0, v_y, 0) - _wrn(_tr(_text)) + _wrn(translate("draft","Input: single value expanded to vector.")) if v_z and not isinstance(v_z, App.Vector): v_z = App.Vector(0, 0, v_z) - _wrn(_tr(_text)) + _wrn(translate("draft","Input: single value expanded to vector.")) return True, v_x, v_y, v_z @@ -117,19 +116,17 @@ def _are_integers(n_x, n_y, n_z=None, name="Unknown"): utils.type_check([(n_x, int), (n_y, int)], name=name) except TypeError: - _err(_tr("Wrong input: must be an integer number.")) + _err(translate("draft","Wrong input: must be an integer number.")) return False, n_x, n_y, n_z - _text = ("Input: number of elements must be at least 1. " - "It is set to 1.") if n_x < 1: - _wrn(_tr(_text)) + _wrn(translate("draft","Input: number of elements must be at least 1. It is set to 1.")) n_x = 1 if n_y < 1: - _wrn(_tr(_text)) + _wrn(translate("draft","Input: number of elements must be at least 1. It is set to 1.")) n_y = 1 if n_z and n_z < 1: - _wrn(_tr(_text)) + _wrn(translate("draft","Input: number of elements must be at least 1. It is set to 1.")) n_z = 1 return True, n_x, n_y, n_z @@ -151,7 +148,7 @@ def _are_numbers(d_x, d_y, d_z=None, name="Unknown"): utils.type_check([(d_x, (int, float)), (d_y, (int, float))], name=name) except TypeError: - _err(_tr("Wrong input: must be a number.")) + _err(translate("draft","Wrong input: must be a number.")) return False, d_x, d_y, d_z return True, d_x, d_y, d_z @@ -167,7 +164,7 @@ def _find_object_in_doc(base_object, doc=None): doc=doc) if not found: _msg("base_object: {}".format(base_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return not FOUND, base_object _msg("base_object: {}".format(base_object.Label)) @@ -275,7 +272,7 @@ def make_ortho_array(base_object, make_circular_array, make_path_array, make_point_array """ _name = "make_ortho_array" - utils.print_header(_name, _tr("Orthogonal array")) + utils.print_header(_name, translate("draft","Orthogonal array")) found, base_object = _find_object_in_doc(base_object, doc=App.activeDocument()) @@ -350,7 +347,7 @@ def make_ortho_array2d(base_object, make_circular_array, make_path_array, make_point_array """ _name = "make_ortho_array2d" - utils.print_header(_name, _tr("Orthogonal array 2D")) + utils.print_header(_name, translate("draft","Orthogonal array 2D")) found, base_object = _find_object_in_doc(base_object, doc=App.activeDocument()) @@ -424,7 +421,7 @@ def make_rect_array(base_object, make_circular_array, make_path_array, make_point_array """ _name = "make_rect_array" - utils.print_header(_name, _tr("Rectangular array")) + utils.print_header(_name, translate("draft","Rectangular array")) found, base_object = _find_object_in_doc(base_object, doc=App.activeDocument()) @@ -501,7 +498,7 @@ def make_rect_array2d(base_object, make_circular_array, make_path_array, make_point_array """ _name = "make_rect_array2d" - utils.print_header(_name, _tr("Rectangular array 2D")) + utils.print_header(_name, translate("draft","Rectangular array 2D")) found, base_object = _find_object_in_doc(base_object, doc=App.activeDocument()) diff --git a/src/Mod/Draft/draftmake/make_patharray.py b/src/Mod/Draft/draftmake/make_patharray.py index bd23218a8f..f5848adb73 100644 --- a/src/Mod/Draft/draftmake/make_patharray.py +++ b/src/Mod/Draft/draftmake/make_patharray.py @@ -41,7 +41,7 @@ import draftutils.utils as utils import draftutils.gui_utils as gui_utils from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate from draftobjects.patharray import PathArray from draftobjects.pathtwistedarray import PathTwistedArray @@ -158,7 +158,7 @@ def make_path_array(base_object, path_object, count=4, found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if isinstance(base_object, str): @@ -167,7 +167,7 @@ def make_path_array(base_object, path_object, count=4, found, base_object = utils.find_object(base_object, doc) if not found: _msg("base_object: {}".format(base_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("base_object: {}".format(base_object.Label)) @@ -178,7 +178,7 @@ def make_path_array(base_object, path_object, count=4, found, path_object = utils.find_object(path_object, doc) if not found: _msg("path_object: {}".format(path_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("path_object: {}".format(path_object.Label)) @@ -188,7 +188,7 @@ def make_path_array(base_object, path_object, count=4, utils.type_check([(count, (int, float))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a number.")) + _err(translate("draft","Wrong input: must be a number.")) return None count = int(count) @@ -197,7 +197,7 @@ def make_path_array(base_object, path_object, count=4, utils.type_check([(extra, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None _msg("subelements: {}".format(subelements)) @@ -210,8 +210,7 @@ def make_path_array(base_object, path_object, count=4, utils.type_check([(subelements, (list, tuple, str))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a list or tuple of strings. " - "Or a single string.")) + _err(translate("draft","Wrong input: must be a list or tuple of strings, or a single string.")) return None # The subelements list is used to build a special list @@ -244,8 +243,7 @@ def make_path_array(base_object, path_object, count=4, if align_mode not in ("Original", "Frenet", "Tangent"): raise TypeError except TypeError: - _err(_tr("Wrong input: must be " - "'Original', 'Frenet', or 'Tangent'.")) + _err(translate("draft","Wrong input: must be 'Original', 'Frenet', or 'Tangent'.")) return None _msg("tan_vector: {}".format(tan_vector)) @@ -253,7 +251,7 @@ def make_path_array(base_object, path_object, count=4, utils.type_check([(tan_vector, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None force_vertical = bool(force_vertical) @@ -264,7 +262,7 @@ def make_path_array(base_object, path_object, count=4, utils.type_check([(vertical_vector, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None use_link = bool(use_link) @@ -329,7 +327,7 @@ def make_path_twisted_array(base_object, path_object, found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if isinstance(base_object, str): @@ -338,7 +336,7 @@ def make_path_twisted_array(base_object, path_object, found, base_object = utils.find_object(base_object, doc) if not found: _msg("base_object: {}".format(base_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("base_object: {}".format(base_object.Label)) @@ -349,7 +347,7 @@ def make_path_twisted_array(base_object, path_object, found, path_object = utils.find_object(path_object, doc) if not found: _msg("path_object: {}".format(path_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("path_object: {}".format(path_object.Label)) @@ -359,7 +357,7 @@ def make_path_twisted_array(base_object, path_object, utils.type_check([(count, (int, float))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a number.")) + _err(translate("draft","Wrong input: must be a number.")) return None count = int(count) diff --git a/src/Mod/Draft/draftmake/make_pointarray.py b/src/Mod/Draft/draftmake/make_pointarray.py index 1935d26cec..2e817fc341 100644 --- a/src/Mod/Draft/draftmake/make_pointarray.py +++ b/src/Mod/Draft/draftmake/make_pointarray.py @@ -40,7 +40,7 @@ import draftutils.utils as utils import draftutils.gui_utils as gui_utils from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate from draftobjects.pointarray import PointArray if App.GuiUp: @@ -105,7 +105,7 @@ def make_point_array(base_object, point_object, extra=None, use_link=True): found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if isinstance(base_object, str): @@ -114,7 +114,7 @@ def make_point_array(base_object, point_object, extra=None, use_link=True): found, base_object = utils.find_object(base_object, doc) if not found: _msg("base_object: {}".format(base_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("base_object: {}".format(base_object.Label)) @@ -125,15 +125,14 @@ def make_point_array(base_object, point_object, extra=None, use_link=True): found, point_object = utils.find_object(point_object, doc) if not found: _msg("point_object: {}".format(point_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("point_object: {}".format(point_object.Label)) if (not hasattr(point_object, "Geometry") and not hasattr(point_object, "Links") and not hasattr(point_object, "Components")): - _err(_tr("Wrong input: point object doesn't have " - "'Geometry', 'Links', or 'Components'.")) + _err(translate("draft","Wrong input: point object doesn't have 'Geometry', 'Links', or 'Components'.")) return None _msg("extra: {}".format(extra)) @@ -145,8 +144,7 @@ def make_point_array(base_object, point_object, extra=None, use_link=True): App.Rotation))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a placement, a vector, " - "or a rotation.")) + _err(translate("draft","Wrong input: must be a placement, a vector, or a rotation.")) return None # Convert the vector or rotation to a full placement diff --git a/src/Mod/Draft/draftmake/make_polararray.py b/src/Mod/Draft/draftmake/make_polararray.py index c0ba77bc31..a4341e6eb6 100644 --- a/src/Mod/Draft/draftmake/make_polararray.py +++ b/src/Mod/Draft/draftmake/make_polararray.py @@ -32,7 +32,7 @@ import draftutils.utils as utils import draftmake.make_array as make_array from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate def make_polar_array(base_object, @@ -91,7 +91,7 @@ def make_polar_array(base_object, make_ortho_array, make_circular_array, make_path_array, make_point_array """ _name = "make_polar_array" - utils.print_header(_name, _tr("Polar array")) + utils.print_header(_name, translate("draft","Polar array")) if isinstance(base_object, str): base_object_str = base_object @@ -100,7 +100,7 @@ def make_polar_array(base_object, doc=App.activeDocument()) if not found: _msg("base_object: {}".format(base_object_str)) - _err(_tr("Wrong input: object not in document.")) + _err(translate("draft","Wrong input: object not in document.")) return None _msg("base_object: {}".format(base_object.Label)) @@ -109,21 +109,21 @@ def make_polar_array(base_object, try: utils.type_check([(number, int)], name=_name) except TypeError: - _err(_tr("Wrong input: must be an integer number.")) + _err(translate("draft","Wrong input: must be an integer number.")) return None _msg("angle: {}".format(angle)) try: utils.type_check([(angle, (int, float))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a number.")) + _err(translate("draft","Wrong input: must be a number.")) return None _msg("center: {}".format(center)) try: utils.type_check([(center, App.Vector)], name=_name) except TypeError: - _err(_tr("Wrong input: must be a vector.")) + _err(translate("draft","Wrong input: must be a vector.")) return None use_link = bool(use_link) diff --git a/src/Mod/Draft/draftmake/make_text.py b/src/Mod/Draft/draftmake/make_text.py index 70d062131c..45ca318af0 100644 --- a/src/Mod/Draft/draftmake/make_text.py +++ b/src/Mod/Draft/draftmake/make_text.py @@ -34,7 +34,7 @@ import draftutils.utils as utils import draftutils.gui_utils as gui_utils from draftutils.messages import _msg, _err -from draftutils.translate import _tr +from draftutils.translate import translate from draftobjects.text import Text if App.GuiUp: @@ -87,20 +87,18 @@ def make_text(string, placement=None, screen=False): found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None _msg("string: {}".format(string)) try: utils.type_check([(string, (str, list))]) except TypeError: - _err(_tr("Wrong input: must be a list of strings " - "or a single string.")) + _err(translate("draft","Wrong input: must be a list of strings or a single string.")) return None if not all(isinstance(element, str) for element in string): - _err(_tr("Wrong input: must be a list of strings " - "or a single string.")) + _err(translate("draft","Wrong input: must be a list of strings or a single string.")) return None if isinstance(string, str): @@ -114,8 +112,7 @@ def make_text(string, placement=None, screen=False): App.Vector, App.Rotation))], name=_name) except TypeError: - _err(_tr("Wrong input: must be a placement, a vector, " - "or a rotation.")) + _err(translate("draft","Wrong input: must be a placement, a vector, or a rotation.")) return None # Convert the vector or rotation to a full placement @@ -180,7 +177,7 @@ def convert_draft_texts(textslist=None): found, doc = utils.find_doc(App.activeDocument()) if not found: - _err(_tr("No active document. Aborting.")) + _err(translate("draft","No active document. Aborting.")) return None if not textslist: diff --git a/src/Mod/Draft/draftobjects/draft_annotation.py b/src/Mod/Draft/draftobjects/draft_annotation.py index 1eec289ea5..180e4dcceb 100644 --- a/src/Mod/Draft/draftobjects/draft_annotation.py +++ b/src/Mod/Draft/draftobjects/draft_annotation.py @@ -40,7 +40,7 @@ through Coin (pivy). from PySide.QtCore import QT_TRANSLATE_NOOP from draftutils.messages import _wrn -from draftutils.translate import _tr +from draftutils.translate import translate class DraftAnnotation(object): @@ -86,19 +86,10 @@ class DraftAnnotation(object): _tip) vobj.ScaleMultiplier = 1.00 - _info = "added view property 'ScaleMultiplier'" - _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) + _wrn("v0.19, " + obj.Label + ", " + translate("draft","added view property 'ScaleMultiplier'")) if 'AnnotationStyle' not in vproperties: - _tip = QT_TRANSLATE_NOOP("App::Property", - "Annotation style to apply " - "to this object.\n" - "When using a saved style " - "some of the view properties " - "will become read-only;\n" - "they will only be editable by changing " - "the style through " - "the 'Annotation style editor' tool.") + _tip = QT_TRANSLATE_NOOP("App::Property","Annotation style to apply to this object.\nWhen using a saved style some of the view properties will become read-only;\nthey will only be editable by changing the style through the 'Annotation style editor' tool.") vobj.addProperty("App::PropertyEnumeration", "AnnotationStyle", "Annotation", @@ -111,7 +102,7 @@ class DraftAnnotation(object): vobj.AnnotationStyle = [""] + styles _info = "added view property 'AnnotationStyle'" - _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) + _wrn("v0.19, " + obj.Label + ", " + translate("draft","added view property 'ScaleMultiplier'")) def __getstate__(self): """Return a tuple of objects to save or None. @@ -131,14 +122,12 @@ class DraftAnnotation(object): # the 'DraftText' type was changed to 'Text' type if state["Type"] == "DraftText": state["Type"] = "Text" - _info = "migrated 'DraftText' type to 'Text'" - _wrn("v0.19, " + _tr(_info)) + _wrn("v0.19, " + translate("draft","migrated 'DraftText' type to 'Text'")) self.Type = state["Type"] else: if state == "DraftText": state = "Text" - _info = "migrated 'DraftText' type to 'Text'" - _wrn("v0.19, " + _tr(_info)) + _wrn("v0.19, " + translate("draft","migrated 'DraftText' type to 'Text'")) self.Type = state def execute(self, obj): diff --git a/src/Mod/Draft/draftobjects/patharray.py b/src/Mod/Draft/draftobjects/patharray.py index 7b134872a3..e85007cd5a 100644 --- a/src/Mod/Draft/draftobjects/patharray.py +++ b/src/Mod/Draft/draftobjects/patharray.py @@ -68,8 +68,8 @@ import DraftVecUtils import lazy_loader.lazy_loader as lz from draftutils.messages import _msg, _wrn, _err -from draftutils.translate import _tr - +from draftutils.translate import translate +def QT_TRANSLATE_NOOP(ctx,txt): return txt from draftobjects.base import DraftObject from draftobjects.draftlink import DraftLink @@ -165,7 +165,7 @@ class PathArray(DraftLink): def set_general_properties(self, obj, properties): """Set general properties only if they don't exist.""" if "Base" not in properties: - _tip = _tr("The base object that will be duplicated") + _tip = QT_TRANSLATE_NOOP("App::Property","The base object that will be duplicated") obj.addProperty("App::PropertyLinkGlobal", "Base", "Objects", @@ -173,9 +173,7 @@ class PathArray(DraftLink): obj.Base = None if "PathObject" not in properties: - _tip = _tr("The object along which " - "the copies will be distributed. " - "It must contain 'Edges'.") + _tip = QT_TRANSLATE_NOOP("App::Property","The object along which the copies will be distributed. It must contain 'Edges'.") obj.addProperty("App::PropertyLinkGlobal", "PathObject", "Objects", @@ -190,11 +188,7 @@ class PathArray(DraftLink): # as this property can be used to select a single object, # or a single object with its subelements. if "PathSubelements" not in properties: - _tip = _tr("List of connected edges in the 'Path Object'.\n" - "If these are present, the copies will be created " - "along these subelements only.\n" - "Leave this property empty to create copies along " - "the entire 'Path Object'.") + _tip = QT_TRANSLATE_NOOP("App::Property","List of connected edges in the 'Path Object'.\nIf these are present, the copies will be created along these subelements only.\nLeave this property empty to create copies along the entire 'Path Object'.") obj.addProperty("App::PropertyLinkSubListGlobal", "PathSubelements", "Objects", @@ -202,7 +196,7 @@ class PathArray(DraftLink): obj.PathSubelements = [] if "Count" not in properties: - _tip = _tr("Number of copies to create") + _tip = QT_TRANSLATE_NOOP("App::Property","Number of copies to create") obj.addProperty("App::PropertyInteger", "Count", "Objects", @@ -210,8 +204,7 @@ class PathArray(DraftLink): obj.Count = 4 if self.use_link and "ExpandArray" not in properties: - _tip = _tr("Show the individual array elements " - "(only for Link arrays)") + _tip = QT_TRANSLATE_NOOP("App::Property","Show the individual array elements (only for Link arrays)") obj.addProperty("App::PropertyBool", "ExpandArray", "Objects", @@ -222,10 +215,7 @@ class PathArray(DraftLink): def set_align_properties(self, obj, properties): """Set general properties only if they don't exist.""" if "ExtraTranslation" not in properties: - _tip = _tr("Additional translation " - "that will be applied to each copy.\n" - "This is useful to adjust for the difference " - "between shape centre and shape reference point.") + _tip = QT_TRANSLATE_NOOP("App::Property","Additional translation that will be applied to each copy.\nThis is useful to adjust for the difference between shape centre and shape reference point.") obj.addProperty("App::PropertyVectorDistance", "ExtraTranslation", "Alignment", @@ -233,7 +223,7 @@ class PathArray(DraftLink): obj.ExtraTranslation = App.Vector(0, 0, 0) if "TangentVector" not in properties: - _tip = _tr("Alignment vector for 'Tangent' mode") + _tip = QT_TRANSLATE_NOOP("App::Property","Alignment vector for 'Tangent' mode") obj.addProperty("App::PropertyVector", "TangentVector", "Alignment", @@ -241,8 +231,7 @@ class PathArray(DraftLink): obj.TangentVector = App.Vector(1, 0, 0) if "ForceVertical" not in properties: - _tip = _tr("Force use of 'Vertical Vector' as local Z direction " - "when using 'Original' or 'Tangent' alignment mode") + _tip = QT_TRANSLATE_NOOP("App::Property","Force use of 'Vertical Vector' as local Z direction when using 'Original' or 'Tangent' alignment mode") obj.addProperty("App::PropertyBool", "ForceVertical", "Alignment", @@ -250,8 +239,7 @@ class PathArray(DraftLink): obj.ForceVertical = False if "VerticalVector" not in properties: - _tip = _tr("Direction of the local Z axis " - "when 'Force Vertical' is true") + _tip = QT_TRANSLATE_NOOP("App::Property","Direction of the local Z axis when 'Force Vertical' is true") obj.addProperty("App::PropertyVector", "VerticalVector", "Alignment", @@ -259,16 +247,7 @@ class PathArray(DraftLink): obj.VerticalVector = App.Vector(0, 0, 1) if "AlignMode" not in properties: - _tip = _tr("Method to orient the copies along the path.\n" - "- Original: X is curve tangent, Y is normal, " - "and Z is the cross product.\n" - "- Frenet: aligns the object following the local " - "coordinate system along the path.\n" - "- Tangent: similar to 'Original' but the local X " - "axis is pre-aligned to 'Tangent Vector'.\n" - "\n" - "To get better results with 'Original' or 'Tangent' " - "you may have to set 'Force Vertical' to true.") + _tip = QT_TRANSLATE_NOOP("App::Property","Method to orient the copies along the path.\n- Original: X is curve tangent, Y is normal, and Z is the cross product.\n- Frenet: aligns the object following the local coordinate system along the path.\n- Tangent: similar to 'Original' but the local X axis is pre-aligned to 'Tangent Vector'.\n\nTo get better results with 'Original' or 'Tangent' you may have to set 'Force Vertical' to true.") obj.addProperty("App::PropertyEnumeration", "AlignMode", "Alignment", @@ -279,10 +258,7 @@ class PathArray(DraftLink): # The Align property must be attached after other align properties # so that onChanged works properly if "Align" not in properties: - _tip = _tr("Orient the copies along the path depending " - "on the 'Align Mode'.\n" - "Otherwise the copies will have the same orientation " - "as the original Base object.") + _tip = QT_TRANSLATE_NOOP("App::Property","Orient the copies along the path depending on the 'Align Mode'.\nOtherwise the copies will have the same orientation as the original Base object.") obj.addProperty("App::PropertyBool", "Align", "Alignment", @@ -305,7 +281,7 @@ class PathArray(DraftLink): w = self.get_wires(obj.PathObject, obj.PathSubelements) if not w: _err(obj.PathObject.Label - + _tr(", path object doesn't have 'Edges'.")) + + translate("draft",", path object doesn't have 'Edges'.")) return base_rotation = obj.Base.Shape.Placement.Rotation @@ -416,20 +392,19 @@ class PathArray(DraftLink): if "PathObj" in properties: obj.PathObject = obj.PathObj obj.removeProperty("PathObj") - _info = "'PathObj' property will be migrated to 'PathObject'" - _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) + _wrn("v0.19, " + obj.Label + ", " + translate("draft","'PathObj' property will be migrated to 'PathObject'")) if "PathSubs" in properties: obj.PathSubelements = obj.PathSubs obj.removeProperty("PathSubs") _info = "'PathSubs' property will be migrated to 'PathSubelements'" - _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) + _wrn("v0.19, " + obj.Label + ", " + translate("draft","'PathObj' property will be migrated to 'PathObject'")) if "Xlate" in properties: obj.ExtraTranslation = obj.Xlate obj.removeProperty("Xlate") _info = "'Xlate' property will be migrated to 'ExtraTranslation'" - _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) + _wrn("v0.19, " + obj.Label + ", " + translate("draft","'PathObj' property will be migrated to 'PathObject'")) # Alias for compatibility with v0.18 and earlier @@ -546,8 +521,8 @@ def calculate_placement(globalRotation, try: t = edge.tangentAt(get_parameter_from_v0(edge, offset)) t.normalize() - except Exception: - _wrn(_tr("Cannot calculate path tangent. Copy not aligned.")) + except: + _wrn(translate("draft","Cannot calculate path tangent. Copy not aligned.")) return placement if mode in ('Original', 'Tangent'): @@ -563,7 +538,7 @@ def calculate_placement(globalRotation, except Exception: # weird special case, tangent and normal parallel b = nullv - _wrn(_tr("Tangent and normal are parallel. Copy not aligned.")) + _wrn(translate("draft","Tangent and normal are parallel. Copy not aligned.")) return placement if overrideNormal: @@ -580,20 +555,20 @@ def calculate_placement(globalRotation, n.normalize() except App.Base.FreeCADError: # no/infinite normals here n = defNormal - _msg(_tr("Cannot calculate path normal, using default.")) + _msg(translate("draft","Cannot calculate path normal, using default.")) try: b = t.cross(n) b.normalize() except Exception: b = nullv - _wrn(_tr("Cannot calculate path binormal. Copy not aligned.")) + _wrn(translate("draft","Cannot calculate path binormal. Copy not aligned.")) return placement priority = "XZY" newRot = App.Rotation(t, n, b, priority) # t/x, n/y, b/z else: - _msg(_tr("AlignMode {} is not implemented".format(mode))) + _msg(translate("draft","AlignMode {} is not implemented").format(mode)) return placement # Have valid tangent, normal, binormal diff --git a/src/Mod/Draft/draftobjects/pathtwistedarray.py b/src/Mod/Draft/draftobjects/pathtwistedarray.py index 605d3a7962..8fd9969bec 100644 --- a/src/Mod/Draft/draftobjects/pathtwistedarray.py +++ b/src/Mod/Draft/draftobjects/pathtwistedarray.py @@ -48,8 +48,8 @@ object in the Arch Workbench. # \brief Provides the object code for the TwistedArray object. import draftgeoutils.geo_arrays as geo -from draftutils.translate import _tr - +from draftutils.translate import translate +def QT_TRANSLATE_NOOP(ctx,txt): return txt from draftobjects.draftlink import DraftLink ## \addtogroup draftobjects @@ -80,46 +80,38 @@ class PathTwistedArray(DraftLink): properties = [] if "Base" not in properties: - _tip = _tr("The base object that will be duplicated.") obj.addProperty("App::PropertyLink", "Base", "Objects", - _tip) + Qt_TRANSLATE_NOOP("App::Property","The base object that will be duplicated.")) obj.Base = None if "PathObject" not in properties: - _tip = _tr("The object along which " - "the copies will be distributed. " - "It must contain 'Edges'.") obj.addProperty("App::PropertyLink", "PathObject", "Objects", - _tip) + Qt_TRANSLATE_NOOP("App::Property","The object along which the copies will be distributed. It must contain 'Edges'.")) obj.PathObject = None if "Count" not in properties: - _tip = _tr("Number of copies to create.") obj.addProperty("App::PropertyInteger", "Count", "Objects", - _tip) + Qt_TRANSLATE_NOOP("App::Property","Number of copies to create.")) obj.Count = 15 if "RotationFactor" not in properties: - _tip = _tr("Rotation factor of the twisted array.") obj.addProperty("App::PropertyFloat", "RotationFactor", "Objects", - _tip) + Qt_TRANSLATE_NOOP("App::Property","Rotation factor of the twisted array.")) obj.RotationFactor = 0.25 if self.use_link and "ExpandArray" not in properties: - _tip = _tr("Show the individual array elements " - "(only for Link arrays)") obj.addProperty("App::PropertyBool", "ExpandArray", "Objects", - _tip) + Qt_TRANSLATE_NOOP("App::Property","Show the individual array elements (only for Link arrays)")) obj.ExpandArray = False obj.setPropertyStatus('Shape', 'Transient') diff --git a/src/Mod/Draft/draftobjects/pointarray.py b/src/Mod/Draft/draftobjects/pointarray.py index 5073efcf8c..f304363aaa 100644 --- a/src/Mod/Draft/draftobjects/pointarray.py +++ b/src/Mod/Draft/draftobjects/pointarray.py @@ -44,7 +44,7 @@ import FreeCAD as App import draftutils.utils as utils from draftutils.messages import _wrn, _err -from draftutils.translate import translate, _tr +from draftutils.translate import translate from draftobjects.draftlink import DraftLink # Delay import of module until first use because it is heavy @@ -75,8 +75,7 @@ class PointArray(DraftLink): properties = obj.PropertiesList if "Base" not in properties: - _tip = QT_TRANSLATE_NOOP("App::Property", - "Base object that will be duplicated") + _tip = QT_TRANSLATE_NOOP("App::Property","Base object that will be duplicated") obj.addProperty("App::PropertyLink", "Base", "Objects", @@ -84,12 +83,7 @@ class PointArray(DraftLink): obj.Base = None if "PointObject" not in properties: - _tip = QT_TRANSLATE_NOOP("App::Property", - ("Object containing points used to distribute " - "the base object, for example, a sketch or " - "a Part compound.\n" - "The sketch or compound must contain at least " - "one explicit point or vertex object.")) + _tip = QT_TRANSLATE_NOOP("App::Property", "Object containing points used to distribute the base object, for example, a sketch or a Part compound.\nThe sketch or compound must contain at least one explicit point or vertex object.") obj.addProperty("App::PropertyLink", "PointObject", "Objects", @@ -97,10 +91,7 @@ class PointArray(DraftLink): obj.PointObject = None if "Count" not in properties: - _tip = QT_TRANSLATE_NOOP("App::Property", - "Total number of elements in the array.\n" - "This property is read-only, as the number depends " - "on the points contained within 'Point Object'.") + _tip = QT_TRANSLATE_NOOP("App::Property","Total number of elements in the array.\nThis property is read-only, as the number depends on the points contained within 'Point Object'.") obj.addProperty("App::PropertyInteger", "Count", "Objects", @@ -109,9 +100,7 @@ class PointArray(DraftLink): obj.setEditorMode("Count", 1) # Read only if "ExtraPlacement" not in properties: - _tip = QT_TRANSLATE_NOOP("App::Property", - "Additional placement, shift and rotation, " - "that will be applied to each copy") + _tip = QT_TRANSLATE_NOOP("App::Property","Additional placement, shift and rotation, that will be applied to each copy") obj.addProperty("App::PropertyPlacement", "ExtraPlacement", "Objects", @@ -119,8 +108,7 @@ class PointArray(DraftLink): obj.ExtraPlacement = App.Placement() if self.use_link and "ExpandArray" not in properties: - _tip = _tr("Show the individual array elements " - "(only for Link arrays)") + _tip = QT_TRANSLATE_NOOP("App::Property","Show the individual array elements (only for Link arrays)") obj.addProperty("App::PropertyBool", "ExpandArray", "Objects", @@ -147,15 +135,13 @@ class PointArray(DraftLink): properties = obj.PropertiesList if "ExtraPlacement" not in properties: - _tip = QT_TRANSLATE_NOOP("App::Property", "Additional placement, shift and rotation, " - "that will be applied to each copy") + _tip = QT_TRANSLATE_NOOP("App::Property", "Additional placement, shift and rotation, that will be applied to each copy") obj.addProperty("App::PropertyPlacement", "ExtraPlacement", "Objects", _tip) obj.ExtraPlacement.Base = obj.Base.Placement.Base - _info = "added property 'ExtraPlacement'" - _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) + _wrn("v0.19, " + obj.Label + ", " + translate("draft","added property 'ExtraPlacement'")) self.set_properties(obj) self.migrate_properties_0v19(obj) @@ -171,7 +157,7 @@ class PointArray(DraftLink): obj.PointObject = obj.PointList obj.removeProperty("PointList") _info = "'PointList' property will be migrated to 'PointObject'" - _wrn("v0.19, " + obj.Label + ", " + _tr(_info)) + _wrn("v0.19, " + obj.Label + ", " + translate("draft","added property 'ExtraPlacement'")) def get_point_list(point_object): diff --git a/src/Mod/Draft/drafttaskpanels/task_circulararray.py b/src/Mod/Draft/drafttaskpanels/task_circulararray.py index e340d2b206..a815c4e56c 100644 --- a/src/Mod/Draft/drafttaskpanels/task_circulararray.py +++ b/src/Mod/Draft/drafttaskpanels/task_circulararray.py @@ -38,7 +38,7 @@ import draftutils.utils as utils from FreeCAD import Units as U from draftutils.messages import _msg, _wrn, _err, _log -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) bool(Draft_rc.__name__) @@ -80,7 +80,7 @@ class TaskPanelCircularArray: def __init__(self): self.name = "Circular array" - _log(_tr("Task panel:") + " {}".format(_tr(self.name))) + _log(translate("draft","Task panel:") + " {}".format(translate("draft","Circular array"))) # The .ui file must be loaded into an attribute # called `self.form` so that it is displayed in the task panel. @@ -92,7 +92,7 @@ class TaskPanelCircularArray: pix = QtGui.QPixmap(svg) icon = QtGui.QIcon.fromTheme(icon_name, QtGui.QIcon(svg)) self.form.setWindowIcon(icon) - self.form.setWindowTitle(_tr(self.name)) + self.form.setWindowTitle(translate("draft","Circular array")) self.form.label_icon.setPixmap(pix.scaled(32, 32)) @@ -215,35 +215,32 @@ class TaskPanelCircularArray: the interface may not allow to input wrong data. """ if not selection: - _err(_tr("At least one element must be selected.")) + _err(translate("draft","At least one element must be selected.")) return False if number < 2: - _err(_tr("Number of layers must be at least 2.")) + _err(translate("draft","Number of layers must be at least 2.")) return False # TODO: this should handle multiple objects. # Each of the elements of the selection should be tested. obj = selection[0] if obj.isDerivedFrom("App::FeaturePython"): - _err(_tr("Selection is not suitable for array.")) - _err(_tr("Object:") + " {}".format(selection[0].Label)) + _err(translate("draft","Selection is not suitable for array.")) + _err(translate("draft","Object:") + " {}".format(selection[0].Label)) return False if r_distance == 0: - _wrn(_tr("Radial distance is zero. " - "Resulting array may not look correct.")) + _wrn(translate("draft","Radial distance is zero. Resulting array may not look correct.")) elif r_distance < 0: - _wrn(_tr("Radial distance is negative. " - "It is made positive to proceed.")) + _wrn(translate("draft","Radial distance is negative. It is made positive to proceed.")) self.r_distance = abs(r_distance) if tan_distance == 0: - _err(_tr("Tangential distance cannot be zero.")) + _err(translate("draft","Tangential distance cannot be zero.")) return False elif tan_distance < 0: - _wrn(_tr("Tangential distance is negative. " - "It is made positive to proceed.")) + _wrn(translate("draft","Tangential distance is negative. It is made positive to proceed.")) self.tan_distance = abs(tan_distance) # The other arguments are not tested but they should be present. @@ -300,7 +297,7 @@ class TaskPanelCircularArray: "App.ActiveDocument.recompute()"] # We commit the command list through the parent command - self.source_command.commit(_tr(self.name), _cmd_list) + self.source_command.commit(translate("draft","Circular array", _cmd_list) def get_distances(self): """Get the distance parameters from the widgets.""" @@ -340,7 +337,7 @@ class TaskPanelCircularArray: self.form.input_c_z.setProperty('rawValue', 0) self.center = self.get_center() - _msg(_tr("Center reset:") + _msg(translate("draft","Center reset:") + " ({0}, {1}, {2})".format(self.center.x, self.center.y, self.center.z)) @@ -351,7 +348,7 @@ class TaskPanelCircularArray: state = self.tr_true else: state = self.tr_false - _msg(_tr("Fuse:") + " {}".format(state)) + _msg(translate("draft","Fuse:") + " {}".format(state)) def set_fuse(self): """Execute as a callback when the fuse checkbox changes.""" @@ -365,7 +362,7 @@ class TaskPanelCircularArray: state = self.tr_true else: state = self.tr_false - _msg(_tr("Create Link array:") + " {}".format(state)) + _msg(translate("draft","Create Link array:") + " {}".format(state)) def set_link(self): """Execute as a callback when the link checkbox changes.""" @@ -382,12 +379,12 @@ class TaskPanelCircularArray: # For example, it could take the shapes of all objects, # make a compound and then use it as input for the array function. sel_obj = self.selection[0] - _msg(_tr("Object:") + " {}".format(sel_obj.Label)) - _msg(_tr("Radial distance:") + " {}".format(self.r_distance)) - _msg(_tr("Tangential distance:") + " {}".format(self.tan_distance)) - _msg(_tr("Number of circular layers:") + " {}".format(self.number)) - _msg(_tr("Symmetry parameter:") + " {}".format(self.symmetry)) - _msg(_tr("Center of rotation:") + _msg(translate("draft","Object:") + " {}".format(sel_obj.Label)) + _msg(translate("draft","Radial distance:") + " {}".format(self.r_distance)) + _msg(translate("draft","Tangential distance:") + " {}".format(self.tan_distance)) + _msg(translate("draft","Number of circular layers:") + " {}".format(self.number)) + _msg(translate("draft","Symmetry parameter:") + " {}".format(self.symmetry)) + _msg(translate("draft","Center of rotation:") + " ({0}, {1}, {2})".format(self.center.x, self.center.y, self.center.z)) @@ -491,7 +488,7 @@ class TaskPanelCircularArray: def reject(self): """Execute when clicking the Cancel button or pressing Escape.""" - _msg(_tr("Aborted:") + " {}".format(_tr(self.name))) + _msg(translate("draft","Aborted:") + " {}".format(translate("draft","Circular array"))) self.finish() def finish(self): diff --git a/src/Mod/Draft/drafttaskpanels/task_orthoarray.py b/src/Mod/Draft/drafttaskpanels/task_orthoarray.py index 39b634ee69..08c056c0cc 100644 --- a/src/Mod/Draft/drafttaskpanels/task_orthoarray.py +++ b/src/Mod/Draft/drafttaskpanels/task_orthoarray.py @@ -38,7 +38,7 @@ import draftutils.utils as utils from FreeCAD import Units as U from draftutils.messages import _msg, _err, _log -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) bool(Draft_rc.__name__) @@ -80,7 +80,7 @@ class TaskPanelOrthoArray: def __init__(self): self.name = "Orthogonal array" - _log(_tr("Task panel:") + " {}".format(_tr(self.name))) + _log(translate("draft","Task panel:") + " {}".format(translate("draft","Orthogonal array"))) # The .ui file must be loaded into an attribute # called `self.form` so that it is displayed in the task panel. @@ -92,7 +92,7 @@ class TaskPanelOrthoArray: pix = QtGui.QPixmap(svg) icon = QtGui.QIcon.fromTheme(icon_name, QtGui.QIcon(svg)) self.form.setWindowIcon(icon) - self.form.setWindowTitle(_tr(self.name)) + self.form.setWindowTitle(translate("draft","Orthogonal array")) self.form.label_icon.setPixmap(pix.scaled(32, 32)) @@ -202,19 +202,19 @@ class TaskPanelOrthoArray: the interface may not allow to input wrong data. """ if not selection: - _err(_tr("At least one element must be selected.")) + _err(translate("draft","At least one element must be selected.")) return False if n_x < 1 or n_y < 1 or n_z < 1: - _err(_tr("Number of elements must be at least 1.")) + _err(translate("draft","Number of elements must be at least 1.")) return False # TODO: this should handle multiple objects. # Each of the elements of the selection should be tested. obj = selection[0] if obj.isDerivedFrom("App::FeaturePython"): - _err(_tr("Selection is not suitable for array.")) - _err(_tr("Object:") + " {0} ({1})".format(obj.Label, obj.TypeId)) + _err(translate("draft","Selection is not suitable for array.")) + _err(translate("draft","Object:") + " {0} ({1})".format(obj.Label, obj.TypeId)) return False # The other arguments are not tested but they should be present. @@ -270,7 +270,7 @@ class TaskPanelOrthoArray: "App.ActiveDocument.recompute()"] # We commit the command list through the parent command - self.source_command.commit(_tr(self.name), _cmd_list) + self.source_command.commit(translate("draft","Orthogonal array"), _cmd_list) def get_numbers(self): """Get the number of elements from the widgets.""" @@ -316,7 +316,7 @@ class TaskPanelOrthoArray: self.form.input_X_y.setProperty('rawValue', 0) self.form.input_X_z.setProperty('rawValue', 0) self.v_x, self.v_y, self.v_z = self.get_intervals() - _msg(_tr("Interval X reset:") + _msg(translate("draft","Interval X reset:") + " ({0}, {1}, {2})".format(self.v_x.x, self.v_x.y, self.v_x.z)) @@ -325,7 +325,7 @@ class TaskPanelOrthoArray: self.form.input_Y_y.setProperty('rawValue', 100) self.form.input_Y_z.setProperty('rawValue', 0) self.v_x, self.v_y, self.v_z = self.get_intervals() - _msg(_tr("Interval Y reset:") + _msg(translate("draft","Interval Y reset:") + " ({0}, {1}, {2})".format(self.v_y.x, self.v_y.y, self.v_y.z)) @@ -334,7 +334,7 @@ class TaskPanelOrthoArray: self.form.input_Z_y.setProperty('rawValue', 0) self.form.input_Z_z.setProperty('rawValue', 100) self.v_x, self.v_y, self.v_z = self.get_intervals() - _msg(_tr("Interval Z reset:") + _msg(translate("draft","Interval Z reset:") + " ({0}, {1}, {2})".format(self.v_z.x, self.v_z.y, self.v_z.z)) @@ -345,7 +345,7 @@ class TaskPanelOrthoArray: state = self.tr_true else: state = self.tr_false - _msg(_tr("Fuse:") + " {}".format(state)) + _msg(translate("draft","Fuse:") + " {}".format(state)) def set_fuse(self): """Execute as a callback when the fuse checkbox changes.""" @@ -359,7 +359,7 @@ class TaskPanelOrthoArray: state = self.tr_true else: state = self.tr_false - _msg(_tr("Create Link array:") + " {}".format(state)) + _msg(translate("draft","Create Link array:") + " {}".format(state)) def set_link(self): """Execute as a callback when the link checkbox changes.""" @@ -376,19 +376,19 @@ class TaskPanelOrthoArray: # For example, it could take the shapes of all objects, # make a compound and then use it as input for the array function. sel_obj = self.selection[0] - _msg(_tr("Object:") + " {}".format(sel_obj.Label)) - _msg(_tr("Number of X elements:") + " {}".format(self.n_x)) - _msg(_tr("Interval X:") + _msg(translate("draft","Object:") + " {}".format(sel_obj.Label)) + _msg(translate("draft","Number of X elements:") + " {}".format(self.n_x)) + _msg(translate("draft","Interval X:") + " ({0}, {1}, {2})".format(self.v_x.x, self.v_x.y, self.v_x.z)) - _msg(_tr("Number of Y elements:") + " {}".format(self.n_y)) - _msg(_tr("Interval Y:") + _msg(translate("draft","Number of Y elements:") + " {}".format(self.n_y)) + _msg(translate("draft","Interval Y:") + " ({0}, {1}, {2})".format(self.v_y.x, self.v_y.y, self.v_y.z)) - _msg(_tr("Number of Z elements:") + " {}".format(self.n_z)) - _msg(_tr("Interval Z:") + _msg(translate("draft","Number of Z elements:") + " {}".format(self.n_z)) + _msg(translate("draft","Interval Z:") + " ({0}, {1}, {2})".format(self.v_z.x, self.v_z.y, self.v_z.z)) @@ -397,7 +397,7 @@ class TaskPanelOrthoArray: def reject(self): """Execute when clicking the Cancel button or pressing Escape.""" - _msg(_tr("Aborted:") + " {}".format(_tr(self.name))) + _msg(translate("draft","Aborted:") + " {}".format(translate("draft","Orthogonal array"))) self.finish() def finish(self): diff --git a/src/Mod/Draft/drafttaskpanels/task_polararray.py b/src/Mod/Draft/drafttaskpanels/task_polararray.py index 66162b2a8e..0258a9dbf9 100644 --- a/src/Mod/Draft/drafttaskpanels/task_polararray.py +++ b/src/Mod/Draft/drafttaskpanels/task_polararray.py @@ -38,7 +38,7 @@ import draftutils.utils as utils from FreeCAD import Units as U from draftutils.messages import _msg, _wrn, _err, _log -from draftutils.translate import _tr +from draftutils.translate import translate # The module is used to prevent complaints from code checkers (flake8) bool(Draft_rc.__name__) @@ -80,7 +80,7 @@ class TaskPanelPolarArray: def __init__(self): self.name = "Polar array" - _log(_tr("Task panel:") + " {}".format(_tr(self.name))) + _log(translate("draft","Task panel:") + " {}".format(self.name)) # The .ui file must be loaded into an attribute # called `self.form` so that it is displayed in the task panel. @@ -92,7 +92,7 @@ class TaskPanelPolarArray: pix = QtGui.QPixmap(svg) icon = QtGui.QIcon.fromTheme(icon_name, QtGui.QIcon(svg)) self.form.setWindowIcon(icon) - self.form.setWindowTitle(_tr(self.name)) + self.form.setWindowTitle(translate("draft","Polar array") self.form.label_icon.setPixmap(pix.scaled(32, 32)) @@ -188,28 +188,26 @@ class TaskPanelPolarArray: the interface may not allow to input wrong data. """ if not selection: - _err(_tr("At least one element must be selected.")) + _err(translate("draft","At least one element must be selected.")) return False # TODO: this should handle multiple objects. # Each of the elements of the selection should be tested. obj = selection[0] if obj.isDerivedFrom("App::FeaturePython"): - _err(_tr("Selection is not suitable for array.")) - _err(_tr("Object:") + " {}".format(selection[0].Label)) + _err(translate("draft","Selection is not suitable for array.")) + _err(translate("draft","Object:") + " {}".format(selection[0].Label)) return False if number < 2: - _err(_tr("Number of elements must be at least 2.")) + _err(translate("draft","Number of elements must be at least 2.")) return False if angle > 360: - _wrn(_tr("The angle is above 360 degrees. " - "It is set to this value to proceed.")) + _wrn(translate("draft","The angle is above 360 degrees. It is set to this value to proceed.")) self.angle = 360 elif angle < -360: - _wrn(_tr("The angle is below -360 degrees. " - "It is set to this value to proceed.")) + _wrn(translate("draft","The angle is below -360 degrees. It is set to this value to proceed.")) self.angle = -360 # The other arguments are not tested but they should be present. @@ -261,7 +259,7 @@ class TaskPanelPolarArray: "App.ActiveDocument.recompute()"] # We commit the command list through the parent command - self.source_command.commit(_tr(self.name), _cmd_list) + self.source_command.commit(translate("draft","Polar array"), _cmd_list) def get_number_angle(self): """Get the number and angle parameters from the widgets.""" @@ -288,7 +286,7 @@ class TaskPanelPolarArray: self.form.input_c_z.setProperty('rawValue', 0) self.center = self.get_center() - _msg(_tr("Center reset:") + _msg(translate("draft","Center reset:") + " ({0}, {1}, {2})".format(self.center.x, self.center.y, self.center.z)) @@ -299,7 +297,7 @@ class TaskPanelPolarArray: state = self.tr_true else: state = self.tr_false - _msg(_tr("Fuse:") + " {}".format(state)) + _msg(translate("draft","Fuse:") + " {}".format(state)) def set_fuse(self): """Execute as a callback when the fuse checkbox changes.""" @@ -313,7 +311,7 @@ class TaskPanelPolarArray: state = self.tr_true else: state = self.tr_false - _msg(_tr("Create Link array:") + " {}".format(state)) + _msg(translate("draft","Create Link array:") + " {}".format(state)) def set_link(self): """Execute as a callback when the link checkbox changes.""" @@ -330,10 +328,10 @@ class TaskPanelPolarArray: # For example, it could take the shapes of all objects, # make a compound and then use it as input for the array function. sel_obj = self.selection[0] - _msg(_tr("Object:") + " {}".format(sel_obj.Label)) - _msg(_tr("Number of elements:") + " {}".format(self.number)) - _msg(_tr("Polar angle:") + " {}".format(self.angle)) - _msg(_tr("Center of rotation:") + _msg(translate("draft","Object:") + " {}".format(sel_obj.Label)) + _msg(translate("draft","Number of elements:") + " {}".format(self.number)) + _msg(translate("draft","Polar angle:") + " {}".format(self.angle)) + _msg(translate("draft","Center of rotation:") + " ({0}, {1}, {2})".format(self.center.x, self.center.y, self.center.z)) @@ -437,7 +435,7 @@ class TaskPanelPolarArray: def reject(self): """Execute when clicking the Cancel button or pressing Escape.""" - _msg(_tr("Aborted:") + " {}".format(_tr(self.name))) + _msg(translate("draft","Aborted:") + " {}".format(translate("draft","Polar array"))) self.finish() def finish(self): diff --git a/src/Mod/Image/Gui/Resources/translations/Image.ts b/src/Mod/Image/Gui/Resources/translations/Image.ts index 5b98bce934..57c220d239 100644 --- a/src/Mod/Image/Gui/Resources/translations/Image.ts +++ b/src/Mod/Image/Gui/Resources/translations/Image.ts @@ -1,6 +1,19 @@ + + Image_Scaling + + + Scale image plane + + + + + Scales an image plane by defining a distance between two points + + + Dialog @@ -39,19 +52,6 @@ - - Image_Scaling - - - Scale image plane - - - - - Scales an image plane by defining a distance between two points - - - CmdCreateImagePlane diff --git a/src/Mod/OpenSCAD/Resources/translations/OpenSCAD.ts b/src/Mod/OpenSCAD/Resources/translations/OpenSCAD.ts index 63daea815b..3c8fa35107 100644 --- a/src/Mod/OpenSCAD/Resources/translations/OpenSCAD.ts +++ b/src/Mod/OpenSCAD/Resources/translations/OpenSCAD.ts @@ -1,129 +1,129 @@ - + Gui::Dialog::DlgSettingsOpenSCAD - + General settings - + General OpenSCAD Settings - + OpenSCAD executable - + OpenSCAD import - + Use ViewProvider in Tree View - + If this is checked, Multmatrix Object will be Parametric - + Use Multmatrix Feature - + The maximum number of faces of a polygon, prism or frustum. If fn is greater than this value the object is considered to be a circular. Set to 0 for no limit - + Maximum number of faces for polygons (fn) - + OpenSCAD export - + maximum fragment size - + angular (fa) - + ° - + size (fs) - + mm - + convexity - + Mesh fallback - + Deflection - + deflection - + Triangulation settings - + If this is checked, Features will claim their children in the tree view - + Print debug information in the Console - + The path to the OpenSCAD executable - + Minimum angle for a fragment - + Minimum size of a fragment @@ -131,62 +131,62 @@ OpenSCAD - + Convert Edges to Faces - + Please select 3 objects first - + Unsupported Function - + Press OK - + Add - + Clear - + as Mesh - + Add OpenSCAD Element - + Perform - + Mesh Boolean - + Error all shapes must be either 2D or both must be 3D - + Unable to explode %s @@ -194,12 +194,12 @@ OpenSCAD_AddOpenSCADElement - + Add OpenSCAD Element... - + Add an OpenSCAD element by entering OpenSCAD code and executing the OpenSCAD binary @@ -207,12 +207,12 @@ OpenSCAD_ColorCodeShape - + Color Shapes - + Color Shapes by validity and type @@ -220,7 +220,7 @@ OpenSCAD_Edgestofaces - + Convert Edges To Faces @@ -228,12 +228,12 @@ OpenSCAD_ExpandPlacements - + Expand Placements - + Expand all placements downwards the FeatureTree @@ -241,12 +241,12 @@ OpenSCAD_ExplodeGroup - + Explode Group - + Remove fusion, apply placement to children, and color randomly @@ -254,12 +254,12 @@ OpenSCAD_Hull - + Hull - + Perform Hull @@ -267,12 +267,12 @@ OpenSCAD_IncreaseToleranceFeature - + Increase Tolerance Feature - + Create Feature that allows to increase the tolerance @@ -280,12 +280,12 @@ OpenSCAD_MeshBoolean - + Mesh Boolean... - + Export objects as meshes and use OpenSCAD to perform a boolean operation @@ -293,12 +293,12 @@ OpenSCAD_Minkowski - + Minkowski - + Perform Minkowski @@ -306,12 +306,12 @@ OpenSCAD_MirrorMeshFeature - + Mirror Mesh Feature... - + Create Mirror Mesh Feature @@ -319,12 +319,12 @@ OpenSCAD_RefineShapeFeature - + Refine Shape Feature - + Create Refine Shape Feature @@ -332,12 +332,12 @@ OpenSCAD_RemoveSubtree - + Remove Objects and their Children - + Removes the selected objects and all children that are not referenced from other objects @@ -345,12 +345,12 @@ OpenSCAD_ReplaceObject - + Replace Object - + Replace an object in the Feature Tree. Please select old, new, and parent object @@ -358,12 +358,12 @@ OpenSCAD_ResizeMeshFeature - + Resize Mesh Feature... - + Create Resize Mesh Feature @@ -371,12 +371,12 @@ OpenSCAD_ScaleMeshFeature - + Scale Mesh Feature... - + Create Scale Mesh Feature @@ -384,7 +384,7 @@ Workbech - + OpenSCAD Part tools @@ -392,7 +392,7 @@ Workbench - + OpenSCADTools diff --git a/src/Mod/Part/Gui/DlgPrimitives.cpp b/src/Mod/Part/Gui/DlgPrimitives.cpp index e701003925..9fef631f58 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.cpp +++ b/src/Mod/Part/Gui/DlgPrimitives.cpp @@ -641,6 +641,319 @@ void DlgPrimitives::on_buttonCircleFromThreePoints_clicked() executeCallback(&pp); } +QString DlgPrimitives::createPlane(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Plane\",\"%1\")\n" + "App.ActiveDocument.%1.Length=%2\n" + "App.ActiveDocument.%1.Width=%3\n" + "App.ActiveDocument.%1.Placement=%4\n" + "App.ActiveDocument.%1.Label='%5'\n") + .arg(objectName) + .arg(ui->planeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->planeWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Plane")); +} + +QString DlgPrimitives::createBox(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Box\",\"%1\")\n" + "App.ActiveDocument.%1.Length=%2\n" + "App.ActiveDocument.%1.Width=%3\n" + "App.ActiveDocument.%1.Height=%4\n" + "App.ActiveDocument.%1.Placement=%5\n" + "App.ActiveDocument.%1.Label='%6'\n") + .arg(objectName) + .arg(ui->boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Box")); +} + +QString DlgPrimitives::createCylinder(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Cylinder\",\"%1\")\n" + "App.ActiveDocument.%1.Radius=%2\n" + "App.ActiveDocument.%1.Height=%3\n" + "App.ActiveDocument.%1.Angle=%4\n" + "App.ActiveDocument.%1.Placement=%5\n" + "App.ActiveDocument.%1.Label='%6'\n") + .arg(objectName) + .arg(ui->cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->cylinderHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->cylinderAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Cylinder")); +} + +QString DlgPrimitives::createCone(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Cone\",\"%1\")\n" + "App.ActiveDocument.%1.Radius1=%2\n" + "App.ActiveDocument.%1.Radius2=%3\n" + "App.ActiveDocument.%1.Height=%4\n" + "App.ActiveDocument.%1.Angle=%5\n" + "App.ActiveDocument.%1.Placement=%6\n" + "App.ActiveDocument.%1.Label='%7'\n") + .arg(objectName) + .arg(ui->coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->coneHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->coneAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Cone")); +} + +QString DlgPrimitives::createSphere(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Sphere\",\"%1\")\n" + "App.ActiveDocument.%1.Radius=%2\n" + "App.ActiveDocument.%1.Angle1=%3\n" + "App.ActiveDocument.%1.Angle2=%4\n" + "App.ActiveDocument.%1.Angle3=%5\n" + "App.ActiveDocument.%1.Placement=%6\n" + "App.ActiveDocument.%1.Label='%7'\n") + .arg(objectName) + .arg(ui->sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->sphereAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->sphereAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->sphereAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Sphere")); +} + +QString DlgPrimitives::createEllipsoid(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Ellipsoid\",\"%1\")\n" + "App.ActiveDocument.%1.Radius1=%2\n" + "App.ActiveDocument.%1.Radius2=%3\n" + "App.ActiveDocument.%1.Radius3=%4\n" + "App.ActiveDocument.%1.Angle1=%5\n" + "App.ActiveDocument.%1.Angle2=%6\n" + "App.ActiveDocument.%1.Angle3=%7\n" + "App.ActiveDocument.%1.Placement=%8\n" + "App.ActiveDocument.%1.Label='%9'\n") + .arg(objectName) + .arg(ui->ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidRadius3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Ellipsoid")); +} + +QString DlgPrimitives::createTorus(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Torus\",\"%1\")\n" + "App.ActiveDocument.%1.Radius1=%2\n" + "App.ActiveDocument.%1.Radius2=%3\n" + "App.ActiveDocument.%1.Angle1=%4\n" + "App.ActiveDocument.%1.Angle2=%5\n" + "App.ActiveDocument.%1.Angle3=%6\n" + "App.ActiveDocument.%1.Placement=%7\n" + "App.ActiveDocument.%1.Label='%8'\n") + .arg(objectName) + .arg(ui->torusRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Torus")); +} + +QString DlgPrimitives::createPrism(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Prism\",\"%1\")\n" + "App.ActiveDocument.%1.Polygon=%2\n" + "App.ActiveDocument.%1.Circumradius=%3\n" + "App.ActiveDocument.%1.Height=%4\n" + "App.ActiveDocument.%1.FirstAngle=%5\n" + "App.ActiveDocument.%1.SecondAngle=%6\n" + "App.ActiveDocument.%1.Placement=%7\n" + "App.ActiveDocument.%1.Label='%8'\n") + .arg(objectName) + .arg(ui->prismPolygon->value()) + .arg(ui->prismCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->prismHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->prismXSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(ui->prismYSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Prism")); +} + +QString DlgPrimitives::createWedge(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Wedge\",\"%1\")\n" + "App.ActiveDocument.%1.Xmin=%2\n" + "App.ActiveDocument.%1.Ymin=%3\n" + "App.ActiveDocument.%1.Zmin=%4\n" + "App.ActiveDocument.%1.X2min=%5\n" + "App.ActiveDocument.%1.Z2min=%6\n" + "App.ActiveDocument.%1.Xmax=%7\n" + "App.ActiveDocument.%1.Ymax=%8\n" + "App.ActiveDocument.%1.Zmax=%9\n" + "App.ActiveDocument.%1.X2max=%10\n" + "App.ActiveDocument.%1.Z2max=%11\n" + "App.ActiveDocument.%1.Placement=%12\n" + "App.ActiveDocument.%1.Label='%13'\n") + .arg(objectName) + .arg(ui->wedgeXmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeYmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeX2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZ2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeXmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeYmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeX2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZ2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Wedge")); +} + +QString DlgPrimitives::createHelix(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Helix\",\"%1\")\n" + "App.ActiveDocument.%1.Pitch=%2\n" + "App.ActiveDocument.%1.Height=%3\n" + "App.ActiveDocument.%1.Radius=%4\n" + "App.ActiveDocument.%1.Angle=%5\n" + "App.ActiveDocument.%1.LocalCoord=%6\n" + "App.ActiveDocument.%1.Style=1\n" + "App.ActiveDocument.%1.Placement=%7\n" + "App.ActiveDocument.%1.Label='%8'\n") + .arg(objectName) + .arg(ui->helixPitch->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->helixHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->helixRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->helixAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->helixLocalCS->currentIndex()) + .arg(placement) + .arg(tr("Helix")); +} + +QString DlgPrimitives::createSpiral(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Spiral\",\"%1\")\n" + "App.ActiveDocument.%1.Growth=%2\n" + "App.ActiveDocument.%1.Rotations=%3\n" + "App.ActiveDocument.%1.Radius=%4\n" + "App.ActiveDocument.%1.Placement=%5\n" + "App.ActiveDocument.%1.Label='%6'\n") + .arg(objectName) + .arg(ui->spiralGrowth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->spiralRotation->value(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->spiralRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Spiral")); +} + +QString DlgPrimitives::createCircle(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Circle\",\"%1\")\n" + "App.ActiveDocument.%1.Radius=%2\n" + "App.ActiveDocument.%1.Angle0=%3\n" + "App.ActiveDocument.%1.Angle1=%4\n" + "App.ActiveDocument.%1.Placement=%5\n" + "App.ActiveDocument.%1.Label='%6'\n") + .arg(objectName) + .arg(ui->circleRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->circleAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->circleAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Circle")); +} + +QString DlgPrimitives::createEllipse(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Ellipse\",\"%1\")\n" + "App.ActiveDocument.%1.MajorRadius=%2\n" + "App.ActiveDocument.%1.MinorRadius=%3\n" + "App.ActiveDocument.%1.Angle0=%4\n" + "App.ActiveDocument.%1.Angle1=%5\n" + "App.ActiveDocument.%1.Placement=%6\n" + "App.ActiveDocument.%1.Label='%7'\n") + .arg(objectName) + .arg(ui->ellipseMajorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipseMinorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipseAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipseAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Ellipse")); +} + +QString DlgPrimitives::createVertex(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Vertex\",\"%1\")\n" + "App.ActiveDocument.%1.X=%2\n" + "App.ActiveDocument.%1.Y=%3\n" + "App.ActiveDocument.%1.Z=%4\n" + "App.ActiveDocument.%1.Placement=%5\n" + "App.ActiveDocument.%1.Label='%6'\n") + .arg(objectName) + .arg(ui->vertexX->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->vertexY->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->vertexZ->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Vertex")); +} + +QString DlgPrimitives::createLine(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::Line\",\"%1\")\n" + "App.ActiveDocument.%1.X1=%2\n" + "App.ActiveDocument.%1.Y1=%3\n" + "App.ActiveDocument.%1.Z1=%4\n" + "App.ActiveDocument.%1.X2=%5\n" + "App.ActiveDocument.%1.Y2=%6\n" + "App.ActiveDocument.%1.Z2=%7\n" + "App.ActiveDocument.%1.Placement=%8\n" + "App.ActiveDocument.%1.Label='%9'\n") + .arg(objectName) + .arg(ui->edgeX1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeY1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeZ1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeX2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeY2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeZ2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Line")); +} + +QString DlgPrimitives::createRegularPolygon(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "App.ActiveDocument.addObject(\"Part::RegularPolygon\",\"%1\")\n" + "App.ActiveDocument.%1.Polygon=%2\n" + "App.ActiveDocument.%1.Circumradius=%3\n" + "App.ActiveDocument.%1.Placement=%4\n" + "App.ActiveDocument.%1.Label='%5'\n") + .arg(objectName) + .arg(ui->regularPolygonPolygon->value()) + .arg(ui->regularPolygonCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement) + .arg(tr("Regular polygon")); +} + void DlgPrimitives::createPrimitive(const QString& placement) { try { @@ -653,300 +966,67 @@ void DlgPrimitives::createPrimitive(const QString& placement) } if (ui->PrimitiveTypeCB->currentIndex() == 0) { // plane name = QString::fromLatin1(doc->getUniqueObjectName("Plane").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Plane\",\"%1\")\n" - "App.ActiveDocument.%1.Length=%2\n" - "App.ActiveDocument.%1.Width=%3\n" - "App.ActiveDocument.%1.Placement=%4\n" - "App.ActiveDocument.%1.Label='%5'\n") - .arg(name) - .arg(ui->planeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->planeWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Plane")); + cmd = createPlane(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 1) { // box name = QString::fromLatin1(doc->getUniqueObjectName("Box").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Box\",\"%1\")\n" - "App.ActiveDocument.%1.Length=%2\n" - "App.ActiveDocument.%1.Width=%3\n" - "App.ActiveDocument.%1.Height=%4\n" - "App.ActiveDocument.%1.Placement=%5\n" - "App.ActiveDocument.%1.Label='%6'\n") - .arg(name) - .arg(ui->boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Box")); + cmd = createBox(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 2) { // cylinder name = QString::fromLatin1(doc->getUniqueObjectName("Cylinder").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Cylinder\",\"%1\")\n" - "App.ActiveDocument.%1.Radius=%2\n" - "App.ActiveDocument.%1.Height=%3\n" - "App.ActiveDocument.%1.Angle=%4\n" - "App.ActiveDocument.%1.Placement=%5\n" - "App.ActiveDocument.%1.Label='%6'\n") - .arg(name) - .arg(ui->cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->cylinderHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->cylinderAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Cylinder")); + cmd = createCylinder(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 3) { // cone name = QString::fromLatin1(doc->getUniqueObjectName("Cone").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Cone\",\"%1\")\n" - "App.ActiveDocument.%1.Radius1=%2\n" - "App.ActiveDocument.%1.Radius2=%3\n" - "App.ActiveDocument.%1.Height=%4\n" - "App.ActiveDocument.%1.Angle=%5\n" - "App.ActiveDocument.%1.Placement=%6\n" - "App.ActiveDocument.%1.Label='%7'\n") - .arg(name) - .arg(ui->coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->coneHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->coneAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Cone")); + cmd = createCone(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 4) { // sphere name = QString::fromLatin1(doc->getUniqueObjectName("Sphere").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Sphere\",\"%1\")\n" - "App.ActiveDocument.%1.Radius=%2\n" - "App.ActiveDocument.%1.Angle1=%3\n" - "App.ActiveDocument.%1.Angle2=%4\n" - "App.ActiveDocument.%1.Angle3=%5\n" - "App.ActiveDocument.%1.Placement=%6\n" - "App.ActiveDocument.%1.Label='%7'\n") - .arg(name) - .arg(ui->sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->sphereAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->sphereAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->sphereAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Sphere")); + cmd = createSphere(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 5) { // ellipsoid name = QString::fromLatin1(doc->getUniqueObjectName("Ellipsoid").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Ellipsoid\",\"%1\")\n" - "App.ActiveDocument.%1.Radius1=%2\n" - "App.ActiveDocument.%1.Radius2=%3\n" - "App.ActiveDocument.%1.Radius3=%4\n" - "App.ActiveDocument.%1.Angle1=%5\n" - "App.ActiveDocument.%1.Angle2=%6\n" - "App.ActiveDocument.%1.Angle3=%7\n" - "App.ActiveDocument.%1.Placement=%8\n" - "App.ActiveDocument.%1.Label='%9'\n") - .arg(name) - .arg(ui->ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidRadius3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Ellipsoid")); + cmd = createEllipsoid(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 6) { // torus name = QString::fromLatin1(doc->getUniqueObjectName("Torus").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Torus\",\"%1\")\n" - "App.ActiveDocument.%1.Radius1=%2\n" - "App.ActiveDocument.%1.Radius2=%3\n" - "App.ActiveDocument.%1.Angle1=%4\n" - "App.ActiveDocument.%1.Angle2=%5\n" - "App.ActiveDocument.%1.Angle3=%6\n" - "App.ActiveDocument.%1.Placement=%7\n" - "App.ActiveDocument.%1.Label='%8'\n") - .arg(name) - .arg(ui->torusRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Torus")); + cmd = createTorus(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 7) { // prism name = QString::fromLatin1(doc->getUniqueObjectName("Prism").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Prism\",\"%1\")\n" - "App.ActiveDocument.%1.Polygon=%2\n" - "App.ActiveDocument.%1.Circumradius=%3\n" - "App.ActiveDocument.%1.Height=%4\n" - "App.ActiveDocument.%1.FirstAngle=%5\n" - "App.ActiveDocument.%1.SecondAngle=%6\n" - "App.ActiveDocument.%1.Placement=%7\n" - "App.ActiveDocument.%1.Label='%8'\n") - .arg(name) - .arg(ui->prismPolygon->value()) - .arg(ui->prismCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->prismHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->prismXSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(ui->prismYSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Prism")); + cmd = createPrism(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 8) { // wedge name = QString::fromLatin1(doc->getUniqueObjectName("Wedge").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Wedge\",\"%1\")\n" - "App.ActiveDocument.%1.Xmin=%2\n" - "App.ActiveDocument.%1.Ymin=%3\n" - "App.ActiveDocument.%1.Zmin=%4\n" - "App.ActiveDocument.%1.X2min=%5\n" - "App.ActiveDocument.%1.Z2min=%6\n" - "App.ActiveDocument.%1.Xmax=%7\n" - "App.ActiveDocument.%1.Ymax=%8\n" - "App.ActiveDocument.%1.Zmax=%9\n" - "App.ActiveDocument.%1.X2max=%10\n" - "App.ActiveDocument.%1.Z2max=%11\n" - "App.ActiveDocument.%1.Placement=%12\n" - "App.ActiveDocument.%1.Label='%13'\n") - .arg(name) - .arg(ui->wedgeXmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeYmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeX2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZ2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeXmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeYmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeX2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZ2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Wedge")); + cmd = createWedge(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 9) { // helix name = QString::fromLatin1(doc->getUniqueObjectName("Helix").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Helix\",\"%1\")\n" - "App.ActiveDocument.%1.Pitch=%2\n" - "App.ActiveDocument.%1.Height=%3\n" - "App.ActiveDocument.%1.Radius=%4\n" - "App.ActiveDocument.%1.Angle=%5\n" - "App.ActiveDocument.%1.LocalCoord=%6\n" - "App.ActiveDocument.%1.Style=1\n" - "App.ActiveDocument.%1.Placement=%7\n" - "App.ActiveDocument.%1.Label='%8'\n") - .arg(name) - .arg(ui->helixPitch->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->helixHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->helixRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->helixAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->helixLocalCS->currentIndex()) - .arg(placement) - .arg(tr("Helix")); + cmd = createHelix(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 10) { // spiral name = QString::fromLatin1(doc->getUniqueObjectName("Spiral").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Spiral\",\"%1\")\n" - "App.ActiveDocument.%1.Growth=%2\n" - "App.ActiveDocument.%1.Rotations=%3\n" - "App.ActiveDocument.%1.Radius=%4\n" - "App.ActiveDocument.%1.Placement=%5\n" - "App.ActiveDocument.%1.Label='%6'\n") - .arg(name) - .arg(ui->spiralGrowth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->spiralRotation->value(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->spiralRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Spiral")); + cmd = createSpiral(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 11) { // circle name = QString::fromLatin1(doc->getUniqueObjectName("Circle").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Circle\",\"%1\")\n" - "App.ActiveDocument.%1.Radius=%2\n" - "App.ActiveDocument.%1.Angle0=%3\n" - "App.ActiveDocument.%1.Angle1=%4\n" - "App.ActiveDocument.%1.Placement=%5\n" - "App.ActiveDocument.%1.Label='%6'\n") - .arg(name) - .arg(ui->circleRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->circleAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->circleAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Circle")); + cmd = createCircle(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 12) { // ellipse name = QString::fromLatin1(doc->getUniqueObjectName("Ellipse").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Ellipse\",\"%1\")\n" - "App.ActiveDocument.%1.MajorRadius=%2\n" - "App.ActiveDocument.%1.MinorRadius=%3\n" - "App.ActiveDocument.%1.Angle0=%4\n" - "App.ActiveDocument.%1.Angle1=%5\n" - "App.ActiveDocument.%1.Placement=%6\n" - "App.ActiveDocument.%1.Label='%7'\n") - .arg(name) - .arg(ui->ellipseMajorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipseMinorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipseAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipseAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Ellipse")); + cmd = createEllipse(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 13) { // vertex name = QString::fromLatin1(doc->getUniqueObjectName("Vertex").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Vertex\",\"%1\")\n" - "App.ActiveDocument.%1.X=%2\n" - "App.ActiveDocument.%1.Y=%3\n" - "App.ActiveDocument.%1.Z=%4\n" - "App.ActiveDocument.%1.Placement=%5\n" - "App.ActiveDocument.%1.Label='%6'\n") - .arg(name) - .arg(ui->vertexX->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->vertexY->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->vertexZ->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Vertex")); + cmd = createVertex(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 14) { // line name = QString::fromLatin1(doc->getUniqueObjectName("Line").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::Line\",\"%1\")\n" - "App.ActiveDocument.%1.X1=%2\n" - "App.ActiveDocument.%1.Y1=%3\n" - "App.ActiveDocument.%1.Z1=%4\n" - "App.ActiveDocument.%1.X2=%5\n" - "App.ActiveDocument.%1.Y2=%6\n" - "App.ActiveDocument.%1.Z2=%7\n" - "App.ActiveDocument.%1.Placement=%8\n" - "App.ActiveDocument.%1.Label='%9'\n") - .arg(name) - .arg(ui->edgeX1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeY1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeZ1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeX2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeY2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeZ2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Line")); + cmd = createLine(name, placement); } else if (ui->PrimitiveTypeCB->currentIndex() == 15) { // RegularPolygon name = QString::fromLatin1(doc->getUniqueObjectName("RegularPolygon").c_str()); - cmd = QString::fromLatin1( - "App.ActiveDocument.addObject(\"Part::RegularPolygon\",\"%1\")\n" - "App.ActiveDocument.%1.Polygon=%2\n" - "App.ActiveDocument.%1.Circumradius=%3\n" - "App.ActiveDocument.%1.Placement=%4\n" - "App.ActiveDocument.%1.Label='%5'\n") - .arg(name) - .arg(ui->regularPolygonPolygon->value()) - .arg(ui->regularPolygonCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement) - .arg(tr("Regular polygon")); + cmd = createRegularPolygon(name, placement); } // Execute the Python block @@ -963,6 +1043,270 @@ void DlgPrimitives::createPrimitive(const QString& placement) } } +QString DlgPrimitives::changePlane(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Length=%2\n" + "%1.Width=%3\n" + "%1.Placement=%4\n") + .arg(objectName) + .arg(ui->planeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->planeWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeBox(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Length=%2\n" + "%1.Width=%3\n" + "%1.Height=%4\n" + "%1.Placement=%5\n") + .arg(objectName) + .arg(ui->boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeCylinder(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Radius=%2\n" + "%1.Height=%3\n" + "%1.Angle=%4\n" + "%1.Placement=%5\n") + .arg(objectName) + .arg(ui->cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->cylinderHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->cylinderAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeCone(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Radius1=%2\n" + "%1.Radius2=%3\n" + "%1.Height=%4\n" + "%1.Angle=%5\n" + "%1.Placement=%6\n") + .arg(objectName) + .arg(ui->coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->coneHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->coneAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeSphere(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Radius=%2\n" + "%1.Angle1=%3\n" + "%1.Angle2=%4\n" + "%1.Angle3=%5\n" + "%1.Placement=%6\n") + .arg(objectName) + .arg(ui->sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->sphereAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->sphereAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->sphereAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeEllipsoid(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Radius1=%2\n" + "%1.Radius2=%3\n" + "%1.Radius3=%4\n" + "%1.Angle1=%5\n" + "%1.Angle2=%6\n" + "%1.Angle3=%7\n" + "%1.Placement=%8\n") + .arg(objectName) + .arg(ui->ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidRadius3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipsoidAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeTorus(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Radius1=%2\n" + "%1.Radius2=%3\n" + "%1.Angle1=%4\n" + "%1.Angle2=%5\n" + "%1.Angle3=%6\n" + "%1.Placement=%7\n") + .arg(objectName) + .arg(ui->torusRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->torusAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changePrism(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Polygon=%2\n" + "%1.Circumradius=%3\n" + "%1.Height=%4\n" + "%1.FirstAngle=%5\n" + "%1.SecondAngle=%6\n" + "%1.Placement=%7\n") + .arg(objectName) + .arg(ui->prismPolygon->value()) + .arg(ui->prismCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->prismHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->prismXSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(ui->prismYSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeWedge(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Xmin=%2\n" + "%1.Ymin=%3\n" + "%1.Zmin=%4\n" + "%1.X2min=%5\n" + "%1.Z2min=%6\n" + "%1.Xmax=%7\n" + "%1.Ymax=%8\n" + "%1.Zmax=%9\n" + "%1.X2max=%10\n" + "%1.Z2max=%11\n" + "%1.Placement=%12\n") + .arg(objectName) + .arg(ui->wedgeXmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeYmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeX2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZ2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeXmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeYmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeX2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->wedgeZ2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeHelix(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Pitch=%2\n" + "%1.Height=%3\n" + "%1.Radius=%4\n" + "%1.Angle=%5\n" + "%1.LocalCoord=%6\n" + "%1.Placement=%7\n") + .arg(objectName) + .arg(ui->helixPitch->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(ui->helixHeight->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(ui->helixRadius->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(ui->helixAngle->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) + .arg(ui->helixLocalCS->currentIndex()) + .arg(placement); +} + +QString DlgPrimitives::changeSpiral(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Growth=%2\n" + "%1.Rotations=%3\n" + "%1.Radius=%4\n" + "%1.Placement=%5\n") + .arg(objectName) + .arg(ui->spiralGrowth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->spiralRotation->value(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->spiralRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeCircle(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Radius=%2\n" + "%1.Angle0=%3\n" + "%1.Angle1=%4\n" + "%1.Placement=%5\n") + .arg(objectName) + .arg(ui->circleRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->circleAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->circleAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeEllipse(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.MajorRadius=%2\n" + "%1.MinorRadius=%3\n" + "%1.Angle0=%4\n" + "%1.Angle1=%5\n" + "%1.Placement=%6\n") + .arg(objectName) + .arg(ui->ellipseMajorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipseMinorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipseAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->ellipseAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeVertex(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.X=%2\n" + "%1.Y=%3\n" + "%1.Z=%4\n" + "%1.Placement=%5\n") + .arg(objectName) + .arg(ui->vertexX->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->vertexY->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->vertexZ->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeLine(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.X1=%2\n" + "%1.Y1=%3\n" + "%1.Z1=%4\n" + "%1.X2=%5\n" + "%1.Y2=%6\n" + "%1.Z2=%7\n" + "%1.Placement=%8\n") + .arg(objectName) + .arg(ui->edgeX1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeY1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeZ1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeX2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeY2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(ui->edgeZ2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + +QString DlgPrimitives::changeRegularPolygon(const QString& objectName, const QString& placement) const +{ + return QString::fromLatin1( + "%1.Polygon=%2\n" + "%1.Circumradius=%3\n" + "%1.Placement=%4\n") + .arg(objectName) + .arg(ui->regularPolygonPolygon->value()) + .arg(ui->regularPolygonCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) + .arg(placement); +} + void DlgPrimitives::accept(const QString& placement) { if (featurePtr.expired()) @@ -976,236 +1320,52 @@ void DlgPrimitives::accept(const QString& placement) // read values from the properties if (type == Part::Plane::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Length=%2\n" - "%1.Width=%3\n" - "%1.Placement=%4\n") - .arg(objectName) - .arg(ui->planeLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->planeWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changePlane(objectName, placement); } else if (type == Part::Box::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Length=%2\n" - "%1.Width=%3\n" - "%1.Height=%4\n" - "%1.Placement=%5\n") - .arg(objectName) - .arg(ui->boxLength->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->boxWidth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->boxHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeBox(objectName, placement); } else if (type == Part::Cylinder::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Radius=%2\n" - "%1.Height=%3\n" - "%1.Angle=%4\n" - "%1.Placement=%5\n") - .arg(objectName) - .arg(ui->cylinderRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->cylinderHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->cylinderAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeCylinder(objectName, placement); } else if (type == Part::Cone::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Radius1=%2\n" - "%1.Radius2=%3\n" - "%1.Height=%4\n" - "%1.Angle=%5\n" - "%1.Placement=%6\n") - .arg(objectName) - .arg(ui->coneRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->coneRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->coneHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->coneAngle->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeCone(objectName, placement); } else if (type == Part::Sphere::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Radius=%2\n" - "%1.Angle1=%3\n" - "%1.Angle2=%4\n" - "%1.Angle3=%5\n" - "%1.Placement=%6\n") - .arg(objectName) - .arg(ui->sphereRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->sphereAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->sphereAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->sphereAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeSphere(objectName, placement); } else if (type == Part::Ellipsoid::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Radius1=%2\n" - "%1.Radius2=%3\n" - "%1.Radius3=%4\n" - "%1.Angle1=%5\n" - "%1.Angle2=%6\n" - "%1.Angle3=%7\n" - "%1.Placement=%8\n") - .arg(objectName) - .arg(ui->ellipsoidRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidRadius3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipsoidAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeEllipsoid(objectName, placement); } else if (type == Part::Torus::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Radius1=%2\n" - "%1.Radius2=%3\n" - "%1.Angle1=%4\n" - "%1.Angle2=%5\n" - "%1.Angle3=%6\n" - "%1.Placement=%7\n") - .arg(objectName) - .arg(ui->torusRadius1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusRadius2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusAngle2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->torusAngle3->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeTorus(objectName, placement); } else if (type == Part::Prism::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Polygon=%2\n" - "%1.Circumradius=%3\n" - "%1.Height=%4\n" - "%1.FirstAngle=%5\n" - "%1.SecondAngle=%6\n" - "%1.Placement=%7\n") - .arg(objectName) - .arg(ui->prismPolygon->value()) - .arg(ui->prismCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->prismHeight->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->prismXSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(ui->prismYSkew->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(placement); + command = changePrism(objectName, placement); } else if (type == Part::Wedge::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Xmin=%2\n" - "%1.Ymin=%3\n" - "%1.Zmin=%4\n" - "%1.X2min=%5\n" - "%1.Z2min=%6\n" - "%1.Xmax=%7\n" - "%1.Ymax=%8\n" - "%1.Zmax=%9\n" - "%1.X2max=%10\n" - "%1.Z2max=%11\n" - "%1.Placement=%12\n") - .arg(objectName) - .arg(ui->wedgeXmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeYmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZmin->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeX2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZ2min->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeXmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeYmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZmax->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeX2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->wedgeZ2max->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeWedge(objectName, placement); } else if (type == Part::Helix::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Pitch=%2\n" - "%1.Height=%3\n" - "%1.Radius=%4\n" - "%1.Angle=%5\n" - "%1.LocalCoord=%6\n" - "%1.Placement=%7\n") - .arg(objectName) - .arg(ui->helixPitch->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(ui->helixHeight->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(ui->helixRadius->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(ui->helixAngle->value().getValue(), 0, 'f', Base::UnitsApi::getDecimals()) - .arg(ui->helixLocalCS->currentIndex()) - .arg(placement); + command = changeHelix(objectName, placement); } else if (type == Part::Spiral::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Growth=%2\n" - "%1.Rotations=%3\n" - "%1.Radius=%4\n" - "%1.Placement=%5\n") - .arg(objectName) - .arg(ui->spiralGrowth->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->spiralRotation->value(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->spiralRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeSpiral(objectName, placement); } else if (type == Part::Circle::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Radius=%2\n" - "%1.Angle0=%3\n" - "%1.Angle1=%4\n" - "%1.Placement=%5\n") - .arg(objectName) - .arg(ui->circleRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->circleAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->circleAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeCircle(objectName, placement); } else if (type == Part::Ellipse::getClassTypeId()) { - command = QString::fromLatin1( - "%1.MajorRadius=%2\n" - "%1.MinorRadius=%3\n" - "%1.Angle0=%4\n" - "%1.Angle1=%5\n" - "%1.Placement=%6\n") - .arg(objectName) - .arg(ui->ellipseMajorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipseMinorRadius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipseAngle0->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->ellipseAngle1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeEllipse(objectName, placement); } else if (type == Part::Vertex::getClassTypeId()) { - command = QString::fromLatin1( - "%1.X=%2\n" - "%1.Y=%3\n" - "%1.Z=%4\n" - "%1.Placement=%5\n") - .arg(objectName) - .arg(ui->vertexX->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->vertexY->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->vertexZ->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeVertex(objectName, placement); } else if (type == Part::Line::getClassTypeId()) { - command = QString::fromLatin1( - "%1.X1=%2\n" - "%1.Y1=%3\n" - "%1.Z1=%4\n" - "%1.X2=%5\n" - "%1.Y2=%6\n" - "%1.Z2=%7\n" - "%1.Placement=%8\n") - .arg(objectName) - .arg(ui->edgeX1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeY1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeZ1->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeX2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeY2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(ui->edgeZ2->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeLine(objectName, placement); } else if (type == Part::RegularPolygon::getClassTypeId()) { - command = QString::fromLatin1( - "%1.Polygon=%2\n" - "%1.Circumradius=%3\n" - "%1.Placement=%4\n") - .arg(objectName) - .arg(ui->regularPolygonPolygon->value()) - .arg(ui->regularPolygonCircumradius->value().getValue(),0,'f',Base::UnitsApi::getDecimals()) - .arg(placement); + command = changeRegularPolygon(objectName, placement); } // execute command, a transaction is already opened diff --git a/src/Mod/Part/Gui/DlgPrimitives.h b/src/Mod/Part/Gui/DlgPrimitives.h index adde46ec11..cf5d46b973 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.h +++ b/src/Mod/Part/Gui/DlgPrimitives.h @@ -93,6 +93,40 @@ private Q_SLOTS: void onChangeRegularPolygon(QWidget*); private: + QString createPlane(const QString& objectName, const QString& placement) const; + QString createBox(const QString& objectName, const QString& placement) const; + QString createCylinder(const QString& objectName, const QString& placement) const; + QString createCone(const QString& objectName, const QString& placement) const; + QString createSphere(const QString& objectName, const QString& placement) const; + QString createEllipsoid(const QString& objectName, const QString& placement) const; + QString createTorus(const QString& objectName, const QString& placement) const; + QString createPrism(const QString& objectName, const QString& placement) const; + QString createWedge(const QString& objectName, const QString& placement) const; + QString createHelix(const QString& objectName, const QString& placement) const; + QString createSpiral(const QString& objectName, const QString& placement) const; + QString createCircle(const QString& objectName, const QString& placement) const; + QString createEllipse(const QString& objectName, const QString& placement) const; + QString createVertex(const QString& objectName, const QString& placement) const; + QString createLine(const QString& objectName, const QString& placement) const; + QString createRegularPolygon(const QString& objectName, const QString& placement) const; + + QString changePlane(const QString& objectName, const QString& placement) const; + QString changeBox(const QString& objectName, const QString& placement) const; + QString changeCylinder(const QString& objectName, const QString& placement) const; + QString changeCone(const QString& objectName, const QString& placement) const; + QString changeSphere(const QString& objectName, const QString& placement) const; + QString changeEllipsoid(const QString& objectName, const QString& placement) const; + QString changeTorus(const QString& objectName, const QString& placement) const; + QString changePrism(const QString& objectName, const QString& placement) const; + QString changeWedge(const QString& objectName, const QString& placement) const; + QString changeHelix(const QString& objectName, const QString& placement) const; + QString changeSpiral(const QString& objectName, const QString& placement) const; + QString changeCircle(const QString& objectName, const QString& placement) const; + QString changeEllipse(const QString& objectName, const QString& placement) const; + QString changeVertex(const QString& objectName, const QString& placement) const; + QString changeLine(const QString& objectName, const QString& placement) const; + QString changeRegularPolygon(const QString& objectName, const QString& placement) const; + static void pickCallback(void * ud, SoEventCallback * n); void executeCallback(Picker*); void connectSignalMapper(QWidget *sender, const char *signal, QSignalMapper* mapper); diff --git a/src/Mod/Part/Gui/Resources/translations/Part.ts b/src/Mod/Part/Gui/Resources/translations/Part.ts index c29f5272b3..b302c4ab1e 100644 --- a/src/Mod/Part/Gui/Resources/translations/Part.ts +++ b/src/Mod/Part/Gui/Resources/translations/Part.ts @@ -3,6 +3,16 @@ AttachmentEditor + + + Attachment... + + + + + Edit attachment of selected object. + + No object named {name} @@ -24,13 +34,13 @@ - - Attachment + + Continue - - Continue + + Attachment @@ -98,24 +108,14 @@ Attachment Offset: - - - Attachment Offset (in local coordinates): - - Attachment Offset (inactive - not attached): - - Attachment... - - - - - Edit attachment of selected object. + + Attachment Offset (in local coordinates): @@ -246,88 +246,8 @@ It will create a 'Compound Filter' for each shape. - - Part_JoinFeatures - - - Computing the result failed with an error: - -{err} - -Click 'Continue' to create the feature anyway, or 'Abort' to cancel. - - - - - Bad selection - - - - - Continue - - - - - Computing the result failed with an error: - -{err} - - Click 'Continue' to create the feature anyway, or 'Abort' to cancel. - - - - - Select at least two objects, or one or more compounds, first! - - - - - Select at least two objects, or one or more compounds - - - - - Select base object, then the object to embed, and invoke this tool. - - - - - Select base object, then the object to embed, and then invoke this tool. - - - - - Select the object to make a cutout in, then the object that should fit into the cutout, and invoke this tool. - - - - - Select the object to make a cutout in, then the object that should fit into the cutout, and then invoke this tool. - - - Part_SplitFeatures - - - Computing the result failed with an error: - -{err} - -Click 'Continue' to create the feature anyway, or 'Abort' to cancel. - - - - - Bad selection - - - - - Continue - - Boolean fragments @@ -342,43 +262,6 @@ of the original shapes. A 'Compound Filter' can be used to extract the individual slices. - - - Select at least two objects, or one or more compounds. If only one compound is selected, the compounded shapes will be intersected between each other (otherwise, compounds with self-intersections are invalid). - - - - - Slice to compound - - - - - Slice a selected object by using other objects as cutting tools. -The resulting pieces will be stored in a compound. -A 'Compound Filter' can be used to extract the individual slices. - - - - - Select at least two objects. The first one is the object to be sliced; the rest are objects to slice with. - - - - - Slice apart - - - - - Boolean Fragments - - - - - Split objects where they intersect - - Split object by intersections with other objects, and pack the pieces into a compound. @@ -395,9 +278,8 @@ A 'Compound Filter' can be used to extract the individual slices. - - Slice a selected object by other objects, and split it apart. -It will create a 'Compound Filter' for each slice. + + Select at least two objects. The first one is the object to be sliced; the rest are objects to slice with. @@ -419,6 +301,44 @@ Click 'Continue' to create the feature anyway, or 'Abort' to Select at least two objects, or one or more compounds, first! If only one compound is selected, the compounded shapes will be intersected between each other (otherwise, compounds with self-intersections are invalid). + + + Select at least two objects, or one or more compounds. If only one compound is selected, the compounded shapes will be intersected between each other (otherwise, compounds with self-intersections are invalid). + + + + + Slice to compound + + + + + Boolean Fragments + + + + + Split objects where they intersect + + + + + Slice a selected object by using other objects as cutting tools. +The resulting pieces will be stored in a compound. +A 'Compound Filter' can be used to extract the individual slices. + + + + + Slice apart + + + + + Slice a selected object by other objects, and split it apart. +It will create a 'Compound Filter' for each slice. + + Boolean XOR @@ -432,6 +352,25 @@ This means the overlapping volumes of the shapes will be removed. A 'Compound Filter' can be used to extract the remaining pieces. + + + Bad selection + + + + + Computing the result failed with an error: + +{err} + +Click 'Continue' to create the feature anyway, or 'Abort' to cancel. + + + + + Continue + + Part_Tube @@ -914,6 +853,67 @@ Do you want to continue? + + Part_JoinFeatures + + + Computing the result failed with an error: + +{err} + + Click 'Continue' to create the feature anyway, or 'Abort' to cancel. + + + + + Computing the result failed with an error: + +{err} + +Click 'Continue' to create the feature anyway, or 'Abort' to cancel. + + + + + Continue + + + + + Select at least two objects, or one or more compounds, first! + + + + + Select at least two objects, or one or more compounds + + + + + Select base object, then the object to embed, and invoke this tool. + + + + + Select base object, then the object to embed, and then invoke this tool. + + + + + Select the object to make a cutout in, then the object that should fit into the cutout, and invoke this tool. + + + + + Bad selection + + + + + Select the object to make a cutout in, then the object that should fit into the cutout, and then invoke this tool. + + + Part_MakeTube diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index f92b3299fc..32bbab3b15 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -543,6 +543,21 @@ void ProfileBased::getUpToFace(TopoDS_Face& upToFace, } } +double ProfileBased::getThroughAllLength() const +{ + TopoDS_Shape profileshape; + TopoDS_Shape base; + profileshape = getVerifiedFace(); + base = getBaseShape(); + Bnd_Box box; + BRepBndLib::Add(base, box); + BRepBndLib::Add(profileshape, box); + box.SetGap(0.0); + // The diagonal of the bounding box, plus 1% extra to eliminate risk of + // co-planar issues, gives a length that is guaranteed to go through all. + return 1.01 * sqrt(box.SquareExtent()); +} + void ProfileBased::generatePrism(TopoDS_Shape& prism, const TopoDS_Shape& sketchshape, const std::string& method, @@ -556,9 +571,7 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism, double Ltotal = L; double Loffset = 0.; if (method == "ThroughAll") - // "ThroughAll" is modelled as a very long, but finite prism to avoid problems with pockets - // Note: 1E6 created problems once... - Ltotal = 1E4; + Ltotal = getThroughAllLength(); if (method == "TwoLengths") { diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.h b/src/Mod/PartDesign/App/FeatureSketchBased.h index 7e13019ba4..7e19be3bf8 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.h +++ b/src/Mod/PartDesign/App/FeatureSketchBased.h @@ -113,6 +113,9 @@ public: //backwards compatibility: profile property was renamed and has different type now virtual void Restore(Base::XMLReader& reader); + // calculate the through all length + double getThroughAllLength() const; + protected: void remapSupportShape(const TopoDS_Shape&); @@ -132,14 +135,14 @@ protected: * Generate a linear prism * It will be a stand-alone solid created with BRepPrimAPI_MakePrism */ - static void generatePrism(TopoDS_Shape& prism, - const TopoDS_Shape& sketchshape, - const std::string& method, - const gp_Dir& direction, - const double L, - const double L2, - const bool midplane, - const bool reversed); + void generatePrism(TopoDS_Shape& prism, + const TopoDS_Shape& sketchshape, + const std::string& method, + const gp_Dir& direction, + const double L, + const double L2, + const bool midplane, + const bool reversed); /** * Generate a linear prism * It will be a stand-alone solid created with BRepFeat_MakePrism diff --git a/src/Mod/PartDesign/Gui/ViewProviderHelix.cpp b/src/Mod/PartDesign/Gui/ViewProviderHelix.cpp index d1ec60c4c7..67b5309174 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderHelix.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderHelix.cpp @@ -68,9 +68,9 @@ QIcon ViewProviderHelix::getIcon(void) const { QString str = QString::fromLatin1("PartDesign_"); auto* prim = static_cast(getObject()); if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive) - str += QString::fromLatin1("Additive_"); + str += QString::fromLatin1("Additive"); else - str += QString::fromLatin1("Subtractive_"); + str += QString::fromLatin1("Subtractive"); str += QString::fromLatin1("Helix.svg"); return PartDesignGui::ViewProvider::mergeGreyableOverlayIcons(Gui::BitmapFactory().pixmap(str.toStdString().c_str())); diff --git a/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp b/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp index 74ac82d685..8cbb387b47 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderLoft.cpp @@ -169,9 +169,9 @@ QIcon ViewProviderLoft::getIcon(void) const { QString str = QString::fromLatin1("PartDesign_"); auto* prim = static_cast(getObject()); if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive) - str += QString::fromLatin1("Additive_"); + str += QString::fromLatin1("Additive"); else - str += QString::fromLatin1("Subtractive_"); + str += QString::fromLatin1("Subtractive"); str += QString::fromLatin1("Loft.svg"); return PartDesignGui::ViewProvider::mergeGreyableOverlayIcons(Gui::BitmapFactory().pixmap(str.toStdString().c_str())); diff --git a/src/Mod/PartDesign/Gui/ViewProviderPipe.cpp b/src/Mod/PartDesign/Gui/ViewProviderPipe.cpp index 129c19116f..490bddf704 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderPipe.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderPipe.cpp @@ -202,9 +202,9 @@ QIcon ViewProviderPipe::getIcon(void) const { QString str = QString::fromLatin1("PartDesign_"); auto* prim = static_cast(getObject()); if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive) - str += QString::fromLatin1("Additive_"); + str += QString::fromLatin1("Additive"); else - str += QString::fromLatin1("Subtractive_"); + str += QString::fromLatin1("Subtractive"); str += QString::fromLatin1("Pipe.svg"); return PartDesignGui::ViewProvider::mergeGreyableOverlayIcons(Gui::BitmapFactory().pixmap(str.toStdString().c_str())); diff --git a/src/Mod/PartDesign/Gui/ViewProviderPrimitive.cpp b/src/Mod/PartDesign/Gui/ViewProviderPrimitive.cpp index 531dcec642..dddb5b5782 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderPrimitive.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderPrimitive.cpp @@ -140,9 +140,9 @@ QIcon ViewProviderPrimitive::getIcon(void) const { QString str = QString::fromLatin1("PartDesign_"); auto* prim = static_cast(getObject()); if(prim->getAddSubType() == PartDesign::FeatureAddSub::Additive) - str += QString::fromLatin1("Additive_"); + str += QString::fromLatin1("Additive"); else - str += QString::fromLatin1("Subtractive_"); + str += QString::fromLatin1("Subtractive"); switch(prim->getPrimitiveType()) { case PartDesign::FeaturePrimitive::Box: diff --git a/src/Mod/Path/Gui/Resources/translations/Path.ts b/src/Mod/Path/Gui/Resources/translations/Path.ts index f31cda775a..e7925bf968 100644 --- a/src/Mod/Path/Gui/Resources/translations/Path.ts +++ b/src/Mod/Path/Gui/Resources/translations/Path.ts @@ -8,26 +8,6 @@ Show the temporary path construction objects when module is in DEBUG mode. - - - Smaller values yield a finer, more accurate mesh. Smaller values increase processing time a lot. - - - - - Smaller values yield a finer, more accurate mesh. Smaller values do not increase processing time much. - - - - - Stop index(angle) for rotational scan - - - - - Dropcutter lines are created parallel to this axis. - - The direction along which dropcutter lines are created @@ -38,11 +18,6 @@ Should the operation be limited by the stock object or by the bounding box of the base object - - - Additional offset to the selected bounding box - - Step over percentage of the drop cutter path @@ -63,6 +38,16 @@ Enable optimization which removes unnecessary points from G-Code output + + + Smaller values yield a finer, more accurate mesh. Smaller values increase processing time a lot. + + + + + Smaller values yield a finer, more accurate mesh. Smaller values do not increase processing time much. + + The completion mode for the operation: single or multi-pass @@ -73,6 +58,36 @@ The direction that the toolpath should go around the part: Climb(ClockWise) or Conventional(CounterClockWise) + + + Stop index(angle) for rotational scan + + + + + Ignore areas that proceed below specified depth. + + + + + Depth used to identify waste areas to ignore. + + + + + Cut through waste to depth at model edge, releasing the model. + + + + + Dropcutter lines are created parallel to this axis. + + + + + Additional offset to the selected bounding box + + The model will be rotated around this axis. @@ -83,26 +98,11 @@ Start index(angle) for rotational scan - - - Ignore areas that proceed below specified depth. - - Planar: Flat, 3D surface scan. Rotational: 4th-axis rotational scan. - - - Depth used to identify waste areas to ignore. - - - - - Cut through waste to depth at model edge, releasing the model. - - Avoid cutting the last 'N' faces in the Base Geometry list of selected faces. @@ -243,6 +243,11 @@ The path to be copied + + + The base geometry of this toolpath + + The tool controller that will be used to calculate the path @@ -418,6 +423,11 @@ Controls how tool retracts Default=G98 + + + The height where feed starts and height during retract tool when path is finished + + Controls how tool retracts Default=G99 @@ -433,11 +443,6 @@ How far the drill depth is extended - - - The height where feed starts and height during retract tool when path is finished - - Enable rotation to gain access to pockets/areas not normal to Z axis. @@ -583,11 +588,6 @@ Extra offset to apply to the operation. Direction is operation dependent. - - - The library to use to generate the path - - Start pocketing at center or boundary @@ -638,11 +638,6 @@ Controls how tool moves around corners. Default=Round - - - Extend the profile clearing beyond the Extra Offset. - - Maximum distance before a miter join is truncated @@ -679,8 +674,13 @@ - - The base geometry of this toolpath + + The library to use to generate the path + + + + + Extend the profile clearing beyond the Extra Offset. @@ -916,11 +916,6 @@ Didn't find job %s - - - Invalid Cutting Edge Angle %.2f, must be <90° and >=0° - - Illegal arc: Start and end radii not equal @@ -931,14 +926,19 @@ Invalid Cutting Edge Angle %.2f, must be >0° and <=180° + + + Invalid Cutting Edge Angle %.2f, must be >0° and <=180° + + Cutting Edge Angle (%.2f) results in negative tool tip length - - Invalid Cutting Edge Angle %.2f, must be >0° and <=180° + + Invalid Cutting Edge Angle %.2f, must be <90° and >=0° @@ -1036,19 +1036,24 @@ Pick Start Point + + + Consider toggling the InverseAngle property and recomputing the operation. + + Verify final depth of pocket shaped by vertical faces. - - Processing model as a whole ... + + Depth Warning - - Consider toggling the InverseAngle property and recomputing the operation. + + Processing model as a whole ... @@ -1080,11 +1085,6 @@ Processing subs individually ... - - - Depth Warning - - Selected faces form loop. Processing looped faces. @@ -1145,6 +1145,11 @@ Rotated to inverse angle. + + + Rotated to 'InverseAngle' to attempt access. + + Selected feature(s) require 'Enable Rotation: A(x)' for access. @@ -1170,11 +1175,6 @@ Feature %s.%s cannot be processed as a circular hole - please remove from Base geometry list. - - - Rotated to 'InverseAngle' to attempt access. - - Always select the bottom edge of the hole when using an edge. @@ -1583,6 +1583,11 @@ Increased to stock top. Arguments for the Post Processor (specific to the script) + + + Collection of tool controllers available for this job. + + Last Time the Job was post-processed @@ -1608,11 +1613,6 @@ Increased to stock top. Compound path of all operations in the order they are processed. - - - Collection of tool controllers available for this job. - - Split output into multiple gcode files @@ -1893,16 +1893,6 @@ If it is necessary to set the FinalDepth manually please select a different oper Final depth set below ZMin of face(s) selected. - - - Pocket Shape - - - - - Creates a Path Pocket object from a face or faces - - Normal @@ -1918,6 +1908,16 @@ If it is necessary to set the FinalDepth manually please select a different oper Y + + + Pocket Shape + + + + + Creates a Path Pocket object from a face or faces + + 3D Pocket @@ -2020,11 +2020,6 @@ If it is necessary to set the FinalDepth manually please select a different oper failed to return opening type. - - - Please set to an acceptable value greater than zero. - - Failed to extract offset(s) for expanded profile. @@ -2035,6 +2030,11 @@ If it is necessary to set the FinalDepth manually please select a different oper Failed to expand profile. + + + Please set to an acceptable value greater than zero. + + For open edges, verify Final Depth for this operation. @@ -2312,6 +2312,11 @@ If it is necessary to set the FinalDepth manually please select a different oper Current offset value is not possible. + + + Current Extend Radius value produces negative arc radius. + + No path extensions available for full circles. @@ -2357,6 +2362,11 @@ If it is necessary to set the FinalDepth manually please select a different oper Current tool larger than arc diameter. + + + Failed, slot from edge only accepts lines, arcs and circles. + + Failed to determine point 1 from @@ -2377,6 +2387,11 @@ If it is necessary to set the FinalDepth manually please select a different oper The selected face is not oriented vertically: + + + Current offset value produces negative radius. + + PathStock @@ -3086,6 +3101,12 @@ If it is necessary to set the FinalDepth manually please select a different oper Cutoff for removing colinear segments (degrees). default=10.0. + + + Cutoff for removing colinear segments (degrees). + default=10.0. + + The Job Base Object has no engraveable element. Engraving operation will produce no output. @@ -3267,6 +3288,16 @@ If it is necessary to set the FinalDepth manually please select a different oper Path_Dressup + + + Dress-up + + + + + Creates a Path Dess-up object from a selected path + + Please select one path object @@ -3284,16 +3315,6 @@ If it is necessary to set the FinalDepth manually please select a different oper Please select a Path object - - - Dress-up - - - - - Creates a Path Dess-up object from a selected path - - Path_DressupAxisMap @@ -3766,12 +3787,6 @@ If it is necessary to set the FinalDepth manually please select a different oper Creates a Path Hop object - - - The selected object is not a path - - - Please select one path object @@ -3787,6 +3802,12 @@ If it is necessary to set the FinalDepth manually please select a different oper Create Hop + + + The selected object is not a path + + + Path_Inspect @@ -4033,11 +4054,41 @@ If it is necessary to set the FinalDepth manually please select a different oper Path_Sanity + + + The Job has no selected Base object. + + Check the path job for common errors + + + A Postprocessor has not been selected. + + + + + No output file is named. You'll be prompted during postprocessing. + + + + + No active operations was found. Post processing will not result in any tooling. + + + + + A Tool Controller was not found. Default values are used which is dangerous. Please add a Tool Controller. + + + + + No issues detected, {} has passed basic sanity check. + + Base Object(s) @@ -4088,36 +4139,6 @@ If it is necessary to set the FinalDepth manually please select a different oper Minimum Z Height - - - The Job has no selected Base object. - - - - - A Postprocessor has not been selected. - - - - - No output file is named. You'll be prompted during postprocessing. - - - - - No active operations was found. Post processing will not result in any tooling. - - - - - A Tool Controller was not found. Default values are used which is dangerous. Please add a Tool Controller. - - - - - No issues detected, {} has passed basic sanity check. - - Maximum Z Height @@ -4338,12 +4359,6 @@ If it is necessary to set the FinalDepth manually please select a different oper Path_SimpleCopy - - - Please select exactly one path object - - - Simple Copy @@ -4354,6 +4369,12 @@ If it is necessary to set the FinalDepth manually please select a different oper Creates a non-parametric copy of another path + + + Please select exactly one path object + + + Please select exactly one path object @@ -4443,11 +4464,6 @@ If it is necessary to set the FinalDepth manually please select a different oper Path_ToolController - - - Tool Number to Load - - Add Tool Controller to the Job @@ -4458,6 +4474,11 @@ If it is necessary to set the FinalDepth manually please select a different oper Add Tool Controller + + + Tool Number to Load + + Path_ToolTable @@ -4484,11 +4505,6 @@ If it is necessary to set the FinalDepth manually please select a different oper Creates a medial line engraving path - - - VCarve requires an engraving cutter with CuttingEdgeAngle - - VCarve requires an engraving cutter with CuttingEdgeAngle @@ -4499,6 +4515,11 @@ If it is necessary to set the FinalDepth manually please select a different oper Engraver Cutting Edge Angle must be < 180 degrees. + + + VCarve requires an engraving cutter with CuttingEdgeAngle + + Path_Waterline @@ -4533,56 +4554,11 @@ If it is necessary to set the FinalDepth manually please select a different oper Save toolbit library - - - Tooltable JSON (*.json) - - - - - HeeksCAD tooltable (*.tooltable) - - - - - LinuxCNC tooltable (*.tbl) - - Open tooltable - - - Save tooltable - - - - - Rename Tooltable - - - - - Enter Name: - - - - - Add New Tool Table - - - - - Delete Selected Tool Table - - - - - Rename Selected Tool Table - - Tooltable editor @@ -4793,6 +4769,11 @@ If it is necessary to set the FinalDepth manually please select a different oper Tooltable XML (*.xml);;HeeksCAD tooltable (*.tooltable) + + + Save tooltable + + Tooltable XML (*.xml) @@ -4808,6 +4789,46 @@ If it is necessary to set the FinalDepth manually please select a different oper Object doesn't have a tooltable property + + + Rename Tooltable + + + + + Enter Name: + + + + + Add New Tool Table + + + + + Delete Selected Tool Table + + + + + Rename Selected Tool Table + + + + + Tooltable JSON (*.json) + + + + + HeeksCAD tooltable (*.tooltable) + + + + + LinuxCNC tooltable (*.tbl) + + Tooltable XML (*.xml);;LinuxCNC tooltable (*.tbl) diff --git a/src/Mod/Plot/resources/translations/Plot.ts b/src/Mod/Plot/resources/translations/Plot.ts index 48430a1640..49136802b9 100644 --- a/src/Mod/Plot/resources/translations/Plot.ts +++ b/src/Mod/Plot/resources/translations/Plot.ts @@ -1,14 +1,14 @@ - + Plot - + Plot edition tools - + Plot @@ -16,12 +16,12 @@ Plot_Axes - + Configure axes - + Configure the axes parameters @@ -29,12 +29,12 @@ Plot_Grid - + Show/Hide grid - + Show/Hide grid on selected plot @@ -42,12 +42,12 @@ Plot_Labels - + Set labels - + Set title and axes labels @@ -55,12 +55,12 @@ Plot_Legend - + Show/Hide legend - + Show/Hide legend on selected plot @@ -68,12 +68,12 @@ Plot_Positions - + Set positions and sizes - + Set labels and legend positions and sizes @@ -81,12 +81,12 @@ Plot_SaveFig - + Save plot - + Save the plot as an image file @@ -94,12 +94,12 @@ Plot_Series - + Configure series - + Configure series drawing style and label @@ -107,107 +107,107 @@ plot_axes - + Configure axes - + Active axes - + Apply to all axes - + Dimensions - + X axis position - + Y axis position - + Scales - + X auto - + Y auto - + Index of the active axes - + Add new axes to the plot - + Remove selected axes - + Check it to apply transformations to all axes - + Left bound of axes - + Right bound of axes - + Bottom bound of axes - + Top bound of axes - + Outward offset of X axis - + Outward offset of Y axis - + X axis scale autoselection - + Y axis scale autoselection @@ -215,32 +215,32 @@ plot_console - + matplotlib not found, so Plot module can not be loaded - + matplotlib not found, Plot module will be disabled - + Plot document must be selected in order to save it - + Axes 0 can not be deleted - + The grid must be activated on top of a plot document - + The legend must be activated on top of a plot document @@ -248,62 +248,62 @@ plot_labels - + Set labels - + Active axes - + Title - + X label - + Y label - + Index of the active axes - + Title (associated to active axes) - + Title font size - + X axis title - + X axis title font size - + Y axis title - + Y axis title font size @@ -311,37 +311,37 @@ plot_positions - + Set positions and sizes - + Position - + Size - + X item position - + Y item position - + Item size - + List of modifiable items @@ -349,42 +349,42 @@ plot_save - + Save figure - + Inches - + Dots per Inch - + Output image file path - + Show a file selection dialog - + X image size - + Y image size - + Dots per point, with size will define output image resolution @@ -392,67 +392,67 @@ plot_series - + No label - + Line style - + Marker - + Configure series - + List of available series - + Line title - + Marker style - + Line width - + Marker size - + Line and marker color - + Remove series - + If checked, series will not be considered for legend - + Removes this series diff --git a/src/Mod/Ship/resources/translations/Ship.ts b/src/Mod/Ship/resources/translations/Ship.ts index a4bf9aba61..aeea474f99 100644 --- a/src/Mod/Ship/resources/translations/Ship.ts +++ b/src/Mod/Ship/resources/translations/Ship.ts @@ -1,54 +1,54 @@ - + Ship - + Ship design - + Weights - + True if it is a valid ship instance, False otherwise - + Ship length [m] - + Ship breadth [m] - + Ship draft [m] - + Set of external faces of the ship hull - + Set of weight instances - + Set of tank instances - + Set of load conditions @@ -56,12 +56,12 @@ Ship_AreasCurve - + Areas curve - + Plot the transversal areas curve @@ -69,12 +69,12 @@ Ship_CreateShip - + Create a new ship - + Create a new ship instance on top of the hull geometry @@ -82,12 +82,12 @@ Ship_Hydrostatics - + Hydrostatics - + Plot the ship hydrostatics @@ -95,12 +95,12 @@ Ship_LoadExample - + Load an example ship geometry - + Load an example ship hull geometry. @@ -108,12 +108,12 @@ Ship_OutlineDraw - + Outline draw - + Plots the ship hull outline draw @@ -121,42 +121,42 @@ ship_areas - + Draft - + Displacement - + Areas curve tool draft selected [m] - + Plot the transversal areas curve - + Areas curve tool trim selected [deg] - + Trim angle - + Number of points - + Areas curve tool number of points @@ -164,22 +164,22 @@ ship_capacity - + Tank capacity curve - + Plot the tank capacity curve (level-volume curve) - + Plot the tank capacity curve - + Number of points @@ -187,202 +187,202 @@ ship_console - + Please create or load a ship hull geometry before using this tool - + Ship objects can only be created on top of hull geometry (no solid found at selected objects) - + Computing hydrostatics - + Computing external faces - + Computing sections - + Any valid ship section found - + Ship objects can only be created on top of hull geometry (no objects selected) - + A ship instance must be selected before using this tool (no objects selected) - + More than one ship have been selected (the extra ships will be ignored) - + A ship instance must be selected before using this tool (no valid ship found at the selected objects) - + Plot module is disabled, so I cannot perform the plot - + A ship instance must be selected before use this tool (no objects selected) - + More than one ship has been selected (just the first one will be used) - + A ship instance must be selected before use this tool (novalid ships found in the selected objects) - + Plot module is disabled, tools cannot graph output curves - + Failure detecting external faces from the ship object - + A tank instance must be selected before using this tool (no objects selected) - + More than one tank have been selected (the extra tanks will be ignored) - + A tank instance must be selected before using this tool (no valid tank found at the selected objects) - + Tank volume operation failed. The tool is retrying that slightly moving the free surface position - + A loading condition instance must be selected before using this tool (no objects selected) - + Wrong Ship label! (no instances labeled as'{}' found) - + Ambiguous Ship label! ({} instances labeled as'{}' found) - + More than one loading condition have been selected (the extra loading conditions will be ignored) - + A loading condition instance must be selected before using this tool (no valid loading condition found at the selected objects) - + Too much weight! The ship will never displace water enough - + Wrong Weight label! (no instances labeled as'{}' found) - + Ambiguous Weight label! ({} instances labeled as'{}' found) - + Invalid Weight! (the object labeled as'{}' is not a weight) - + Wrong Tank label! (no instances labeled as'{}' found) - + Ambiguous Tank label! ({} instances labeled as'{}' found) - + Invalid Tank! (the object labeled as'{}' is not a tank) - + Computing capacity curves - + Boolean operation failed when trying to get the underwater side. The tool is retrying such operation slightly moving the free surface position - + Part.OCCError: Transversal area computation failed - + ZeroDivisionError: Null volume found during the displacement computation! - + Part.OCCError: Floating area cannot be computed - + ZeroDivisionError: Null area found during the floating area computation! - + Part.OCCError: Main frame area cannot be computed - + ZeroDivisionError: Null area found during the main frame area coefficient computation! @@ -390,47 +390,47 @@ ship_create - + Base line - + Free surface - + Forward perpendicular - + After perpendicular - + Main frame - + Create a new ship - + Length - + Breadth - + Draft @@ -438,47 +438,47 @@ ship_gz - + GZ curve computation - + Plot the GZ curve - + Maximum angle - + Number of points - + Variable trim - + The ship will be rotated to the equilibrium trim angle for each roll angle. It will significantly increase the required computing time - + GZ curve tool angle selected [deg] - + GZ curve tool number of points selected - + GZ curve tool variable trim angle selection @@ -486,47 +486,47 @@ ship_hydrostatic - + Plot hydrostatics - + Trim - + Minimum draft - + Maximum draft - + Number of points - + Hydrostatics tool trim selected - + Hydrostatics tool minimum draft selected [m] - + Hydrostatics tool maximum draft selected [m] - + Hydrostatics tool number of points selected @@ -534,12 +534,12 @@ ship_load - + Load example ship - + Select ship example geometry @@ -547,12 +547,12 @@ ship_loadcondition - + Create a new loading condition - + Create a new load condition spreadsheet @@ -560,52 +560,52 @@ ship_outline - + Outline draw - + Auto create - + Delete all sections - + Create sections - + Transversal - + Longitudinal - + Water lines - + Transversal section positions [m] - + Longitudinal section positions [m] - + Water line positions [m] @@ -613,32 +613,32 @@ ship_tank - + True if it is a valid tank instance, False otherwise - + Create a new tank - + Tanks objects can only be created on top of its geometry (no objects selected) - + No solids found in the selected objects - + There are not ship objects to create weights into them - + Ship @@ -646,82 +646,82 @@ ship_weight - + Create a new ship weight - + True if it is a valid weight instance, False otherwise - + Mass [kg] - + Linear density [kg / m] - + Density [kg / m^3] - + Weight objects can only be created on top of its geometry (no objects selected) - + No geometrical shapes found in the selected objects - + There are not ship objects to create weights into them - + Create a new weight - + Ship - + Mass - + Linear density - + Area density - + Density - + Area density [kg / m^2] - + Unknown object shapes selected diff --git a/src/Mod/Sketcher/Gui/Resources/translations/Sketcher.ts b/src/Mod/Sketcher/Gui/Resources/translations/Sketcher.ts index 21f673ca57..1499aa6155 100644 --- a/src/Mod/Sketcher/Gui/Resources/translations/Sketcher.ts +++ b/src/Mod/Sketcher/Gui/Resources/translations/Sketcher.ts @@ -2569,47 +2569,47 @@ invalid constraints, degenerated geometry, etc. - + Unable to guess intersection of curves. Try adding a coincident constraint between the vertices of the curves you are intending to fillet. - + This version of OCE/OCC does not support knot operation. You need 6.9.0 or higher. - + BSpline Geometry Index (GeoID) is out of bounds. - + You are requesting no change in knot multiplicity. - + The Geometry Index (GeoId) provided is not a B-spline curve. - + The knot index is out of bounds. Note that in accordance with OCC notation, the first knot has index 1 and not zero. - + The multiplicity cannot be increased beyond the degree of the B-spline. - + The multiplicity cannot be decreased beyond zero. - + OCC is unable to decrease the multiplicity within the maximum tolerance. @@ -5984,6 +5984,11 @@ to determine whether a solution converges or not + Sketcher B-spline tools + + + + Sketcher virtual space diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index 381418142c..a0a1f6916d 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -241,7 +241,7 @@ bool Sheet::exportToFile(const std::string &filename, char delimiter, char quote if (prevRow != -1 && prevRow != i->row()) { for (int j = prevRow; j < i->row(); ++j) file << std::endl; - prevCol = 0; + prevCol = usedCells.begin()->col(); } if (prevCol != -1 && i->col() != prevCol) { for (int j = prevCol; j < i->col(); ++j) diff --git a/src/Mod/TechDraw/Gui/Resources/translations/TechDraw.ts b/src/Mod/TechDraw/Gui/Resources/translations/TechDraw.ts index 24d47b8763..abd1ba8b0f 100644 --- a/src/Mod/TechDraw/Gui/Resources/translations/TechDraw.ts +++ b/src/Mod/TechDraw/Gui/Resources/translations/TechDraw.ts @@ -268,6 +268,11 @@ Change Appearance of Lines + + + Change Appearance of selected Lines + + CmdTechDrawDetailView @@ -5055,4 +5060,72 @@ using the given X/Y Spacing + + Workbench + + + Dimensions + + + + + Annotations + + + + + Add Lines + + + + + Add Vertices + + + + + TechDraw + + + + + TechDraw Pages + + + + + TechDraw Views + + + + + TechDraw Clips + + + + + TechDraw Dimensions + + + + + TechDraw File Access + + + + + TechDraw Decoration + + + + + TechDraw Annotation + + + + + Views + + + diff --git a/src/Mod/TechDraw/Gui/TaskBalloon.cpp b/src/Mod/TechDraw/Gui/TaskBalloon.cpp index 3f0c26667a..c64d2a9b63 100644 --- a/src/Mod/TechDraw/Gui/TaskBalloon.cpp +++ b/src/Mod/TechDraw/Gui/TaskBalloon.cpp @@ -50,6 +50,7 @@ #include "QGIViewBalloon.h" #include "ViewProviderBalloon.h" #include "TaskBalloon.h" +#include "ui_TaskBalloon.h" using namespace Gui; using namespace TechDraw; @@ -88,15 +89,13 @@ TaskBalloon::TaskBalloon(QGIViewBalloon *parent, ViewProviderBalloon *balloonVP) ui->qsbFontSize->setUnit(Base::Unit::Length); ui->qsbFontSize->setMinimum(0); - connect(ui->qsbFontSize, SIGNAL(valueChanged(double)), this, SLOT(onFontsizeChanged())); - connect(ui->comboLineVisible, SIGNAL(currentIndexChanged(int)), this, SLOT(onLineVisibleChanged())); + ui->qsbLineWidth->setUnit(Base::Unit::Length); ui->qsbLineWidth->setSingleStep(0.100); ui->qsbLineWidth->setMinimum(0); - connect(ui->qsbLineWidth, SIGNAL(valueChanged(double)), this, SLOT(onLineWidthChanged())); - ui->qsbKinkLength->setUnit(Base::Unit::Length); + // negative kink length is allowed, thus no minimum - connect(ui->qsbKinkLength, SIGNAL(valueChanged(double)), this, SLOT(onKinkLengthChanged())); + ui->qsbKinkLength->setUnit(Base::Unit::Length); if (balloonVP != nullptr) { ui->textColor->setColor(balloonVP->Color.getValue().asValue()); @@ -107,6 +106,11 @@ TaskBalloon::TaskBalloon(QGIViewBalloon *parent, ViewProviderBalloon *balloonVP) } // new balloons have already the preferences BalloonKink length ui->qsbKinkLength->setValue(parent->dvBalloon->KinkLength.getValue()); + + connect(ui->qsbFontSize, SIGNAL(valueChanged(double)), this, SLOT(onFontsizeChanged())); + connect(ui->comboLineVisible, SIGNAL(currentIndexChanged(int)), this, SLOT(onLineVisibleChanged())); + connect(ui->qsbLineWidth, SIGNAL(valueChanged(double)), this, SLOT(onLineWidthChanged())); + connect(ui->qsbKinkLength, SIGNAL(valueChanged(double)), this, SLOT(onKinkLengthChanged())); } TaskBalloon::~TaskBalloon() @@ -115,26 +119,24 @@ TaskBalloon::~TaskBalloon() bool TaskBalloon::accept() { - m_parent->dvBalloon->Text.setValue(ui->leText->text().toUtf8().constData()); - App::Color ac; - ac.setValue(ui->textColor->color()); - m_balloonVP->Color.setValue(ac); - m_balloonVP->Fontsize.setValue(ui->qsbFontSize->value().getValue()); - m_parent->dvBalloon->ShapeScale.setValue(ui->qsbShapeScale->value().getValue()); - m_parent->dvBalloon->EndType.setValue(ui->comboEndSymbol->currentIndex()); - m_parent->dvBalloon->EndTypeScale.setValue(ui->qsbSymbolScale->value().getValue()); - m_parent->dvBalloon->BubbleShape.setValue(ui->comboBubbleShape->currentIndex()); - m_balloonVP->LineVisible.setValue(ui->comboLineVisible->currentIndex()); - m_balloonVP->LineWidth.setValue(ui->qsbLineWidth->value().getValue()); - m_parent->dvBalloon->KinkLength.setValue(ui->qsbKinkLength->value().getValue()); - m_parent->updateView(true); + Gui::Document* doc = m_balloonVP->getDocument(); + m_balloonVP->getObject()->purgeTouched(); + doc->commitCommand(); + doc->resetEdit(); return true; } bool TaskBalloon::reject() { - return false; + Gui::Document* doc = m_balloonVP->getDocument(); + doc->abortCommand(); + recomputeFeature(); + m_parent->updateView(true); + m_balloonVP->getObject()->purgeTouched(); + doc->resetEdit(); + + return true; } void TaskBalloon::recomputeFeature() @@ -215,6 +217,7 @@ TaskDlgBalloon::TaskDlgBalloon(QGIViewBalloon *parent, ViewProviderBalloon *ball taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("TechDraw_Balloon"), widget->windowTitle(), true, 0); taskbox->groupLayout()->addWidget(widget); Content.push_back(taskbox); + setAutoCloseOnTransactionChange(true); } TaskDlgBalloon::~TaskDlgBalloon() diff --git a/src/Mod/TechDraw/Gui/TaskBalloon.h b/src/Mod/TechDraw/Gui/TaskBalloon.h index 7d31713e76..4f74d5c626 100644 --- a/src/Mod/TechDraw/Gui/TaskBalloon.h +++ b/src/Mod/TechDraw/Gui/TaskBalloon.h @@ -27,16 +27,13 @@ #include #include -#include - #include "QGIViewBalloon.h" #include "ViewProviderBalloon.h" -class Ui_TaskBalloon; - namespace TechDrawGui { +class Ui_TaskBalloon; class TaskBalloon : public QWidget { Q_OBJECT diff --git a/src/Mod/TechDraw/Gui/TaskDimension.cpp b/src/Mod/TechDraw/Gui/TaskDimension.cpp index 83d8690255..838795412f 100644 --- a/src/Mod/TechDraw/Gui/TaskDimension.cpp +++ b/src/Mod/TechDraw/Gui/TaskDimension.cpp @@ -133,32 +133,24 @@ TaskDimension::~TaskDimension() bool TaskDimension::accept() { - m_parent->dvDimension->TheoreticalExact.setValue(ui->cbTheoreticallyExact->isChecked()); - m_parent->dvDimension->EqualTolerance.setValue(ui->cbEqualTolerance->isChecked()); - m_parent->dvDimension->OverTolerance.setValue(ui->qsbOvertolerance->value().getValue()); - m_parent->dvDimension->UnderTolerance.setValue(ui->qsbUndertolerance->value().getValue()); - - m_parent->dvDimension->FormatSpec.setValue(ui->leFormatSpecifier->text().toUtf8().constData()); - m_parent->dvDimension->Arbitrary.setValue(ui->cbArbitrary->isChecked()); - m_parent->dvDimension->FormatSpecOverTolerance.setValue(ui->leFormatSpecifierOverTolerance->text().toUtf8().constData()); - m_parent->dvDimension->FormatSpecUnderTolerance.setValue(ui->leFormatSpecifierUnderTolerance->text().toUtf8().constData()); - m_parent->dvDimension->ArbitraryTolerances.setValue(ui->cbArbitraryTolerances->isChecked()); - - m_dimensionVP->FlipArrowheads.setValue(ui->cbArrowheads->isChecked()); - App::Color ac; - ac.setValue(ui->dimensionColor->color()); - m_dimensionVP->Color.setValue(ac); - m_dimensionVP->Fontsize.setValue(ui->qsbFontSize->value().getValue()); - m_dimensionVP->StandardAndStyle.setValue(ui->comboDrawingStyle->currentIndex()); - - m_parent->updateView(true); + Gui::Document* doc = m_dimensionVP->getDocument(); + m_dimensionVP->getObject()->purgeTouched(); + doc->commitCommand(); + doc->resetEdit(); return true; } bool TaskDimension::reject() { - return false; + Gui::Document* doc = m_dimensionVP->getDocument(); + doc->abortCommand(); + recomputeFeature(); + m_parent->updateView(true); + m_dimensionVP->getObject()->purgeTouched(); + doc->resetEdit(); + + return true; } void TaskDimension::recomputeFeature() @@ -311,6 +303,7 @@ TaskDlgDimension::TaskDlgDimension(QGIViewDimension *parent, ViewProviderDimensi taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("TechDraw_Dimension"), widget->windowTitle(), true, 0); taskbox->groupLayout()->addWidget(widget); Content.push_back(taskbox); + setAutoCloseOnTransactionChange(true); } TaskDlgDimension::~TaskDlgDimension() diff --git a/src/Mod/TechDraw/Gui/TaskDimension.h b/src/Mod/TechDraw/Gui/TaskDimension.h index 97d2a48633..1a53d08b73 100644 --- a/src/Mod/TechDraw/Gui/TaskDimension.h +++ b/src/Mod/TechDraw/Gui/TaskDimension.h @@ -26,16 +26,13 @@ #include #include -#include - #include "QGIViewDimension.h" #include "ViewProviderDimension.h" -class Ui_TaskDimension; - namespace TechDrawGui { +class Ui_TaskDimension; class TaskDimension : public QWidget { Q_OBJECT diff --git a/src/Mod/TechDraw/Gui/ViewProviderBalloon.cpp b/src/Mod/TechDraw/Gui/ViewProviderBalloon.cpp index ae7c0a5186..28450ce266 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderBalloon.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderBalloon.cpp @@ -26,6 +26,8 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include +# include #endif /// Here the FreeCAD includes sorted by Base,App,Gui...... @@ -38,6 +40,7 @@ #include #include +#include #include #include #include @@ -101,6 +104,33 @@ std::vector ViewProviderBalloon::getDisplayModes(void) const return StrList; } +bool ViewProviderBalloon::doubleClicked(void) +{ + startDefaultEditMode(); + return true; +} + +void ViewProviderBalloon::setupContextMenu(QMenu* menu, QObject* receiver, const char* member) +{ + Gui::ActionFunction* func = new Gui::ActionFunction(menu); + QAction* act = menu->addAction(QObject::tr("Edit %1").arg(QString::fromUtf8(getObject()->Label.getValue()))); + act->setData(QVariant((int)ViewProvider::Default)); + func->trigger(act, boost::bind(&ViewProviderBalloon::startDefaultEditMode, this)); + + ViewProviderDrawingView::setupContextMenu(menu, receiver, member); +} + +void ViewProviderBalloon::startDefaultEditMode() +{ + QString text = QObject::tr("Edit %1").arg(QString::fromUtf8(getObject()->Label.getValue())); + Gui::Command::openCommand(text.toUtf8()); + + Gui::Document* document = this->getDocument(); + if (document) { + document->setEdit(this, ViewProvider::Default); + } +} + bool ViewProviderBalloon::setEdit(int ModNum) { if (ModNum == ViewProvider::Default ) { @@ -130,12 +160,6 @@ void ViewProviderBalloon::unsetEdit(int ModNum) } } -bool ViewProviderBalloon::doubleClicked(void) -{ - setEdit(ViewProvider::Default); - return true; -} - void ViewProviderBalloon::updateData(const App::Property* p) { ViewProviderDrawingView::updateData(p); diff --git a/src/Mod/TechDraw/Gui/ViewProviderBalloon.h b/src/Mod/TechDraw/Gui/ViewProviderBalloon.h index 2f88a50434..3dcc7580fb 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderBalloon.h +++ b/src/Mod/TechDraw/Gui/ViewProviderBalloon.h @@ -58,6 +58,7 @@ public: virtual std::vector getDisplayModes(void) const; virtual void updateData(const App::Property*); virtual void onChanged(const App::Property* p); + virtual void setupContextMenu(QMenu*, QObject*, const char*); virtual bool setEdit(int ModNum); virtual void unsetEdit(int ModNum); virtual bool doubleClicked(void); @@ -68,6 +69,8 @@ public: protected: virtual void handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property * prop); +private: + void startDefaultEditMode(); }; } // namespace TechDrawGui diff --git a/src/Mod/TechDraw/Gui/ViewProviderDimension.cpp b/src/Mod/TechDraw/Gui/ViewProviderDimension.cpp index db94996fd1..4ab084793f 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderDimension.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderDimension.cpp @@ -25,6 +25,8 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include +# include #endif #include @@ -38,6 +40,8 @@ #include #include #include +#include +#include #include #include @@ -115,6 +119,33 @@ std::vector ViewProviderDimension::getDisplayModes(void) const return StrList; } +bool ViewProviderDimension::doubleClicked(void) +{ + startDefaultEditMode(); + return true; +} + +void ViewProviderDimension::setupContextMenu(QMenu* menu, QObject* receiver, const char* member) +{ + Gui::ActionFunction* func = new Gui::ActionFunction(menu); + QAction* act = menu->addAction(QObject::tr("Edit %1").arg(QString::fromUtf8(getObject()->Label.getValue()))); + act->setData(QVariant((int)ViewProvider::Default)); + func->trigger(act, boost::bind(&ViewProviderDimension::startDefaultEditMode, this)); + + ViewProviderDrawingView::setupContextMenu(menu, receiver, member); +} + +void ViewProviderDimension::startDefaultEditMode() +{ + QString text = QObject::tr("Edit %1").arg(QString::fromUtf8(getObject()->Label.getValue())); + Gui::Command::openCommand(text.toUtf8()); + + Gui::Document* document = this->getDocument(); + if (document) { + document->setEdit(this, ViewProvider::Default); + } +} + bool ViewProviderDimension::setEdit(int ModNum) { if (ModNum == ViewProvider::Default) { @@ -145,12 +176,6 @@ void ViewProviderDimension::unsetEdit(int ModNum) } } -bool ViewProviderDimension::doubleClicked(void) -{ - setEdit(ViewProvider::Default); - return true; -} - void ViewProviderDimension::updateData(const App::Property* p) { if (p == &(getViewObject()->Type)) { diff --git a/src/Mod/TechDraw/Gui/ViewProviderDimension.h b/src/Mod/TechDraw/Gui/ViewProviderDimension.h index 9b82a34338..6bc047e1aa 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderDimension.h +++ b/src/Mod/TechDraw/Gui/ViewProviderDimension.h @@ -72,6 +72,7 @@ public: virtual std::vector getDisplayModes(void) const; virtual void updateData(const App::Property*); virtual void onChanged(const App::Property* p); + virtual void setupContextMenu(QMenu*, QObject*, const char*); virtual bool setEdit(int ModNum); virtual void unsetEdit(int ModNum); virtual bool doubleClicked(void); @@ -88,6 +89,9 @@ public: protected: virtual void handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property * prop); +private: + void startDefaultEditMode(); + private: static const char *StandardAndStyleEnums[]; static const char *RenderingExtentEnums[]; diff --git a/src/Mod/Tux/Resources/translations/Tux.ts b/src/Mod/Tux/Resources/translations/Tux.ts index 5d6e73862e..6c3c63c907 100644 --- a/src/Mod/Tux/Resources/translations/Tux.ts +++ b/src/Mod/Tux/Resources/translations/Tux.ts @@ -1,94 +1,94 @@ - + NavigationIndicator - + Select - + Zoom - + Rotate - + Pan - + Tilt - + Navigation style - + Page Up or Page Down key. - + Rotation focus - + Middle mouse button. - + Navigation style not recognized. - + Settings - + Orbit style - + Compact - + Tooltip - + Turntable - + Trackball - + Undefined - + Middle mouse button or H key. diff --git a/src/Tools/updatets.py b/src/Tools/updatets.py index 94b3996eba..ed7a2226d6 100755 --- a/src/Tools/updatets.py +++ b/src/Tools/updatets.py @@ -65,9 +65,9 @@ DirFilter = ["^Attic$", # python folders that need a special pylupdate command PyCommands = [["src/Mod/Draft", - "pylupdate *.py Resources/ui/*.ui -ts Resources/translations/Draft.ts"], + 'pylupdate `find ./ -name "*.py"` Resources/ui/*.ui -ts Resources/translations/Draft.ts'], ["src/Mod/Arch", - "pylupdate *.py Resources/ui/*.ui -ts Resources/translations/Arch.ts"], + 'pylupdate `find ./ -name "*.py"` Resources/ui/*.ui -ts Resources/translations/Arch.ts'], ["src/Mod/OpenSCAD", "pylupdate *.py Resources/ui/*.ui -ts Resources/translations/OpenSCAD.ts"], ["src/Mod/Start", @@ -146,7 +146,9 @@ def find_tools(noobsolete=True): LUPDATE += " -noobsolete" else: raise Exception("Cannot find lupdate") - if (os.system("pylupdate -version") == 0): + if (os.system("pyside2-lupdate -version") == 0): + PYLUPDATE = "pyside2-lupdate" + elif (os.system("pylupdate -version") == 0): PYLUPDATE = "pylupdate" elif (os.system("pylupdate5 -version") == 0): PYLUPDATE = "pylupdate5"