diff --git a/freecad/plot/PlotGui.py b/freecad/plot/PlotGui.py index afdd60c..94acb69 100644 --- a/freecad/plot/PlotGui.py +++ b/freecad/plot/PlotGui.py @@ -27,154 +27,126 @@ import FreeCAD import FreeCADGui +QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP -FreeCADGui.addLanguagePath(os.path.join(os.path.dirname(__file__), - "resources/translations")) -FreeCADGui.addIconPath(os.path.join(os.path.dirname(__file__), - "resources/icons")) +FreeCADGui.addLanguagePath( + os.path.join(os.path.dirname(__file__), "resources", "translations") +) +FreeCADGui.addIconPath(os.path.join(os.path.dirname(__file__), "resources", "icons")) class Save: def Activated(self): from freecad.plot import plotSave + plotSave.load() def GetResources(self): - MenuText = QtCore.QT_TRANSLATE_NOOP( - "Plot_SaveFig", - "Save plot") - ToolTip = QtCore.QT_TRANSLATE_NOOP( - "Plot_SaveFig", - "Save the plot as an image file") - return {'Pixmap': 'Plot_Save', - 'MenuText': MenuText, - 'ToolTip': ToolTip} + MenuText = QT_TRANSLATE_NOOP("Plot_SaveFig", "Save plot") + ToolTip = QT_TRANSLATE_NOOP("Plot_SaveFig", "Save the plot as an image file") + return {"Pixmap": "Plot_Save", "MenuText": MenuText, "ToolTip": ToolTip} class Axes: def Activated(self): from freecad.plot import plotAxes + plotAxes.load() def GetResources(self): - MenuText = QtCore.QT_TRANSLATE_NOOP( - "Plot_Axes", - "Configure axes") - ToolTip = QtCore.QT_TRANSLATE_NOOP( - "Plot_Axes", - "Configure the axes parameters") - return {'Pixmap': 'Plot_Axes', - 'MenuText': MenuText, - 'ToolTip': ToolTip} + MenuText = QT_TRANSLATE_NOOP("Plot_Axes", "Configure axes") + ToolTip = QT_TRANSLATE_NOOP("Plot_Axes", "Configure the axes parameters") + return {"Pixmap": "Plot_Axes", "MenuText": MenuText, "ToolTip": ToolTip} class Series: def Activated(self): from freecad.plot import plotSeries + plotSeries.load() def GetResources(self): - MenuText = QtCore.QT_TRANSLATE_NOOP( - "Plot_Series", - "Configure series") - ToolTip = QtCore.QT_TRANSLATE_NOOP( - "Plot_Series", - "Configure series drawing style and label") - return {'Pixmap': 'Plot_Series', - 'MenuText': MenuText, - 'ToolTip': ToolTip} + MenuText = QT_TRANSLATE_NOOP("Plot_Series", "Configure series") + ToolTip = QT_TRANSLATE_NOOP( + "Plot_Series", "Configure series drawing style and label" + ) + return {"Pixmap": "Plot_Series", "MenuText": MenuText, "ToolTip": ToolTip} class Grid: def Activated(self): from FreeCAD.Plot import Plot + plt = Plot.getPlot() if not plt: - msg = QtGui.QApplication.translate( + msg = App.Qt.translate( "plot_console", "The grid must be activated on top of a plot document", - None) + None, + ) FreeCAD.Console.PrintError(msg + "\n") return flag = plt.isGrid() Plot.grid(not flag) def GetResources(self): - MenuText = QtCore.QT_TRANSLATE_NOOP( - "Plot_Grid", - "Show/Hide grid") - ToolTip = QtCore.QT_TRANSLATE_NOOP( - "Plot_Grid", - "Show/Hide grid on selected plot") - return {'Pixmap': 'Plot_Grid', - 'MenuText': MenuText, - 'ToolTip': ToolTip} + MenuText = QT_TRANSLATE_NOOP("Plot_Grid", "Show/Hide grid") + ToolTip = QT_TRANSLATE_NOOP("Plot_Grid", "Show/Hide grid on selected plot") + return {"Pixmap": "Plot_Grid", "MenuText": MenuText, "ToolTip": ToolTip} class Legend: def Activated(self): from FreeCAD.Plot import Plot + plt = Plot.getPlot() if not plt: - msg = QtGui.QApplication.translate( + msg = App.Qt.translate( "plot_console", "The legend must be activated on top of a plot document", - None) + None, + ) FreeCAD.Console.PrintError(msg + "\n") return flag = plt.isLegend() Plot.legend(not flag) def GetResources(self): - MenuText = QtCore.QT_TRANSLATE_NOOP( - "Plot_Legend", - "Show/Hide legend") - ToolTip = QtCore.QT_TRANSLATE_NOOP( - "Plot_Legend", - "Show/Hide legend on selected plot") - return {'Pixmap': 'Plot_Legend', - 'MenuText': MenuText, - 'ToolTip': ToolTip} + MenuText = QT_TRANSLATE_NOOP("Plot_Legend", "Show/Hide legend") + ToolTip = QT_TRANSLATE_NOOP("Plot_Legend", "Show/Hide legend on selected plot") + return {"Pixmap": "Plot_Legend", "MenuText": MenuText, "ToolTip": ToolTip} class Labels: def Activated(self): from freecad.plot import plotLabels + plotLabels.load() def GetResources(self): - MenuText = QtCore.QT_TRANSLATE_NOOP( - "Plot_Labels", - "Set labels") - ToolTip = QtCore.QT_TRANSLATE_NOOP( - "Plot_Labels", - "Set title and axes labels") - return {'Pixmap': 'Plot_Labels', - 'MenuText': MenuText, - 'ToolTip': ToolTip} + MenuText = QT_TRANSLATE_NOOP("Plot_Labels", "Set labels") + ToolTip = QT_TRANSLATE_NOOP("Plot_Labels", "Set title and axes labels") + return {"Pixmap": "Plot_Labels", "MenuText": MenuText, "ToolTip": ToolTip} class Positions: def Activated(self): from freecad.plot import plotPositions + plotPositions.load() def GetResources(self): - MenuText = QtCore.QT_TRANSLATE_NOOP( - "Plot_Positions", - "Set positions and sizes") - ToolTip = QtCore.QT_TRANSLATE_NOOP( - "Plot_Positions", - "Set labels and legend positions and sizes") - return {'Pixmap': 'Plot_Positions', - 'MenuText': MenuText, - 'ToolTip': ToolTip} - - -FreeCADGui.addCommand('Plot_SaveFig', Save()) -FreeCADGui.addCommand('Plot_Axes', Axes()) -FreeCADGui.addCommand('Plot_Series', Series()) -FreeCADGui.addCommand('Plot_Grid', Grid()) -FreeCADGui.addCommand('Plot_Legend', Legend()) -FreeCADGui.addCommand('Plot_Labels', Labels()) -FreeCADGui.addCommand('Plot_Positions', Positions()) + MenuText = QT_TRANSLATE_NOOP("Plot_Positions", "Set positions and sizes") + ToolTip = QT_TRANSLATE_NOOP( + "Plot_Positions", "Set labels and legend positions and sizes" + ) + return {"Pixmap": "Plot_Positions", "MenuText": MenuText, "ToolTip": ToolTip} + + +FreeCADGui.addCommand("Plot_SaveFig", Save()) +FreeCADGui.addCommand("Plot_Axes", Axes()) +FreeCADGui.addCommand("Plot_Series", Series()) +FreeCADGui.addCommand("Plot_Grid", Grid()) +FreeCADGui.addCommand("Plot_Legend", Legend()) +FreeCADGui.addCommand("Plot_Labels", Labels()) +FreeCADGui.addCommand("Plot_Positions", Positions()) diff --git a/freecad/plot/init_gui.py b/freecad/plot/init_gui.py index 7372f14..ffafa76 100644 --- a/freecad/plot/init_gui.py +++ b/freecad/plot/init_gui.py @@ -48,12 +48,9 @@ elif len(sorted_style_list) == 1: matplotlib.style.use(sorted_style_list[0]) else: - from PySide import QtCore, QtGui - msg = QtGui.QApplication.translate( - "plot_console", - "matplotlib style sheets not found", - None) - FreeCAD.Console.PrintWarning(msg + '\n') + FreeCAD.Console.PrintWarning( + FreeCAD.Qt.translate("plot_console", "matplotlib style sheets not found") + "\n" + ) matplotlib.rcParams["figure.facecolor"] = "efefef" matplotlib.rcParams["axes.facecolor"] = "efefef" @@ -61,17 +58,25 @@ __dir__ = os.path.dirname(__file__) + class PlotWorkbench(Gui.Workbench): """Workbench of Plot module.""" + def __init__(self): - self.__class__.Icon = os.path.join(__dir__, "resources", "icons", "Plot_Workbench.svg") - self.__class__.MenuText = "Plot" - self.__class__.ToolTip = "The Plot module is used to edit/save output plots performed by other tools" + Gui.addLanguagePath(os.path.join(__dir__, "resources", "translations")) + Gui.updateLocale() + self.__class__.Icon = os.path.join( + __dir__, "resources", "icons", "Plot_Workbench.svg" + ) + self.__class__.MenuText = FreeCAD.Qt.translate("Workbench", "Plot") + self.__class__.ToolTip = FreeCAD.Qt.translate( + "Workbench", + "The Plot module is used to edit/save output plots performed by other tools", + ) import freecad.plot.PlotGui def Initialize(self): - from PySide import QtCore, QtGui cmdlst = ["Plot_SaveFig", "Plot_Axes", "Plot_Series", @@ -79,21 +84,19 @@ def Initialize(self): "Plot_Legend", "Plot_Labels", "Plot_Positions"] - self.appendToolbar(str(QtCore.QT_TRANSLATE_NOOP( - "Plot", - "Plot edition tools")), cmdlst) - self.appendMenu(str(QtCore.QT_TRANSLATE_NOOP( - "Plot", - "Plot")), cmdlst) + QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + + self.appendToolbar(QT_TRANSLATE_NOOP("Plot", "Plot edition tools"), cmdlst) + self.appendMenu(QT_TRANSLATE_NOOP("Plot", "Plot"), cmdlst) try: import matplotlib except ImportError: - from PySide import QtCore, QtGui - msg = QtGui.QApplication.translate( - "plot_console", - "matplotlib not found, Plot module will be disabled", - None) - FreeCAD.Console.PrintMessage(msg + '\n') + FreeCAD.Console.PrintMessage( + FreeCAD.Qt.translate( + "plot_console", "matplotlib not found, Plot module will be disabled" + ) + + "\n" + ) Gui.addWorkbench(PlotWorkbench()) diff --git a/freecad/plot/plotAxes/TaskPanel.py b/freecad/plot/plotAxes/TaskPanel.py index 282ebdb..a396fc0 100644 --- a/freecad/plot/plotAxes/TaskPanel.py +++ b/freecad/plot/plotAxes/TaskPanel.py @@ -172,121 +172,121 @@ def widget(self, class_id, name): name -- Name of the widget """ mw = self.getMainWindow() - form = mw.findChild(QtGui.QWidget, "TaskPanel") + form = mw.findChild(QtGui.QWidget, "TaskPanel_plotAxes") return form.findChild(class_id, name) def retranslateUi(self): """Set the user interface locale strings. """ form = self.form - form.setWindowTitle(QtGui.QApplication.translate( + form.setWindowTitle(App.Qt.translate( "plot_axes", "Configure axes", None)) self.widget(QtGui.QLabel, "axesLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Active axes", None)) self.widget(QtGui.QCheckBox, "allAxes").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Apply to all axes", None)) self.widget(QtGui.QLabel, "dimLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Dimensions", None)) self.widget(QtGui.QLabel, "xPosLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "X axis position", None)) self.widget(QtGui.QLabel, "yPosLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Y axis position", None)) self.widget(QtGui.QLabel, "scalesLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Scales", None)) self.widget(QtGui.QCheckBox, "xAuto").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "X auto", None)) self.widget(QtGui.QCheckBox, "yAuto").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Y auto", None)) self.widget(QtGui.QCheckBox, "allAxes").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Apply to all axes", None)) self.widget(QtGui.QLabel, "dimLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Dimensions", None)) self.widget(QtGui.QLabel, "xPosLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "X axis position", None)) self.widget(QtGui.QLabel, "yPosLabel").setText( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Y axis position", None)) self.widget(QtGui.QSpinBox, "axesIndex").setToolTip( - QtGui.QApplication.translate("plot_axes", + App.Qt.translate("plot_axes", "Index of the active axes", None)) self.widget(QtGui.QPushButton, "newAxesButton").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Add new axes to the plot", None)) self.widget(QtGui.QPushButton, "delAxesButton").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Remove selected axes", None)) self.widget(QtGui.QCheckBox, "allAxes").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Check it to apply transformations to all axes", None)) self.widget(QtGui.QSlider, "posXMin").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Left bound of axes", None)) self.widget(QtGui.QSlider, "posXMax").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Right bound of axes", None)) self.widget(QtGui.QSlider, "posYMin").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Bottom bound of axes", None)) self.widget(QtGui.QSlider, "posYMax").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Top bound of axes", None)) self.widget(QtGui.QSpinBox, "xOffset").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Outward offset of X axis", None)) self.widget(QtGui.QSpinBox, "yOffset").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Outward offset of Y axis", None)) self.widget(QtGui.QCheckBox, "xAuto").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "X axis scale autoselection", None)) self.widget(QtGui.QCheckBox, "yAuto").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_axes", "Y axis scale autoselection", None)) @@ -331,7 +331,7 @@ def onRemove(self): # Don't remove first axes if not self.form.axId.value(): - msg = QtGui.QApplication.translate( + msg = App.Qt.translate( "plot_console", "Axes 0 can not be deleted", None) diff --git a/freecad/plot/plotLabels/TaskPanel.py b/freecad/plot/plotLabels/TaskPanel.py index 5bc3c34..a57e9d2 100644 --- a/freecad/plot/plotLabels/TaskPanel.py +++ b/freecad/plot/plotLabels/TaskPanel.py @@ -130,63 +130,63 @@ def widget(self, class_id, name): name -- Name of the widget """ mw = self.getMainWindow() - form = mw.findChild(QtGui.QWidget, "TaskPanel") + form = mw.findChild(QtGui.QWidget, "TaskPanel_plotLabels") return form.findChild(class_id, name) def retranslateUi(self): """ Set the user interface locale strings. """ - self.form.setWindowTitle(QtGui.QApplication.translate( + self.form.setWindowTitle(App.Qt.translate( "plot_labels", "Set labels", None)) self.widget(QtGui.QLabel, "axesLabel").setText( - QtGui.QApplication.translate("plot_labels", + App.Qt.translate("plot_labels", "Active axes", None)) self.widget(QtGui.QLabel, "titleLabel").setText( - QtGui.QApplication.translate("plot_labels", + App.Qt.translate("plot_labels", "Title", None)) self.widget(QtGui.QLabel, "xLabel").setText( - QtGui.QApplication.translate("plot_labels", + App.Qt.translate("plot_labels", "X label", None)) self.widget(QtGui.QLabel, "yLabel").setText( - QtGui.QApplication.translate("plot_labels", + App.Qt.translate("plot_labels", "Y label", None)) - self.widget(QtGui.QSpinBox, "axesIndex").setToolTip(QtGui.QApplication.translate( + self.widget(QtGui.QSpinBox, "axesIndex").setToolTip(App.Qt.translate( "plot_labels", "Index of the active axes", None)) self.widget(QtGui.QLineEdit, "title").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_labels", "Title (associated to active axes)", None)) self.widget(QtGui.QSpinBox, "titleSize").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_labels", "Title font size", None)) self.widget(QtGui.QLineEdit, "titleX").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_labels", "X axis title", None)) self.widget(QtGui.QSpinBox, "xSize").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_labels", "X axis title font size", None)) self.widget(QtGui.QLineEdit, "titleY").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_labels", "Y axis title", None)) self.widget(QtGui.QSpinBox, "ySize").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_labels", "Y axis title font size", None)) diff --git a/freecad/plot/plotPositions/TaskPanel.py b/freecad/plot/plotPositions/TaskPanel.py index 749ff3a..553324e 100644 --- a/freecad/plot/plotPositions/TaskPanel.py +++ b/freecad/plot/plotPositions/TaskPanel.py @@ -114,42 +114,42 @@ def widget(self, class_id, name): name -- Name of the widget """ mw = self.getMainWindow() - form = mw.findChild(QtGui.QWidget, "TaskPanel") + form = mw.findChild(QtGui.QWidget, "TaskPanel_plotPositions") return form.findChild(class_id, name) def retranslateUi(self): """Set the user interface locale strings.""" - self.form.setWindowTitle(QtGui.QApplication.translate( + self.form.setWindowTitle(App.Qt.translate( "plot_positions", "Set positions and sizes", None)) self.widget(QtGui.QLabel, "posLabel").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_positions", "Position", None)) self.widget(QtGui.QLabel, "sizeLabel").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_positions", "Size", None)) self.widget(QtGui.QListWidget, "items").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_positions", "List of modifiable items", None)) self.widget(QtGui.QDoubleSpinBox, "x").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_positions", "X item position", None)) self.widget(QtGui.QDoubleSpinBox, "y").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_positions", "Y item position", None)) self.widget(QtGui.QDoubleSpinBox, "size").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_positions", "Item size", None)) diff --git a/freecad/plot/plotSave/TaskPanel.py b/freecad/plot/plotSave/TaskPanel.py index 0938658..86113bc 100644 --- a/freecad/plot/plotSave/TaskPanel.py +++ b/freecad/plot/plotSave/TaskPanel.py @@ -41,7 +41,7 @@ def __init__(self): def accept(self): plt = Plot.getPlot() if not plt: - msg = QtGui.QApplication.translate( + msg = App.Qt.translate( "plot_console", "Plot document must be selected in order to save it", None) @@ -112,47 +112,47 @@ def widget(self, class_id, name): name -- Name of the widget """ mw = self.getMainWindow() - form = mw.findChild(QtGui.QWidget, "TaskPanel") + form = mw.findChild(QtGui.QWidget, "TaskPanel_plotSave") return form.findChild(class_id, name) def retranslateUi(self): """Set the user interface locale strings.""" - self.form.setWindowTitle(QtGui.QApplication.translate( + self.form.setWindowTitle(App.Qt.translate( "plot_save", "Save figure", None)) self.widget(QtGui.QLabel, "sizeLabel").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_save", "Inches", None)) self.widget(QtGui.QLabel, "dpiLabel").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_save", "Dots per Inch", None)) self.widget(QtGui.QLineEdit, "path").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_save", "Output image file path", None)) self.widget(QtGui.QPushButton, "pathButton").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_save", "Show a file selection dialog", None)) self.widget(QtGui.QDoubleSpinBox, "sizeX").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_save", "X image size", None)) self.widget(QtGui.QDoubleSpinBox, "sizeY").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_save", "Y image size", None)) self.widget(QtGui.QSpinBox, "dpi").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_save", "Dots per point, with size will define output image" " resolution", diff --git a/freecad/plot/plotSeries/TaskPanel.py b/freecad/plot/plotSeries/TaskPanel.py index 3def8b1..b774820 100644 --- a/freecad/plot/plotSeries/TaskPanel.py +++ b/freecad/plot/plotSeries/TaskPanel.py @@ -142,77 +142,77 @@ def widget(self, class_id, name): name -- Name of the widget """ mw = self.getMainWindow() - form = mw.findChild(QtGui.QWidget, "TaskPanel") + form = mw.findChild(QtGui.QWidget, "TaskPanel_plotSeries") return form.findChild(class_id, name) def retranslateUi(self): """Set the user interface locale strings.""" - self.form.setWindowTitle(QtGui.QApplication.translate( + self.form.setWindowTitle(App.Qt.translate( "plot_series", "Configure series", None)) self.widget(QtGui.QCheckBox, "isLabel").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "No label", None)) self.widget(QtGui.QPushButton, "remove").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Remove series", None)) self.widget(QtGui.QLabel, "styleLabel").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Line style", None)) self.widget(QtGui.QLabel, "markerLabel").setText( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Marker", None)) self.widget(QtGui.QListWidget, "items").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "List of available series", None)) self.widget(QtGui.QLineEdit, "label").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Line title", None)) self.widget(QtGui.QCheckBox, "isLabel").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "If checked, series will not be considered for legend", None)) self.widget(QtGui.QComboBox, "lineStyle").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Line style", None)) self.widget(QtGui.QComboBox, "markers").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Marker style", None)) self.widget(QtGui.QDoubleSpinBox, "lineWidth").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Line width", None)) self.widget(QtGui.QSpinBox, "markerSize").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Marker size", None)) self.widget(QtGui.QPushButton, "color").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Line and marker color", None)) self.widget(QtGui.QPushButton, "remove").setToolTip( - QtGui.QApplication.translate( + App.Qt.translate( "plot_series", "Removes this series", None)) diff --git a/freecad/plot/resources/translations/Plot.ts b/freecad/plot/resources/translations/Plot.ts index b44da19..afa0c34 100644 --- a/freecad/plot/resources/translations/Plot.ts +++ b/freecad/plot/resources/translations/Plot.ts @@ -1,14 +1,15 @@ - + + Plot - + Plot edition tools - + Plot @@ -16,12 +17,12 @@ Plot_Axes - + Configure axes - + Configure the axes parameters @@ -29,12 +30,12 @@ Plot_Grid - + Show/Hide grid - + Show/Hide grid on selected plot @@ -42,12 +43,12 @@ Plot_Labels - + Set labels - + Set title and axes labels @@ -55,12 +56,12 @@ Plot_Legend - + Show/Hide legend - + Show/Hide legend on selected plot @@ -68,12 +69,12 @@ Plot_Positions - + Set positions and sizes - + Set labels and legend positions and sizes @@ -81,12 +82,12 @@ Plot_SaveFig - + Save plot - + Save the plot as an image file @@ -94,120 +95,317 @@ Plot_Series - + Configure series - + Configure series drawing style and label + + TaskPanel_plotAxes + + + Configure axes + + + + + Active axes: + + + + + add + + + + + del + + + + + Apply to all axes + + + + + Dimensions: + + + + + Y axis position + + + + + y at Left + + + + + y at Right + + + + + X axis position + + + + + x at bottom + + + + + x at top + + + + + Scales + + + + + X auto + + + + + Y auto + + + + + TaskPanel_plotLabels + + + Set labels + + + + + Active axes: + + + + + Title + + + + + X label + + + + + Y label + + + + + TaskPanel_plotPositions + + + Set positions and sizes + + + + + Position + + + + + Size + + + + + TaskPanel_plotSave + + + Save figure + + + + + ... + + + + + x + + + + + Inches + + + + + Dots per Inch + + + + + TaskPanel_plotSeries + + + Configure series + + + + + Line style + + + + + Remove serie + + + + + Markers + + + + + No label + + + + + Workbench + + + Plot + + + + + The Plot module is used to edit/save output plots performed by other tools + + + 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,95 +413,95 @@ plot_console - - matplotlib not found, so Plot module can not be loaded + + The grid must be activated on top of a plot document - - matplotlib not found, Plot module will be disabled + + The legend must be activated on top of a plot document - - Plot document must be selected in order to save it + + matplotlib style sheets not found - - Axes 0 can not be deleted + + matplotlib not found, Plot module will be disabled - - The grid must be activated on top of a plot document + + Axes 0 can not be deleted - - The legend must be activated on top of a plot document + + Plot document must be selected in order to save it 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,80 +509,80 @@ plot_positions - + Set positions and sizes - + Position - + Size - X item position + List of modifiable items - Y item position + X item position - Item size + Y item position - - List of modifiable items + + Item size 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 @@ -393,66 +591,67 @@ plot_series + Configure series + + + + No label - - Line style + + Remove series - Marker + + Line style - - Configure series + + Marker - + List of available series - + Line title - - Marker style + + If checked, series will not be considered for legend - Line width + Marker style - Marker size + Line width - Line and marker color - - - - - Remove series + Marker size - - If checked, series will not be considered for legend + + Line and marker color - + Removes this series diff --git a/freecad/plot/resources/translations/Plot_es-AR.qm b/freecad/plot/resources/translations/Plot_es-AR.qm new file mode 100644 index 0000000..e5a6e85 Binary files /dev/null and b/freecad/plot/resources/translations/Plot_es-AR.qm differ diff --git a/freecad/plot/resources/translations/Plot_es-AR.ts b/freecad/plot/resources/translations/Plot_es-AR.ts new file mode 100644 index 0000000..0c03302 --- /dev/null +++ b/freecad/plot/resources/translations/Plot_es-AR.ts @@ -0,0 +1,746 @@ + + + + + Plot + + + Plot edition tools + Herramientas de edición de gráficos + + + + Plot + Gráfica + + + + Plot_Axes + + + Configure axes + Configurar ejes + + + + Configure the axes parameters + Configurar los parámetros de los ejes + + + + Plot_Grid + + + Show/Hide grid + Mostrar/ocultar cuadrícula + + + + Show/Hide grid on selected plot + Mostrar/Ocultar cuadrícula de la gráfica seleccionada + + + + Plot_Labels + + + Set labels + Establecer títulos + + + + Set title and axes labels + Establecer títulos de los ejes + + + + Plot_Legend + + + Show/Hide legend + Mostrar/Ocultar la legenda + + + + Show/Hide legend on selected plot + Mostrar/Ocultar la leyenda en la gráfica seleccionada + + + + Plot_Positions + + + Set positions and sizes + Establecer tamaños y posiciones + + + + Set labels and legend positions and sizes + Establecer tamaños y posiciones de leyenda y títulos + + + + Plot_SaveFig + + + Save plot + Guardar la gráfica + + + + Save the plot as an image file + Guardar gráfico como archivo de imagen + + + + Plot_Series + + + Configure series + Configurar series de datos + + + + Configure series drawing style and label + Configurar etiquetas y estilo de las series de datos + + + + TaskPanel + + Configure axes + Configurar ejes + + + Apply to all axes + Aplicar a todos los juegos de ejes + + + Y axis position + Posición del eje Y + + + X axis position + Posición del eje X + + + Scales + Escalas + + + X auto + X automática + + + Y auto + Y automática + + + Set labels + Establecer títulos + + + Title + Título + + + X label + Título del eje X + + + Y label + Título del eje Y + + + Set positions and sizes + Establecer tamaños y posiciones + + + Position + Posición + + + Size + Tamaño + + + Save figure + Guardar figura + + + Inches + Pulgadas + + + Dots per Inch + Puntos por pulgada + + + Configure series + Configurar series de datos + + + Line style + Estilo de línea + + + No label + Sin título + + + + TaskPanel_plotAxes + + + Configure axes + Configurar ejes + + + + Active axes: + Juego de ejes activo: + + + + add + Agregar + + + + del + Eliminar + + + + Apply to all axes + Aplicar a todos los juegos de ejes + + + + Dimensions: + Dimensiones: + + + + Y axis position + Posición del eje Y + + + + y at Left + Y en la izquierda + + + + y at Right + Y en la derecha + + + + X axis position + Posición del eje X + + + + x at bottom + X abajo + + + + x at top + X arriba + + + + Scales + Escalas + + + + X auto + X automática + + + + Y auto + Y automática + + + + TaskPanel_plotLabels + + + Set labels + Establecer títulos + + + + Active axes: + Juego de ejes activo: + + + + Title + Título + + + + X label + Título del eje X + + + + Y label + Título del eje Y + + + + TaskPanel_plotPositions + + + Set positions and sizes + Establecer tamaños y posiciones + + + + Position + Posición + + + + Size + Tamaño + + + + TaskPanel_plotSave + + + Save figure + Guardar figura + + + + ... + ... + + + + x + x + + + + Inches + Pulgadas + + + + Dots per Inch + Puntos por pulgada + + + + TaskPanel_plotSeries + + + Configure series + Configurar series de datos + + + + Line style + Estilo de línea + + + + Remove serie + Eliminar serie + + + + Markers + Marcadores + + + + No label + Sin título + + + + Workbench + + + Plot + Gráfica + + + + The Plot module is used to edit/save output plots performed by other tools + El módulo Plot es usado para editar/guardar gráficas generadas por otras herramientas + + + + plot_axes + + + Configure axes + Configurar ejes + + + + Active axes + Juego de ejes activo + + + + + Apply to all axes + Aplicar a todos los juegos de ejes + + + + + Dimensions + Dimensiones + + + + + X axis position + Posición del eje X + + + + + Y axis position + Posición del eje Y + + + + Scales + Escalas + + + + X auto + X automática + + + + Y auto + Y automática + + + + Index of the active axes + Índice del juego de ejes activo + + + + Add new axes to the plot + Añadir nuevos ejes al gráfico + + + + Remove selected axes + Eliminar el juego de ejes activo + + + + Check it to apply transformations to all axes + Marcar para aplicar las modificaciones a todos los juegos de ejes + + + + Left bound of axes + Límite izquierdo de los ejes + + + + Right bound of axes + Límite derecho de los ejes + + + + Bottom bound of axes + Límite inferior de los ejes + + + + Top bound of axes + Límite superior de los ejes + + + + Outward offset of X axis + Desplazamiento al exterior del eje X + + + + Outward offset of Y axis + Desplazamiento al exterior del eje Y + + + + X axis scale autoselection + Escala del eje X automática + + + + Y axis scale autoselection + Escala del eje Y automática + + + + plot_console + + matplotlib not found, so Plot module can not be loaded + Matplotlib que no se ha encontrado, por lo que no se puede cargar el módulo de graficado + + + + matplotlib style sheets not found + No se encontraron hojas de estilo de matplotlib + + + + matplotlib not found, Plot module will be disabled + No se encuentra matplotlib, se deshabilitará el módulo Plot + + + + Plot document must be selected in order to save it + Debe seleccionar una gráfica para poder guardarla + + + + Axes 0 can not be deleted + El juego de ejes 0 no puede ser eliminado + + + + The grid must be activated on top of a plot document + La cuadrícula debe estar activa por encima del gráfico + + + + The legend must be activated on top of a plot document + La leyenda debe estar activa por encima del gráfico + + + + plot_labels + + + Set labels + Establecer títulos + + + + Active axes + Juego de ejes activo + + + + Title + Título + + + + X label + Título del eje X + + + + Y label + Título del eje Y + + + + Index of the active axes + Índice del juego de ejes activo + + + + Title (associated to active axes) + Título (asociado al juego de ejes activo) + + + + Title font size + Tamaño de fuente del título + + + + X axis title + Título del eje X + + + + X axis title font size + Tamaño de fuente del título del eje X + + + + Y axis title + Título del eje Y + + + + Y axis title font size + Tamaño de fuente del título del eje Y + + + + plot_positions + + + Set positions and sizes + Establecer tamaños y posiciones + + + + Position + Posición + + + + Size + Tamaño + + + + X item position + Posición en X del objeto + + + + Y item position + Posición en Y del objeto + + + + Item size + tamaño del objeto + + + + List of modifiable items + Lista de elementos modificables + + + + plot_save + + + Save figure + Guardar figura + + + + Inches + Pulgadas + + + + Dots per Inch + Puntos por pulgada + + + + Output image file path + Ruta del archivo de imagen de salida + + + + Show a file selection dialog + Muestra un diálogo de selección de archivo + + + + X image size + Tamaño de imagen en X + + + + Y image size + Tamaño de imagen en Y + + + + Dots per point, with size will define output image resolution + Puntos por pulgada, junto con el tamaño define la resolución de la imagen de salida + + + + plot_series + + + No label + Sin título + + + + + Line style + Estilo de línea + + + + Marker + Marcador + + + + Configure series + Configurar series de datos + + + + List of available series + Lista de series disponibles + + + + Line title + Título de línea + + + + Marker style + Estilo del marcador + + + + Line width + Ancho de la línea + + + + Marker size + Tamaño del marcador + + + + Line and marker color + Color de la línea y del marcador + + + + Remove series + Eliminar serie + + + + If checked, series will not be considered for legend + Si se encuentra marcado, la series no se reflejarán en la leyenda + + + + Removes this series + Elimina esta serie de datos + + + diff --git a/freecad/plot/resources/translations/Plot_es-ES.qm b/freecad/plot/resources/translations/Plot_es-ES.qm index 0b5a27d..a91418f 100644 Binary files a/freecad/plot/resources/translations/Plot_es-ES.qm and b/freecad/plot/resources/translations/Plot_es-ES.qm differ diff --git a/freecad/plot/resources/translations/Plot_es-ES.ts b/freecad/plot/resources/translations/Plot_es-ES.ts index 58a4b3b..04205c8 100644 --- a/freecad/plot/resources/translations/Plot_es-ES.ts +++ b/freecad/plot/resources/translations/Plot_es-ES.ts @@ -1,461 +1,746 @@ - - + + Plot - - Plot edition tools - Herramientas de edición de gráficos + + Plot edition tools + Herramientas de edición de gráficos - - Plot - Gráfica + + Plot + Gráfica - - + + Plot_Axes - - Configure axes - Configurar ejes + + Configure axes + Configurar ejes - - Configure the axes parameters - Configurar los parámetros de los ejes + + Configure the axes parameters + Configurar los parámetros de los ejes - - + + Plot_Grid - - Show/Hide grid - Mostrar/ocultar cuadrícula + + Show/Hide grid + Mostrar/ocultar cuadrícula - - Show/Hide grid on selected plot - Mostrar/Ocultar cuadrícula de la gráfica seleccionada + + Show/Hide grid on selected plot + Mostrar/Ocultar cuadrícula de la gráfica seleccionada - - + + Plot_Labels - - Set labels - Establecer títulos + + Set labels + Establecer títulos - - Set title and axes labels - Establecer títulos de los ejes + + Set title and axes labels + Establecer títulos de los ejes - - + + Plot_Legend - - Show/Hide legend - Mostrar/Ocultar la legenda + + Show/Hide legend + Mostrar/Ocultar la legenda - - Show/Hide legend on selected plot - Mostrar/Ocultar la leyenda en la gráfica seleccionada + + Show/Hide legend on selected plot + Mostrar/Ocultar la leyenda en la gráfica seleccionada - - + + Plot_Positions - - Set positions and sizes - Establecer tamaños y posiciones + + Set positions and sizes + Establecer tamaños y posiciones - - Set labels and legend positions and sizes - Establecer tamaños y posiciones de leyenda y títulos + + Set labels and legend positions and sizes + Establecer tamaños y posiciones de leyenda y títulos - - + + Plot_SaveFig - - Save plot - Guardar la gráfica + + Save plot + Guardar la gráfica - - Save the plot as an image file - Guardar gráfico como archivo de imagen + + Save the plot as an image file + Guardar gráfico como archivo de imagen - - + + Plot_Series - - Configure series - Configurar series de datos + + Configure series + Configurar series de datos - - Configure series drawing style and label - Configurar etiquetas y estilo de las series de datos + + Configure series drawing style and label + Configurar etiquetas y estilo de las series de datos - - + + + TaskPanel + + Configure axes + Configurar ejes + + + Apply to all axes + Aplicar a todos los juegos de ejes + + + Y axis position + Posición del eje Y + + + X axis position + Posición del eje X + + + Scales + Escalas + + + X auto + X automática + + + Y auto + Y automática + + + Set labels + Establecer títulos + + + Title + Título + + + X label + Título del eje X + + + Y label + Título del eje Y + + + Set positions and sizes + Establecer tamaños y posiciones + + + Position + Posición + + + Size + Tamaño + + + Save figure + Guardar figura + + + Inches + Pulgadas + + + Dots per Inch + Puntos por pulgada + + + Configure series + Configurar series de datos + + + Line style + Estilo de línea + + + No label + Sin título + + + + TaskPanel_plotAxes + + + Configure axes + Configurar ejes + + + + Active axes: + Juego de ejes activo: + + + + add + Agregar + + + + del + Eliminar + + + + Apply to all axes + Aplicar a todos los juegos de ejes + + + + Dimensions: + Dimensiones: + + + + Y axis position + Posición del eje Y + + + + y at Left + Y en la izquierda + + + + y at Right + Y en la derecha + + + + X axis position + Posición del eje X + + + + x at bottom + X abajo + + + + x at top + X arriba + + + + Scales + Escalas + + + + X auto + X automática + + + + Y auto + Y automática + + + + TaskPanel_plotLabels + + + Set labels + Establecer títulos + + + + Active axes: + Juego de ejes activo: + + + + Title + Título + + + + X label + Título del eje X + + + + Y label + Título del eje Y + + + + TaskPanel_plotPositions + + + Set positions and sizes + Establecer tamaños y posiciones + + + + Position + Posición + + + + Size + Tamaño + + + + TaskPanel_plotSave + + + Save figure + Guardar figura + + + + ... + ... + + + + x + x + + + + Inches + Pulgadas + + + + Dots per Inch + Puntos por pulgada + + + + TaskPanel_plotSeries + + + Configure series + Configurar series de datos + + + + Line style + Estilo de línea + + + + Remove serie + Eliminar serie + + + + Markers + Marcadores + + + + No label + Sin título + + + + Workbench + + + Plot + Gráfica + + + + The Plot module is used to edit/save output plots performed by other tools + El módulo Plot es usado para editar/guardar gráficas generadas por otras herramientas + + + plot_axes - - Configure axes - Configurar ejes + + Configure axes + Configurar ejes - - Active axes - Juego de ejes activo + + Active axes + Juego de ejes activo - - Apply to all axes - Aplicar a todos los juegos de ejes + + + Apply to all axes + Aplicar a todos los juegos de ejes - - Dimensions - Dimensiones + + + Dimensions + Dimensiones - - X axis position - Posición del eje X + + + X axis position + Posición del eje X - - Y axis position - Posición del eje Y + + + Y axis position + Posición del eje Y - - Scales - Escalas + + Scales + Escalas - - X auto - X automática + + X auto + X automática - - Y auto - Y automática + + Y auto + Y automática - - Index of the active axes - Índice del juego de ejes activo + + Index of the active axes + Índice del juego de ejes activo - - Add new axes to the plot - Añadir nuevos ejes al gráfico + + Add new axes to the plot + Añadir nuevos ejes al gráfico - - Remove selected axes - Eliminar el juego de ejes activo + + Remove selected axes + Eliminar el juego de ejes activo - - Check it to apply transformations to all axes - Marcar para aplicar las modificaciones a todos los juegos de ejes + + Check it to apply transformations to all axes + Marcar para aplicar las modificaciones a todos los juegos de ejes - - Left bound of axes - Límite izquierdo de los ejes + + Left bound of axes + Límite izquierdo de los ejes - - Right bound of axes - Límite derecho de los ejes + + Right bound of axes + Límite derecho de los ejes - - Bottom bound of axes - Límite inferior de los ejes + + Bottom bound of axes + Límite inferior de los ejes - - Top bound of axes - Límite superior de los ejes + + Top bound of axes + Límite superior de los ejes - - Outward offset of X axis - Desplazamiento al exterior del eje X + + Outward offset of X axis + Desplazamiento al exterior del eje X - - Outward offset of Y axis - Desplazamiento al exterior del eje Y + + Outward offset of Y axis + Desplazamiento al exterior del eje Y - - X axis scale autoselection - Escala del eje X automática + + X axis scale autoselection + Escala del eje X automática - - Y axis scale autoselection - Escala del eje Y automática + + Y axis scale autoselection + Escala del eje Y automática - - + + plot_console - - matplotlib not found, so Plot module can not be loaded - Matplotlib que no se ha encontrado, por lo que no se puede cargar el módulo de graficado + matplotlib not found, so Plot module can not be loaded + Matplotlib que no se ha encontrado, por lo que no se puede cargar el módulo de graficado + + + + matplotlib style sheets not found + No se encontraron hojas de estilo de matplotlib - - matplotlib not found, Plot module will be disabled - no se encuentra matplotlib, se deshabilitará el módulo de impresión + + matplotlib not found, Plot module will be disabled + No se encuentra matplotlib, se deshabilitará el módulo Plot - - Plot document must be selected in order to save it - Debe seleccionar una gráfica para poder guardarla + + Plot document must be selected in order to save it + Debe seleccionar una gráfica para poder guardarla - - Axes 0 can not be deleted - El juego de ejes 0 no puede ser eliminado + + Axes 0 can not be deleted + El juego de ejes 0 no puede ser eliminado - - The grid must be activated on top of a plot document - La cuadrícula debe estar activa por encima del gráfico + + The grid must be activated on top of a plot document + La cuadrícula debe estar activa por encima del gráfico - - The legend must be activated on top of a plot document - La leyenda debe estar activa por encima del gráfico + + The legend must be activated on top of a plot document + La leyenda debe estar activa por encima del gráfico - - + + plot_labels - - Set labels - Establecer títulos + + Set labels + Establecer títulos - - Active axes - Juego de ejes activo + + Active axes + Juego de ejes activo - - Title - Título + + Title + Título - - X label - Título del eje X + + X label + Título del eje X - - Y label - Título del eje Y + + Y label + Título del eje Y - - Index of the active axes - Índice del juego de ejes activo + + Index of the active axes + Índice del juego de ejes activo - - Title (associated to active axes) - Título (asociado al juego de ejes activo) + + Title (associated to active axes) + Título (asociado al juego de ejes activo) - - Title font size - Tamaño de fuente del título + + Title font size + Tamaño de fuente del título - - X axis title - Título del eje X + + X axis title + Título del eje X - - X axis title font size - Tamaño de fuente del título del eje X + + X axis title font size + Tamaño de fuente del título del eje X - - Y axis title - Título del eje Y + + Y axis title + Título del eje Y - - Y axis title font size - Tamaño de fuente del título del eje Y + + Y axis title font size + Tamaño de fuente del título del eje Y - - + + plot_positions - - Set positions and sizes - Establecer tamaños y posiciones + + Set positions and sizes + Establecer tamaños y posiciones - - Position - Posición + + Position + Posición - - Size - Tamaño + + Size + Tamaño - - X item position - Posición en X del objeto + + X item position + Posición en X del objeto - - Y item position - Posición en Y del objeto + + Y item position + Posición en Y del objeto - - Item size - tamaño del objeto + + Item size + tamaño del objeto - - List of modifiable items - Lista de elementos modificables + + List of modifiable items + Lista de elementos modificables - - + + plot_save - - Save figure - Guardar figura + + Save figure + Guardar figura - - Inches - Pulgadas + + Inches + Pulgadas - - Dots per Inch - Puntos por pulgada + + Dots per Inch + Puntos por pulgada - - Output image file path - Ruta del archivo de imagen de salida + + Output image file path + Ruta del archivo de imagen de salida - - Show a file selection dialog - Muestra un diálogo de selección de archivo + + Show a file selection dialog + Muestra un diálogo de selección de archivo - - X image size - Tamaño de imagen en X + + X image size + Tamaño de imagen en X - - Y image size - Tamaño de imagen en Y + + Y image size + Tamaño de imagen en Y - - Dots per point, with size will define output image resolution - Puntos por pulgada, junto con el tamaño define la resolución de la imagen de salida + + Dots per point, with size will define output image resolution + Puntos por pulgada, junto con el tamaño define la resolución de la imagen de salida - - + + plot_series - - No label - Sin título + + No label + Sin título - - Line style - Estilo de línea + + + Line style + Estilo de línea - - Marker - Marcador + + Marker + Marcador - - Configure series - Configurar series de datos + + Configure series + Configurar series de datos - - List of available series - Lista de series disponibles + + List of available series + Lista de series disponibles - - Line title - Título de línea + + Line title + Título de línea - - Marker style - Estilo del marcador + + Marker style + Estilo del marcador - - Line width - Ancho de la línea + + Line width + Ancho de la línea - - Marker size - Tamaño del marcador + + Marker size + Tamaño del marcador - - Line and marker color - Color de la línea y del marcador + + Line and marker color + Color de la línea y del marcador - - Remove series - Eliminar serie + + Remove series + Eliminar serie - - If checked, series will not be considered for legend - Si se encuentra marcado, la series no se reflejarán en la leyenda + + If checked, series will not be considered for legend + Si se encuentra marcado, la series no se reflejarán en la leyenda - - Removes this series - Elimina esta serie de datos + + Removes this series + Elimina esta serie de datos - + diff --git a/freecad/plot/resources/translations/README.md b/freecad/plot/resources/translations/README.md new file mode 100644 index 0000000..f2aacbc --- /dev/null +++ b/freecad/plot/resources/translations/README.md @@ -0,0 +1,104 @@ +# About translating Plot Workbench + +> [!NOTE] +> All commands **must** be run in `./freecad/plot/resources/translations/` directory. + +> [!IMPORTANT] +> If you want to update/release the files you need to have installed +> `lupdate` and `lrelease` from Qt6 version. Using the versions from +> Qt5 is not advised because they're buggy. + +## Updating translations template file + +To update the template file from source files you should use this command: + +```shell +./update_translation.sh -U +``` + +Once done you can commit the changes and upload the new file to CrowdIn platform +at webpage and find the **Plot** project. + +## Creating file for missing locale + +### Using script + +To create a file for a new language with all **Plot** translatable strings execute +the script with `-u` flag plus your locale: + +```shell +./update_translation.sh -u es-ES +``` + +### Renaming file + +Also you can rename new `Plot.ts` file by appending the locale code, +for example, `Plot_es-ES.ts` for Spanish (Spain) and change + +```xml + +``` + +to + +```xml + +``` + +As of 13/09/2024 the supported locales on FreeCAD +(according to `FreeCADGui.supportedLocales()`) are 44: + +```python +{'English': 'en', 'Afrikaans': 'af', 'Arabic': 'ar', 'Basque': 'eu', +'Belarusian': 'be', 'Bulgarian': 'bg', 'Catalan': 'ca', +'Chinese Simplified': 'zh-CN', 'Chinese Traditional': 'zh-TW', 'Croatian': 'hr', +'Czech': 'cs', 'Danish': 'da', 'Dutch': 'nl', 'Filipino': 'fil', 'Finnish': 'fi', + 'French': 'fr', 'Galician': 'gl', 'Georgian': 'ka', 'German': 'de', 'Greek': 'el', + 'Hungarian': 'hu', 'Indonesian': 'id', 'Italian': 'it', 'Japanese': 'ja', + 'Kabyle': 'kab', 'Korean': 'ko', 'Lithuanian': 'lt', 'Norwegian': 'no', + 'Polish': 'pl', 'Portuguese': 'pt-PT', 'Portuguese, Brazilian': 'pt-BR', + 'Romanian': 'ro', 'Russian': 'ru', 'Serbian': 'sr', 'Serbian, Latin': 'sr-CS', + 'Slovak': 'sk', 'Slovenian': 'sl', 'Spanish': 'es-ES', 'Spanish, Argentina': 'es-AR', +'Swedish': 'sv-SE', 'Turkish': 'tr', 'Ukrainian': 'uk', 'Valencian': 'val-ES', +'Vietnamese': 'vi'} +``` + +## Translating + +To edit your language file open your file in `Qt Linguist` from `qt5-tools`/`qt6-tools` +package or in a text editor like `xed`, `mousepad`, `gedit`, `nano`, `vim`/`nvim`, +`geany` etc. and translate it. + +Alternatively you can visit the **FreeCAD-addons** project on CrowdIn platform +at webpage and find your language, +once done, look for the **Plot** project. + +## Compiling translations + +To convert all `.ts` files to `.qm` files (merge) you can use this command: + +```shell +./update_translation.sh -R +``` + +If you are a translator that wants to update only their language file +to test it on **FreeCAD** before doing a PR you can use this command: + +```shell +./update_translation.sh -r es-ES +``` + +This will update the `.qm` file for your language (Spanish (Spain) in this case). + +## Sending translations + +Now you can contribute your translated `.ts` file to **Plot** repository, +also include the `.qm` file. + + + +## More information + +You can read more about translating external workbenches here: + + diff --git a/freecad/plot/resources/translations/update_translation.sh b/freecad/plot/resources/translations/update_translation.sh new file mode 100755 index 0000000..b1b3cf3 --- /dev/null +++ b/freecad/plot/resources/translations/update_translation.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash + +# -------------------------------------------------------------------------------------------------- +# +# Create, update and release translation files. +# +# Supported locales on FreeCAD <2024-10-09, FreeCADGui.supportedLocales(), total=44>: +# {'English': 'en', 'Afrikaans': 'af', 'Arabic': 'ar', 'Basque': 'eu', 'Belarusian': 'be', +# 'Bulgarian': 'bg', 'Catalan': 'ca', 'Chinese Simplified': 'zh-CN', +# 'Chinese Traditional': 'zh-TW', 'Croatian': 'hr', 'Czech': 'cs', 'Danish': 'da', +# 'Dutch': 'nl', 'Filipino': 'fil', 'Finnish': 'fi', 'French': 'fr', 'Galician': 'gl', +# 'Georgian': 'ka', 'German': 'de', 'Greek': 'el', 'Hungarian': 'hu', 'Indonesian': 'id', +# 'Italian': 'it', 'Japanese': 'ja', 'Kabyle': 'kab', 'Korean': 'ko', 'Lithuanian': 'lt', +# 'Norwegian': 'no', 'Polish': 'pl', 'Portuguese': 'pt-PT', 'Portuguese, Brazilian': 'pt-BR', +# 'Romanian': 'ro', 'Russian': 'ru', 'Serbian': 'sr', 'Serbian, Latin': 'sr-CS', 'Slovak': 'sk', +# 'Slovenian': 'sl', 'Spanish': 'es-ES', 'Spanish, Argentina': 'es-AR', 'Swedish': 'sv-SE', +# 'Turkish': 'tr', 'Ukrainian': 'uk', 'Valencian': 'val-ES', 'Vietnamese': 'vi'} +# +# NOTE: PREPARATION +# - Install Qt tools +# Debian-based (e.g., Ubuntu): $ sudo apt-get install qttools5-dev-tools pyqt6-dev-tools +# Fedora-based: $ sudo dnf install qt6-linguist qt6-devel +# Arch-based: $ sudo pacman -S qt6-tools python-pyqt6 +# - Make the script executable +# $ chmod +x update_translation.sh +# - The script has to be executed within the `freecad/plot/resources/translations` directory. +# Executing the script with no flags invokes the help. +# $ ./update_translation.sh +# +# NOTE: WORKFLOW TRANSLATOR (LOCAL) +# - Execute the script passing the `-u` flag plus locale code as argument +# Only update the file(s) you're translating! +# $ ./update_translation.sh -u es-ES +# - Do the translation via Qt Linguist and use `File>Release` +# - If releasing with the script execute it passing the `-r` flag +# plus locale code as argument +# $ ./update_translation.sh -r es-ES +# +# NOTE: WORKFLOW MAINTAINER (CROWDIN) +# - Execute the script passing the '-U' flag +# $ ./update_translation.sh -U +# - Upload the updated file to CrowdIn and wait for translators do their thing ;-) +# - Once done, download the translated files, copy them to `freecad/plot/resources/translations` +# and release all the files to update the changes +# $ ./update_translation.sh -R +# +# -------------------------------------------------------------------------------------------------- + +supported_locales=( + "en" "af" "ar" "eu" "be" "bg" "ca" "zh-CN" "zh-TW" "hr" + "cs" "da" "nl" "fil" "fi" "fr" "gl" "ka" "de" "el" + "hu" "id" "it" "ja" "kab" "ko" "lt" "no" "pl" "pt-PT" + "pt-BR" "ro" "ru" "sr" "sr-CS" "sk" "sl" "es-ES" "es-AR" "sv-SE" + "tr" "uk" "val-ES" "vi" +) + +is_locale_supported() { + local locale="$1" + for supported_locale in "${supported_locales[@]}"; do + [ "$supported_locale" == "$locale" ] && return 0 + done + return 1 +} + +update_locale() { + local locale="$1" + local u=${locale:+_} # Conditional underscore + FILES="../../{PlotGui,init_gui}.py \ + ../../plot{Axes,Labels,Positions,Save,Series}/TaskPanel.py \ + ../ui/*.ui" + + # NOTE: Execute the right command depending on: + # - if it's a locale file or the main, agnostic one + [ ! -f "${WB}${u}${locale}.ts" ] && action="Creating" || action="Updating" + echo -e "\033[1;34m\n\t<<< ${action} '${WB}${u}${locale}.ts' file >>>\n\033[m" + if [ "$u" == "" ]; then + eval $LUPDATE "$FILES" -ts "${WB}.ts" # locale-agnostic file + else + eval $LUPDATE "$FILES" -source-language en_US -target-language "${locale//-/_}" \ + -ts "${WB}_${locale}.ts" + fi +} + +help() { + echo -e "\nDescription:" + echo -e "\tCreate, update and release translation files." + echo -e "\nUsage:" + echo -e "\t./update_translation.sh [-R] [-U] [-r ] [-u ]" + echo -e "\nFlags:" + echo -e " -R\n\tRelease all locales" + echo -e " -U\n\tUpdate main translation file (locale agnostic)" + echo -e " -r \n\tRelease the specified locale" + echo -e " -u \n\tUpdate strings for the specified locale" +} + +# Main function ------------------------------------------------------------------------------------ + +LUPDATE=/usr/lib/qt6/bin/lupdate # from Qt6 +# LUPDATE=lupdate # from Qt5 +LRELEASE=/usr/lib/qt6/bin/lrelease # from Qt6 +# LRELEASE=lrelease # from Qt5 +WB="Plot" + +# Enforce underscore on locales +sed -i '3s/-/_/' ${WB}*.ts + +if [ $# -eq 1 ]; then + if [ "$1" == "-R" ]; then + find . -type f -name '*_*.ts' | while IFS= read -r file; do + # Release all locales + $LRELEASE "$file" + echo + done + elif [ "$1" == "-U" ]; then + # Update main file (agnostic) + update_locale + else + help + fi +elif [ $# -eq 2 ]; then + LOCALE="$2" + if is_locale_supported "$LOCALE"; then + if [ "$1" == "-r" ]; then + # Release locale (creation of *.qm file from *.ts file) + $LRELEASE "${WB}_${LOCALE}.ts" + elif [ "$1" == "-u" ]; then + # Update main & locale files + update_locale + update_locale "$LOCALE" + fi + else + echo "Verify your language code. Case sensitive." + echo "If it's correct, ask a maintainer to add support for your language on FreeCAD." + echo -e "\nSupported locales, '\033[1;34mFreeCADGui.supportedLocales()\033[m': \033[1;33m" + for locale in $(printf "%s\n" "${supported_locales[@]}" | sort); do + echo -n "$locale " + done + echo + fi +else + help +fi diff --git a/freecad/plot/resources/ui/TaskPanel_plotAxes.ui b/freecad/plot/resources/ui/TaskPanel_plotAxes.ui index b75f96c..db0d6ed 100644 --- a/freecad/plot/resources/ui/TaskPanel_plotAxes.ui +++ b/freecad/plot/resources/ui/TaskPanel_plotAxes.ui @@ -1,7 +1,7 @@ - TaskPanel - + TaskPanel_plotAxes + 0 @@ -43,7 +43,7 @@ - + 5 0 diff --git a/freecad/plot/resources/ui/TaskPanel_plotLabels.ui b/freecad/plot/resources/ui/TaskPanel_plotLabels.ui index 2038163..73acec7 100644 --- a/freecad/plot/resources/ui/TaskPanel_plotLabels.ui +++ b/freecad/plot/resources/ui/TaskPanel_plotLabels.ui @@ -1,7 +1,7 @@ - TaskPanel - + TaskPanel_plotLabels + 0 diff --git a/freecad/plot/resources/ui/TaskPanel_plotPositions.ui b/freecad/plot/resources/ui/TaskPanel_plotPositions.ui index 18cc7ac..91d8d0b 100644 --- a/freecad/plot/resources/ui/TaskPanel_plotPositions.ui +++ b/freecad/plot/resources/ui/TaskPanel_plotPositions.ui @@ -1,7 +1,7 @@ - TaskPanel - + TaskPanel_plotPositions + 0 diff --git a/freecad/plot/resources/ui/TaskPanel_plotSave.ui b/freecad/plot/resources/ui/TaskPanel_plotSave.ui index 9bc79fc..f3e4c9e 100644 --- a/freecad/plot/resources/ui/TaskPanel_plotSave.ui +++ b/freecad/plot/resources/ui/TaskPanel_plotSave.ui @@ -1,7 +1,7 @@ - TaskPanel - + TaskPanel_plotSave + 0 diff --git a/freecad/plot/resources/ui/TaskPanel_plotSeries.ui b/freecad/plot/resources/ui/TaskPanel_plotSeries.ui index 3fbde16..8e13345 100644 --- a/freecad/plot/resources/ui/TaskPanel_plotSeries.ui +++ b/freecad/plot/resources/ui/TaskPanel_plotSeries.ui @@ -1,7 +1,7 @@ - TaskPanel - + TaskPanel_plotSeries + 0