From f2b93a7af3f9f09adc921f73c6af16ebbf88ddc0 Mon Sep 17 00:00:00 2001 From: luz paz Date: Tue, 2 Mar 2021 10:55:23 -0500 Subject: [PATCH 1/4] Crowdin: represent whitespace in code instead of in string [skip ci] Removing possible whitespace from strings lead to more accurate translations --- src/Mod/Arch/ArchStairs.py | 10 +++++----- src/Mod/Draft/DraftGui.py | 2 +- src/Mod/Draft/draftguitools/gui_scale.py | 6 ++++-- src/Mod/Draft/draftmake/make_arc_3points.py | 2 +- src/Mod/Draft/importDWG.py | 8 ++++---- src/Mod/Draft/importDXF.py | 2 +- src/Mod/Draft/importOCA.py | 4 ++-- src/Mod/OpenSCAD/exportCSG.py | 2 +- src/Mod/Part/Gui/TaskCheckGeometry.cpp | 2 +- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 15 ++++++++++----- 10 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/Mod/Arch/ArchStairs.py b/src/Mod/Arch/ArchStairs.py index 62cd65a81a07..6906fd06decf 100644 --- a/src/Mod/Arch/ArchStairs.py +++ b/src/Mod/Arch/ArchStairs.py @@ -321,13 +321,13 @@ def setProperties(self,obj): if not hasattr(obj,"LastSegment"): obj.addProperty("App::PropertyLink","LastSegment","Segment and Parts","Last Segment (Flight or Landing) of Arch Stairs connecting to This Segment") if not hasattr(obj,"AbsTop"): - obj.addProperty("App::PropertyVector","AbsTop","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'absolute' top level of a flight of stairs leads to ")) + obj.addProperty("App::PropertyVector","AbsTop","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'absolute' top level of a flight of stairs leads to")) obj.setEditorMode("AbsTop",1) if not hasattr(obj,"OutlineLeft"): - obj.addProperty("App::PropertyVectorList","OutlineLeft","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'left outline' of stairs ")) # Used for Outline of Railing + obj.addProperty("App::PropertyVectorList","OutlineLeft","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'left outline' of stairs")) # Used for Outline of Railing obj.setEditorMode("OutlineLeft",1) if not hasattr(obj,"OutlineRight"): - obj.addProperty("App::PropertyVectorList","OutlineRight","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'left outline' of stairs ")) + obj.addProperty("App::PropertyVectorList","OutlineRight","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'left outline' of stairs")) obj.setEditorMode("OutlineRight",1) # Can't accept 'None' in list, need NaN @@ -364,10 +364,10 @@ def setProperties(self,obj): pass if not hasattr(obj,"OutlineLeftAll"): - obj.addProperty("App::PropertyVectorList","OutlineLeftAll","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'left outline' of all segments of stairs ")) + obj.addProperty("App::PropertyVectorList","OutlineLeftAll","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'left outline' of all segments of stairs")) obj.setEditorMode("OutlineLeftAll",1) # Used for Outline of Railing if not hasattr(obj,"OutlineRightAll"): - obj.addProperty("App::PropertyVectorList","OutlineRightAll","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'right outline' of all segments of stairs ")) + obj.addProperty("App::PropertyVectorList","OutlineRightAll","Segment and Parts",QT_TRANSLATE_NOOP("App::Property","The 'right outline' of all segments of stairs")) obj.setEditorMode("OutlineRightAll",1) # Can't accept 'None' in list, need NaN diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index fff6c1db040a..025a19438f26 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -2047,7 +2047,7 @@ def setAutoGroup(self,value=None): self.autogroup = value self.autoGroupButton.setText(obj.Label) self.autoGroupButton.setIcon(obj.ViewObject.Icon) - self.autoGroupButton.setToolTip(translate("draft", "Autogroup: ")+obj.Label) + self.autoGroupButton.setToolTip(translate("draft", "Autogroup:") + " " + obj.Label) self.autoGroupButton.setDown(False) else: self.autogroup = None diff --git a/src/Mod/Draft/draftguitools/gui_scale.py b/src/Mod/Draft/draftguitools/gui_scale.py index 30914c05b195..92de0b592899 100644 --- a/src/Mod/Draft/draftguitools/gui_scale.py +++ b/src/Mod/Draft/draftguitools/gui_scale.py @@ -330,10 +330,12 @@ def scale_object(self): bads.append(obj) if bads: if len(bads) == 1: - m = translate("draft", "Unable to scale object: ") + m = translate("draft", "Unable to scale object:") + m += " " m += bads[0].Label else: - m = translate("draft", "Unable to scale objects: ") + m = translate("draft", "Unable to scale objects:") + m += " " m += ", ".join([o.Label for o in bads]) m += " - " + translate("draft","This object type cannot be scaled directly. Please use the clone method.") _err(m) diff --git a/src/Mod/Draft/draftmake/make_arc_3points.py b/src/Mod/Draft/draftmake/make_arc_3points.py index cb00898678a4..7c46e0019fe2 100644 --- a/src/Mod/Draft/draftmake/make_arc_3points.py +++ b/src/Mod/Draft/draftmake/make_arc_3points.py @@ -135,7 +135,7 @@ def make_arc_3points(points, placement=None, face=False, try: utils.type_check([(placement, App.Placement)], name=_name) except TypeError: - _err(translate("draft","Placement: ") + "{}".format(placement)) + _err(translate("draft","Placement:") + " {}".format(placement)) _err(translate("draft","Wrong input: incorrect type of placement.")) return None diff --git a/src/Mod/Draft/importDWG.py b/src/Mod/Draft/importDWG.py index 2820d02fcaea..7e20be076ec4 100644 --- a/src/Mod/Draft/importDWG.py +++ b/src/Mod/Draft/importDWG.py @@ -219,8 +219,8 @@ def convertToDxf(dwgfilename): basename = os.path.basename(dwgfilename) cmdline = ('"%s" "%s" "%s" "ACAD2000" "DXF" "0" "1" "%s"' % (teigha, indir, outdir, basename)) - FCC.PrintMessage(translate("ImportDWG", "Converting: ") - + cmdline + "\n") + FCC.PrintMessage(translate("ImportDWG", "Converting:") + + " " + cmdline + "\n") if six.PY2: if isinstance(cmdline, six.text_type): encoding = sys.getfilesystemencoding() @@ -272,8 +272,8 @@ def convertToDwg(dxffilename, dwgfilename): basename = os.path.basename(dxffilename) cmdline = ('"%s" "%s" "%s" "ACAD2000" "DWG" "0" "1" "%s"' % (teigha, indir, outdir, basename)) - FCC.PrintMessage(translate("ImportDWG", "Converting: ") - + cmdline + "\n") + FCC.PrintMessage(translate("ImportDWG", "Converting:") + + " " + cmdline + "\n") subprocess.call(cmdline, shell=True) # os.system(cmdline) return dwgfilename return None diff --git a/src/Mod/Draft/importDXF.py b/src/Mod/Draft/importDXF.py index beb5b255bbaa..f1a40fa0acd6 100644 --- a/src/Mod/Draft/importDXF.py +++ b/src/Mod/Draft/importDXF.py @@ -3862,7 +3862,7 @@ def export(objectslist, filename, nospline=False, lwPoly=False): filename = filename.encode("utf8") dxf.saveas(filename) - FCC.PrintMessage("successfully exported " + filename + "\n") + FCC.PrintMessage("successfully exported" + " " + filename + "\n") else: errorDXFLib(gui) diff --git a/src/Mod/Draft/importOCA.py b/src/Mod/Draft/importOCA.py index 8e6db75ded97..0e013069d22b 100644 --- a/src/Mod/Draft/importOCA.py +++ b/src/Mod/Draft/importOCA.py @@ -488,5 +488,5 @@ def export(exportList, filename): # closing oca.close() FCC.PrintMessage(translate("importOCA", - "successfully exported ") - + filename + "\n") + "successfully exported") + + " " + filename + "\n") diff --git a/src/Mod/OpenSCAD/exportCSG.py b/src/Mod/OpenSCAD/exportCSG.py index 1b5d75803a6d..01385ffcb1b8 100644 --- a/src/Mod/OpenSCAD/exportCSG.py +++ b/src/Mod/OpenSCAD/exportCSG.py @@ -269,4 +269,4 @@ def export(exportList,filename): csg.write("}\n}\n") # close file csg.close() - FreeCAD.Console.PrintMessage("successfully exported "+filename) + FreeCAD.Console.PrintMessage("successfully exported" + " " + filename) diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index 9e7bdf28a8e3..2c998a00d632 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -149,7 +149,7 @@ QString checkStatusToString(const int &index) } if (index > 33 || index < 0) { - QString message(QObject::tr("Out Of Enum Range: ")); + QString message(QObject::tr("Out Of Enum Range:") + " "); QString number; number.setNum(index); message += number; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 34798294e2c7..4011a8a9056f 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -6546,21 +6546,24 @@ void ViewProviderSketch::UpdateSolverInformation() std::string msg; SketchObject::appendConflictMsg(getSketchObject()->getLastConflicting(), msg); signalSetUp(QString::fromLatin1("%1%2
%3

") - .arg(tr("Over-constrained sketch ")) + .arg(tr("Over-constrained sketch")) + .arg(" ") .arg(tr("(click to select)")) .arg(QString::fromStdString(msg))); signalSolved(QString()); } else if (hasMalformed) { // malformed constraints signalSetUp(QString::fromLatin1("%1%2
%3

") - .arg(tr("Sketch contains malformed constraints ")) + .arg(tr("Sketch contains malformed constraints")) + .arg(" ") .arg(tr("(click to select)")) .arg(appendMalformedMsg(getSketchObject()->getLastMalformedConstraints()))); signalSolved(QString()); } else if (hasConflicts) { // conflicting constraints signalSetUp(QString::fromLatin1("%1%2
%3

") - .arg(tr("Sketch contains conflicting constraints ")) + .arg(tr("Sketch contains conflicting constraints")) + .arg(" ") .arg(tr("(click to select)")) .arg(appendConflictMsg(getSketchObject()->getLastConflicting()))); signalSolved(QString()); @@ -6568,7 +6571,8 @@ void ViewProviderSketch::UpdateSolverInformation() else { if (hasRedundancies) { // redundant constraints signalSetUp(QString::fromLatin1("%1%2
%3

") - .arg(tr("Sketch contains redundant constraints ")) + .arg(tr("Sketch contains redundant constraints")) + .arg(" ") .arg(tr("(click to select)")) .arg(appendRedundantMsg(getSketchObject()->getLastRedundant()))); } @@ -6577,7 +6581,8 @@ void ViewProviderSketch::UpdateSolverInformation() if(hasPartiallyRedundant) { partiallyRedundantString = QString::fromLatin1("
%1%2
%3

") - .arg(tr("Sketch contains partially redundant constraints ")) + .arg(tr("Sketch contains partially redundant constraints")) + .arg(" ") .arg(tr("(click to select)")) .arg(appendPartiallyRedundantMsg(getSketchObject()->getLastPartiallyRedundant())); } From 3b9882a8e639909b4b0cb383be9ed8212d1e784d Mon Sep 17 00:00:00 2001 From: luz paz Date: Tue, 2 Mar 2021 11:04:53 -0500 Subject: [PATCH 2/4] Crowdin: remove obsolete translation manually [skip ci] For some reason updatets.py is not successfully removing obsolete translations. This is a long standing issue. The workaround is to manually remove them from the .ts file. --- src/Mod/Path/Gui/Resources/translations/Path.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/translations/Path.ts b/src/Mod/Path/Gui/Resources/translations/Path.ts index e7925bf968f9..8f62d5fba2df 100644 --- a/src/Mod/Path/Gui/Resources/translations/Path.ts +++ b/src/Mod/Path/Gui/Resources/translations/Path.ts @@ -793,11 +793,6 @@ The tool controller to use - - - The description of the tool - - Rapid Safety Height between locations. From 5cef2ce379d6aca1b940a81c874b1028378cf1b0 Mon Sep 17 00:00:00 2001 From: luz paz Date: Wed, 10 Mar 2021 11:35:58 -0500 Subject: [PATCH 3/4] Crowdin: remove obsolete translation manually [skip ci] For some reason updatets.py is not successfully removing obsolete translations. This is a long standing issue. The workaround is to manually remove them from the .ts file. ref: https://forum.freecadweb.org/viewtopic.php?f=21&t=51825&p=483474#p482519 crowdin: https://crowdin.com/translate/freecad/7254/en-pl?filter=basic&value=0#6572886 --- src/Mod/Part/Gui/TaskCheckGeometry.cpp | 2 +- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 15 +++++---------- .../Start/Gui/Resources/translations/StartPage.ts | 5 ----- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index 2c998a00d632..5de7c169205d 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -149,7 +149,7 @@ QString checkStatusToString(const int &index) } if (index > 33 || index < 0) { - QString message(QObject::tr("Out Of Enum Range:") + " "); + QString message(QObject::tr("Out Of Enum Range:") + QString::fromLatin1(" ")); QString number; number.setNum(index); message += number; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 4011a8a9056f..a63f65150d20 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -6545,34 +6545,30 @@ void ViewProviderSketch::UpdateSolverInformation() else if (dofs < 0) { // over-constrained sketch std::string msg; SketchObject::appendConflictMsg(getSketchObject()->getLastConflicting(), msg); - signalSetUp(QString::fromLatin1("%1%2
%3

