[PartDesign] Expose WizardShaft/ strings to translation (#4964)

* [PartDesign] Expose WizardShaft/ strings to translation

* Correct use of double quotes

* [PD] Suggested changes in `Crowdin/pd-wizard-shaft` (#4)

* [PartDesign] Use correct method name in `WizardShaft`

Use `QtCore.QT_TRANSLATE_NOOP` instead of `QT_TRANSLATE_NOOP` because latter is
not what is imported.

* [PartDesign] Remove undesired translations in `WizardShaftTable.py`

See comments by @chennes on PR#4964.

Co-authored-by: Ajinkya Dahale <AjinkyaDahale@users.noreply.github.com>
This commit is contained in:
luzpaz
2021-08-13 19:16:42 -04:00
committed by GitHub
parent b0b4b321cb
commit 2a900b1850
2 changed files with 19 additions and 15 deletions

View File

@@ -182,9 +182,11 @@ class WizardShaftGui:
def GetResources(self):
IconPath = FreeCAD.ConfigGet("AppHomePath") + "Mod/PartDesign/WizardShaft/WizardShaft.svg"
MenuText = 'Shaft design wizard...'
ToolTip = 'Start the shaft design wizard'
return {'Pixmap' : IconPath, 'MenuText': MenuText, 'ToolTip': ToolTip}
MenuText = QtCore.QT_TRANSLATE_NOOP("WizardShaft", "Shaft design wizard...")
ToolTip = QtCore.QT_TRANSLATE_NOOP("WizardShaft", "Start the shaft design wizard")
return {'Pixmap': IconPath,
'MenuText': MenuText,
'ToolTip': ToolTip}
def IsActive(self):
return FreeCAD.ActiveDocument != None
@@ -205,9 +207,11 @@ class WizardShaftGuiCallback:
def GetResources(self):
IconPath = FreeCAD.ConfigGet("AppHomePath") + "Mod/PartDesign/WizardShaft/WizardShaft.svg"
MenuText = 'Shaft design wizard...'
ToolTip = 'Start the shaft design wizard'
return {'Pixmap' : IconPath, 'MenuText': MenuText, 'ToolTip': ToolTip}
MenuText = QtCore.QT_TRANSLATE_NOOP("WizardShaft", "Shaft design wizard...")
ToolTip = QtCore.QT_TRANSLATE_NOOP("WizardShaft", "Start the shaft design wizard")
return {'Pixmap': IconPath,
'MenuText': MenuText,
'ToolTip': ToolTip}
FreeCADGui.addCommand('PartDesign_WizardShaft', WizardShaftGui())
FreeCADGui.addCommand('PartDesign_WizardShaftCallBack', WizardShaftGuiCallback())

View File

@@ -40,15 +40,15 @@ class WizardShaftTable:
}
rowDictReverse = {}
headers = [
"Length [mm]",
"Diameter [mm]",
"Inner diameter [mm]",
"Constraint type",
"Start edge type",
"Start edge size",
"End edge type",
"End edge size"
]
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "Length [mm]"),
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "Diameter [mm]"),
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "Inner diameter [mm]"),
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "Constraint type"),
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "Start edge type"),
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "Start edge size"),
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "End edge type"),
QtCore.QT_TRANSLATE_NOOP("WizardShaftTable", "End edge size")
]
def __init__(self, w, s):
for key in iter(self.rowDict.keys()):