Merge pull request #13528 from Ondsel-Development/translation

[path] translation fixes
This commit is contained in:
sliptonic
2024-04-18 19:52:21 -06:00
committed by GitHub
5 changed files with 24 additions and 20 deletions

View File

@@ -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("<none>", "")
self.dialog.jobTemplate.addItem(translate("CAM_Job", "<none>"), "")
for name in sorted(template):
if template[name] == selectTemplate:
index = self.dialog.jobTemplate.count()

View File

@@ -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

View File

@@ -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,
)

View File

@@ -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:

View File

@@ -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)