From 85cdc56e6075df07b5ee8e0a84a4e76979cb02ec Mon Sep 17 00:00:00 2001 From: sliptonic Date: Tue, 2 Apr 2024 19:01:25 -0500 Subject: [PATCH] translation stuff --- src/Mod/CAM/Path/Main/Gui/JobDlg.py | 12 ++++++------ src/Mod/CAM/Path/Op/Gui/FeatureExtension.py | 8 ++++---- src/Mod/CAM/Path/Op/Gui/Profile.py | 10 +++++----- src/Mod/CAM/Path/Tool/Gui/Bit.py | 8 ++++---- src/Mod/CAM/Path/Tool/Gui/BitLibrary.py | 6 +++++- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/Mod/CAM/Path/Main/Gui/JobDlg.py b/src/Mod/CAM/Path/Main/Gui/JobDlg.py index 464fe34acc..2e15fbd8f6 100644 --- a/src/Mod/CAM/Path/Main/Gui/JobDlg.py +++ b/src/Mod/CAM/Path/Main/Gui/JobDlg.py @@ -64,19 +64,19 @@ class JobCreate: current_schema = FreeCAD.Units.listSchemas(idx) if idx not in [2, 3, 6]: msg = translate( - "Path", + "CAM_Job", "The currently selected unit schema: \n '{}' for this document\n Does not use 'minutes' for velocity values. \n \nCNC machines require feed rate to be expressed in \nunit/minute. To ensure correct G-code: \nSelect a minute-based schema in preferences.\nFor example:\n 'Metric, Small Parts & CNC'\n 'US Customary'\n 'Imperial Decimal'", ).format(current_schema) - header = translate("Path", "Warning") + header = translate("CAM_Job", "Warning") msgbox = QtGui.QMessageBox( QtGui.QMessageBox.Warning, header, msg ) msgbox.addButton( - translate("Path", "Ok"), QtGui.QMessageBox.AcceptRole + translate("CAM_Job", "Ok"), QtGui.QMessageBox.AcceptRole ) msgbox.addButton( - translate("Path", "Don't Show This Anymore"), + translate("CAM_Job", "Don't Show This Anymore"), QtGui.QMessageBox.ActionRole, ) if msgbox.exec_() == 1: @@ -187,7 +187,7 @@ class JobCreate: self.delegate = _ItemDelegate(self, self.dialog.modelTree) self.model = QtGui.QStandardItemModel(self.dialog) - self.model.setHorizontalHeaderLabels(["Model", "Count"]) + self.model.setHorizontalHeaderLabels([translate("CAM_Job","Model"), translate("CAM_Job", "Count")]) if self.itemsSolid.hasChildren(): self.model.appendRow(self.itemsSolid) @@ -269,7 +269,7 @@ class JobCreate: template[name] = tFile selectTemplate = Path.Preferences.defaultJobTemplate() index = 0 - self.dialog.jobTemplate.addItem("", "") + self.dialog.jobTemplate.addItem(translate("CAM_Job", ""), "") for name in sorted(template): if template[name] == selectTemplate: index = self.dialog.jobTemplate.count() diff --git a/src/Mod/CAM/Path/Op/Gui/FeatureExtension.py b/src/Mod/CAM/Path/Op/Gui/FeatureExtension.py index 4baf79a63e..81f184d5f6 100644 --- a/src/Mod/CAM/Path/Op/Gui/FeatureExtension.py +++ b/src/Mod/CAM/Path/Op/Gui/FeatureExtension.py @@ -176,13 +176,13 @@ class TaskPanelExtensionPage(PathOpGui.TaskPanelPage): DataSwitch = QtCore.Qt.ItemDataRole.UserRole + 2 Direction = { - FeatureExtensions.Extension.DirectionNormal: translate("PathPocket", "Normal"), - FeatureExtensions.Extension.DirectionX: translate("PathPocket", "X"), - FeatureExtensions.Extension.DirectionY: translate("PathPocket", "Y"), + FeatureExtensions.Extension.DirectionNormal: translate("CAM_Pocket", "Normal"), + FeatureExtensions.Extension.DirectionX: translate("CAM_Pocket", "X"), + FeatureExtensions.Extension.DirectionY: translate("CAM_Pocket", "Y"), } def initPage(self, obj): - self.setTitle("Extensions") + self.setTitle(translate("CAM_Pocket", "Extensions")) self.OpIcon = ":/icons/view-axonometric.svg" self.setIcon(self.OpIcon) self.initialEdgeCount = -1 diff --git a/src/Mod/CAM/Path/Op/Gui/Profile.py b/src/Mod/CAM/Path/Op/Gui/Profile.py index eb5d2c8e8c..b161bbcde1 100644 --- a/src/Mod/CAM/Path/Op/Gui/Profile.py +++ b/src/Mod/CAM/Path/Op/Gui/Profile.py @@ -45,9 +45,9 @@ class TaskPanelOpPage(PathOpGui.TaskPanelPage): FeatureProcessing ... Are the processing check boxes supported by the operation """ - def initPage(self, obj): - self.setTitle("Profile - " + obj.Label) - self.updateVisibility() + # def initPage(self, obj): + # self.setTitle("Profile - " + obj.Label) + # self.updateVisibility() def profileFeatures(self): """profileFeatures() ... return which of the optional profile features are supported. @@ -162,9 +162,9 @@ Command = PathOpGui.SetupOperation( PathProfile.Create, TaskPanelOpPage, "CAM_Profile", - QT_TRANSLATE_NOOP("CAM", "Profile"), + QT_TRANSLATE_NOOP("CAM_Profile", "Profile"), QT_TRANSLATE_NOOP( - "CAM", "Profile entire model, selected face(s) or selected edge(s)" + "CAM_Profile", "Profile entire model, selected face(s) or selected edge(s)" ), PathProfile.SetupProperties, ) diff --git a/src/Mod/CAM/Path/Tool/Gui/Bit.py b/src/Mod/CAM/Path/Tool/Gui/Bit.py index 7fc3bf4cbc..fc15c0ec88 100644 --- a/src/Mod/CAM/Path/Tool/Gui/Bit.py +++ b/src/Mod/CAM/Path/Tool/Gui/Bit.py @@ -113,7 +113,7 @@ class ViewProvider(object): self.setEdit(vobj) else: msg = translate( - "PathToolBit", "Toolbit cannot be edited: Shapefile not found" + "CAM_Toolbit", "Toolbit cannot be edited: Shapefile not found" ) diag = QtGui.QMessageBox(QtGui.QMessageBox.Warning, "Error", msg) diag.setWindowModality(QtCore.Qt.ApplicationModal) @@ -190,12 +190,12 @@ def GetNewToolFile(parent=None): parent = QtGui.QApplication.activeWindow() foo = QtGui.QFileDialog.getSaveFileName( - parent, "Tool", Path.Preferences.lastPathToolBit(), "*.fctb" + parent, translate("CAM_Toolbit", "Tool"), Path.Preferences.lastPathToolBit(), "*.fctb" ) if foo and foo[0]: if not isValidFileName(foo[0]): msgBox = QtGui.QMessageBox() - msg = translate("Path", "Invalid Filename") + msg = translate("CAM_Toolbit", "Invalid Filename") msgBox.setText(msg) msgBox.exec_() else: @@ -239,7 +239,7 @@ def GetToolShapeFile(parent=None): location = Path.Preferences.filePath() fname = QtGui.QFileDialog.getOpenFileName( - parent, "Select Tool Shape", location, "*.fcstd" + parent, translate("CAM_Toolbit", "Select Tool Shape"), location, "*.fcstd" ) if fname and fname[0]: if fname != location: diff --git a/src/Mod/CAM/Path/Tool/Gui/BitLibrary.py b/src/Mod/CAM/Path/Tool/Gui/BitLibrary.py index f97f60ba6c..c47dcb9edc 100644 --- a/src/Mod/CAM/Path/Tool/Gui/BitLibrary.py +++ b/src/Mod/CAM/Path/Tool/Gui/BitLibrary.py @@ -726,7 +726,11 @@ class ToolBitLibrary(object): return lib, loc def columnNames(self): - return ["Nr", "Tool", "Shape"] + return [ + "Tn", + translate("CAM_ToolBit", "Tool"), + translate("CAM_ToolBit", "Shape"), + ] def loadData(self, path=None): Path.Log.track(path)