") + signalSetUp(QString::fromLatin1("%1 %2
%3

") .arg(tr("Over-constrained sketch")) - .arg(" ") .arg(tr("(click to select)")) .arg(QString::fromStdString(msg))); signalSolved(QString()); } else if (hasMalformed) { // malformed constraints - signalSetUp(QString::fromLatin1("%1%2
%3

") + signalSetUp(QString::fromLatin1("%1 %2
%3

") .arg(tr("Sketch contains malformed constraints")) - .arg(" ") .arg(tr("(click to select)")) .arg(appendMalformedMsg(getSketchObject()->getLastMalformedConstraints()))); signalSolved(QString()); } else if (hasConflicts) { // conflicting constraints - signalSetUp(QString::fromLatin1("%1%2
%3

") + signalSetUp(QString::fromLatin1("%1 %2
%3

") .arg(tr("Sketch contains conflicting constraints")) - .arg(" ") .arg(tr("(click to select)")) .arg(appendConflictMsg(getSketchObject()->getLastConflicting()))); signalSolved(QString()); } else { if (hasRedundancies) { // redundant constraints - signalSetUp(QString::fromLatin1("%1%2
%3

") + signalSetUp(QString::fromLatin1("%1 %2
%3

") .arg(tr("Sketch contains redundant constraints")) - .arg(" ") .arg(tr("(click to select)")) .arg(appendRedundantMsg(getSketchObject()->getLastRedundant()))); } @@ -6580,9 +6576,8 @@ void ViewProviderSketch::UpdateSolverInformation() QString partiallyRedundantString; if(hasPartiallyRedundant) { - partiallyRedundantString = QString::fromLatin1("
%1%2
%3

") + partiallyRedundantString = QString::fromLatin1("
%1 %2
%3

") .arg(tr("Sketch contains partially redundant constraints")) - .arg(" ") .arg(tr("(click to select)")) .arg(appendPartiallyRedundantMsg(getSketchObject()->getLastPartiallyRedundant())); } diff --git a/src/Mod/Start/Gui/Resources/translations/StartPage.ts b/src/Mod/Start/Gui/Resources/translations/StartPage.ts index 198bbc5842e3..0952718cc0e1 100644 --- a/src/Mod/Start/Gui/Resources/translations/StartPage.ts +++ b/src/Mod/Start/Gui/Resources/translations/StartPage.ts @@ -343,11 +343,6 @@ An optional image to display as background
- - - If this is checked, if a style sheet is specified in General preferences, it will be used and override the colors below - - Page background color From 1388db3c0a5e5670df5298bbb0795125c7c576a5 Mon Sep 17 00:00:00 2001 From: luz paz Date: Mon, 19 Apr 2021 06:22:07 -0400 Subject: [PATCH 4/4] Crowdin: represent whitespace in code instead of string --- src/Mod/Draft/draftguitools/gui_edit.py | 4 ++-- src/Mod/Draft/draftmake/make_arc_3points.py | 4 ++-- src/Mod/Fem/femguiutils/selection_widgets.py | 2 +- src/Mod/TechDraw/Gui/Command.cpp | 2 +- src/Mod/TechDraw/Gui/MDIViewPage.cpp | 2 +- src/Mod/TechDraw/Gui/mrichtextedit.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_edit.py b/src/Mod/Draft/draftguitools/gui_edit.py index 5dbac65befbf..4f356a988e22 100644 --- a/src/Mod/Draft/draftguitools/gui_edit.py +++ b/src/Mod/Draft/draftguitools/gui_edit.py @@ -930,8 +930,8 @@ def getObjsFromSelection(self): selection = Gui.Selection.getSelection() self.edited_objects = [] if len(selection) > self.maxObjects: - _err = translate("draft", "Too many objects selected, max number set to: ") - App.Console.PrintMessage(_err + str(self.maxObjects) + "\n") + _err = translate("draft", "Too many objects selected, max number set to:") + App.Console.PrintMessage(_err + " " + str(self.maxObjects) + "\n") return None for obj in selection: diff --git a/src/Mod/Draft/draftmake/make_arc_3points.py b/src/Mod/Draft/draftmake/make_arc_3points.py index 7c46e0019fe2..ef108fa98071 100644 --- a/src/Mod/Draft/draftmake/make_arc_3points.py +++ b/src/Mod/Draft/draftmake/make_arc_3points.py @@ -122,12 +122,12 @@ def make_arc_3points(points, placement=None, face=False, try: utils.type_check([(points, (list, tuple))], name=_name) except TypeError: - _err(translate("draft","Points: ") + "{}".format(points)) + _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(translate("draft","Points: ") + "{}".format(points)) + _err(translate("draft","Points:") + " {}".format(points)) _err(translate("draft","Wrong input: must be list or tuple of three points exactly.")) return None diff --git a/src/Mod/Fem/femguiutils/selection_widgets.py b/src/Mod/Fem/femguiutils/selection_widgets.py index 00afc0a06f16..f87273ce48af 100644 --- a/src/Mod/Fem/femguiutils/selection_widgets.py +++ b/src/Mod/Fem/femguiutils/selection_widgets.py @@ -271,7 +271,7 @@ def initElemTypes(self, eltypes): def initUI(self): # auch ArchPanel ist coded ohne ui-file # title - self.setWindowTitle(self.tr("Geometry reference selector for a ") + self.sel_elem_text) + self.setWindowTitle(self.tr("Geometry reference selector for a") + " " + self.sel_elem_text) # button self.pushButton_Add = QtGui.QPushButton(self.tr("Add")) # label diff --git a/src/Mod/TechDraw/Gui/Command.cpp b/src/Mod/TechDraw/Gui/Command.cpp index fa73b7f49160..1a244316cbe3 100644 --- a/src/Mod/TechDraw/Gui/Command.cpp +++ b/src/Mod/TechDraw/Gui/Command.cpp @@ -1380,7 +1380,7 @@ void CmdTechDrawExportPageDXF::activated(int iMsg) //WF? allow more than one TD Page per Dxf file?? 1 TD page = 1 DXF file = 1 drawing? QString defaultDir; QString fileName = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), - QString::fromUtf8(QT_TR_NOOP("Save Dxf File ")), + QString::fromUtf8(QT_TR_NOOP("Save Dxf File")), defaultDir, QString::fromUtf8(QT_TR_NOOP("Dxf (*.dxf)"))); diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index 7bccf1bae642..9aa4ea8d3064 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -854,7 +854,7 @@ void MDIViewPage::saveDXF() { QString defaultDir; QString fileName = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(), - QString::fromUtf8(QT_TR_NOOP("Save Dxf File ")), + QString::fromUtf8(QT_TR_NOOP("Save Dxf File")), defaultDir, QString::fromUtf8(QT_TR_NOOP("Dxf (*.dxf)"))); if (fileName.isEmpty()) { diff --git a/src/Mod/TechDraw/Gui/mrichtextedit.cpp b/src/Mod/TechDraw/Gui/mrichtextedit.cpp index 4274d37daa6b..630ae0f6d4fc 100644 --- a/src/Mod/TechDraw/Gui/mrichtextedit.cpp +++ b/src/Mod/TechDraw/Gui/mrichtextedit.cpp @@ -102,7 +102,7 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) << tr("Heading 3") << tr("Heading 4") << tr("Monospace") - << tr(" "); + << QString::fromUtf8(" "); f_paragraph->addItems(m_paragraphItems); connect(f_paragraph, SIGNAL(activated(int)),