Commit 3e62accf authored by Gabriel Rodrigues's avatar Gabriel Rodrigues

Add localisation for start, stop and standby buttons

parent e5837cac
Pipeline #1517 canceled with stages
......@@ -226,7 +226,7 @@ class NativeUI(HEVClient, QMainWindow):
self.PlotSignal.connect(self.widgets.detailed_plots.update_plot_data)
self.PlotSignal.connect(self.widgets.charts_widget.update_plot_data)
# When measurement data is updated, measurement widgets shouldupdate
# When measurement data is updated, measurement widgets should update
self.MeasurementSignal.connect(self.widgets.normal_measurements.update_value)
self.MeasurementSignal.connect(self.widgets.detailed_measurements.update_value)
......@@ -237,6 +237,9 @@ class NativeUI(HEVClient, QMainWindow):
self.widgets.localisation_button.SetLocalisation.connect(
self.widgets.normal_plots.localise_text
)
self.widgets.localisation_button.SetLocalisation.connect(
self.widgets.ventilator_start_stop_buttons_widget.localise_text
)
return 0
......
{
"language_name": "English",
"start_button": "START",
"stop_button": "STOP",
"standby_button": "STANDBY",
"plot_axis_label_pressure": "Pressure [cmH<sub>2</sub>O]",
"plot_axis_label_flow": "Flow [L/min]",
"plot_axis_label_volume": "Volume [mL]",
......
{
"language_name": "Portugues",
"start_button": "INICIAR",
"stop_button": "PARAR",
"standby_button": "ESPERAR",
"plot_axis_label_pressure": "Pressao [cmH<sub>2</sub>O]",
"plot_axis_label_flow": "Fluxo [L/min]",
"plot_axis_label_volume": "Volume [mL]",
......
......@@ -15,6 +15,7 @@ __status__ = "Prototype"
import logging
from PySide2 import QtGui, QtWidgets
from PySide2.QtCore import QSize
from PySide2 import QtCore
from global_widgets.tab_hold_buttons import holdButton
......@@ -40,7 +41,7 @@ class VentilatorStartStopButtonsWidget(QtWidgets.QWidget):
self.button_standby = holdButton(NativeUI) # QtWidgets.QPushButton()
self.__buttons = [self.button_start, self.button_stop, self.button_standby]
self.__buttontext = ["START", "STOP", "STANDBY"]
self.localise_text(NativeUI.text)
self.__buttoncommand = [""]
for button, text in zip(self.__buttons, self.__buttontext):
......@@ -121,3 +122,17 @@ class VentilatorStartStopButtonsWidget(QtWidgets.QWidget):
for button in self.__buttons:
button.setFont(font)
return 0
@QtCore.Slot(dict)
def localise_text(self, text: dict):
self.__buttontext = [
text["start_button"],
text["stop_button"],
text["standby_button"]]
self.button_start.setText(text["start_button"])
self.button_stop.setText(text["stop_button"])
self.button_standby.setText(text["standby_button"])
return 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment