mirror of https://gitlab.com/pamhyr/pamhyr2
BC: Fix table translate.
parent
95288e6eef
commit
ecefb39265
|
|
@ -45,7 +45,7 @@ from View.Plot.MplCanvas import MplCanvas
|
||||||
from View.Plot.PamhyrToolbar import PamhyrPlotToolbar
|
from View.Plot.PamhyrToolbar import PamhyrPlotToolbar
|
||||||
|
|
||||||
from View.BoundaryCondition.translate import long_types
|
from View.BoundaryCondition.translate import long_types
|
||||||
from View.BoundaryCondition.Edit.translate import table_headers
|
from View.BoundaryCondition.Edit.translate import table_headers, retranslate
|
||||||
from View.BoundaryCondition.Edit.UndoCommand import SetMetaDataCommand
|
from View.BoundaryCondition.Edit.UndoCommand import SetMetaDataCommand
|
||||||
from View.BoundaryCondition.Edit.Table import TableModel
|
from View.BoundaryCondition.Edit.Table import TableModel
|
||||||
from View.BoundaryCondition.Edit.Plot import Plot
|
from View.BoundaryCondition.Edit.Plot import Plot
|
||||||
|
|
@ -147,6 +147,7 @@ class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self._d50sigma.set_sigma(self._data.sigma)
|
self._d50sigma.set_sigma(self._data.sigma)
|
||||||
|
|
||||||
def setup_table(self):
|
def setup_table(self):
|
||||||
|
retranslate()
|
||||||
headers = {}
|
headers = {}
|
||||||
for h in self._data.header:
|
for h in self._data.header:
|
||||||
headers[h] = table_headers[h]
|
headers[h] = table_headers[h]
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,12 @@ table_headers = {
|
||||||
"z": _translate("BoundaryCondition", "Z (m)"),
|
"z": _translate("BoundaryCondition", "Z (m)"),
|
||||||
"solid": _translate("BoundaryCondition", "Solid (kg/s)"),
|
"solid": _translate("BoundaryCondition", "Solid (kg/s)"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def retranslate():
|
||||||
|
table_headers["x"] = _translate("BoundaryCondition", "X")
|
||||||
|
table_headers["y"] = _translate("BoundaryCondition", "Y")
|
||||||
|
table_headers["time"] = _translate("BoundaryCondition", "Time")
|
||||||
|
table_headers["date"] = _translate("BoundaryCondition", "Date")
|
||||||
|
table_headers["discharge"] = _translate("BoundaryCondition", "Discharge (m³/s)")
|
||||||
|
table_headers["z"] = _translate("BoundaryCondition", "Z (m)")
|
||||||
|
table_headers["solid"] = _translate("BoundaryCondition", "Solid (kg/s)")
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ from View.BoundaryCondition.Table import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from View.Network.GraphWidget import GraphWidget
|
from View.Network.GraphWidget import GraphWidget
|
||||||
from View.BoundaryCondition.translate import *
|
from View.BoundaryCondition.translate import table_headers, retranslate
|
||||||
from View.BoundaryCondition.Edit.Window import EditBoundaryConditionWindow
|
from View.BoundaryCondition.Edit.Window import EditBoundaryConditionWindow
|
||||||
|
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
@ -90,6 +90,7 @@ class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self.paste_sc = QShortcut(QKeySequence.Paste, self)
|
self.paste_sc = QShortcut(QKeySequence.Paste, self)
|
||||||
|
|
||||||
def setup_table(self):
|
def setup_table(self):
|
||||||
|
retranslate()
|
||||||
self._table = {}
|
self._table = {}
|
||||||
|
|
||||||
for t in ["liquid", "solid", "suspenssion"]:
|
for t in ["liquid", "solid", "suspenssion"]:
|
||||||
|
|
|
||||||
|
|
@ -49,3 +49,8 @@ BC_types = {
|
||||||
"ZD": ZOverDischarge,
|
"ZD": ZOverDischarge,
|
||||||
"SL": Solid,
|
"SL": Solid,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def retranslate():
|
||||||
|
table_headers["name"] = _translate("BoundaryCondition", "Name")
|
||||||
|
table_headers["type"] = _translate("BoundaryCondition", "Type")
|
||||||
|
table_headers["node"] = _translate("BoundaryCondition", "Node")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue