mirror of https://gitlab.com/pamhyr/pamhyr2
LC: Fix table translate.
parent
ecefb39265
commit
f4545b0075
|
|
@ -41,7 +41,7 @@ from View.Plot.MplCanvas import MplCanvas
|
|||
from View.Plot.PamhyrToolbar import PamhyrPlotToolbar
|
||||
|
||||
from View.LateralContribution.translate import long_types
|
||||
from View.LateralContribution.Edit.translate import table_headers
|
||||
from View.LateralContribution.Edit.translate import table_headers, retranslate
|
||||
from View.LateralContribution.Edit.Table import TableModel
|
||||
from View.LateralContribution.Edit.Plot import Plot
|
||||
|
||||
|
|
@ -87,6 +87,7 @@ class EditLateralContributionWindow(ASubMainWindow, ListedSubWindow):
|
|||
self.paste_sc = QShortcut(QKeySequence.Paste, self)
|
||||
|
||||
def setup_table(self):
|
||||
retranslate()
|
||||
headers = {}
|
||||
for h in self._data.header:
|
||||
headers[h] = table_headers[h]
|
||||
|
|
|
|||
|
|
@ -28,3 +28,11 @@ table_headers = {
|
|||
"discharge": _translate("LateralContribution", "Discharge (m³/s)"),
|
||||
"z": _translate("LateralContribution", "Z (m)")
|
||||
}
|
||||
|
||||
def retranslate():
|
||||
table_headers["x"] = _translate("LateralContribution", "X")
|
||||
table_headers["y"] = _translate("LateralContribution", "Y")
|
||||
table_headers["time"] = _translate("LateralContribution", "Time")
|
||||
table_headers["date"] = _translate("LateralContribution", "Date")
|
||||
table_headers["discharge"] = _translate("LateralContribution", "Discharge (m³/s)")
|
||||
table_headers["z"] = _translate("LateralContribution", "Z (m)")
|
||||
|
|
|
|||
|
|
@ -56,7 +56,10 @@ from View.LateralContribution.Table import (
|
|||
|
||||
from View.Plot.MplCanvas import MplCanvas
|
||||
from View.Geometry.PlotXY import PlotXY
|
||||
from View.LateralContribution.translate import *
|
||||
from View.LateralContribution.translate import (
|
||||
long_types, table_headers, LC_types,
|
||||
retranslate,
|
||||
)
|
||||
from View.LateralContribution.Edit.Window import EditLateralContributionWindow
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
|
@ -90,6 +93,7 @@ class LateralContributionWindow(ASubMainWindow, ListedSubWindow):
|
|||
self.paste_sc = QShortcut(QKeySequence.Paste, self)
|
||||
|
||||
def setup_table(self):
|
||||
retranslate()
|
||||
self._table = {}
|
||||
|
||||
for t in ["liquid", "solid", "suspenssion"]:
|
||||
|
|
|
|||
|
|
@ -45,3 +45,15 @@ LC_types = {
|
|||
"RA": Rain,
|
||||
"EV": Evaporation,
|
||||
}
|
||||
|
||||
def retranslate():
|
||||
table_headers["name"] = _translate("LateralContribution", "Name")
|
||||
table_headers["type"] = _translate("LateralContribution", "Type")
|
||||
table_headers["edge"] = _translate("LateralContribution", "Reach")
|
||||
table_headers["begin_kp"] = _translate("LateralContribution", "Begin kp (m)")
|
||||
table_headers["end_kp"] = _translate("LateralContribution", "End kp (m)")
|
||||
|
||||
long_types["ND"] = _translate("LateralContribution", "Not defined")
|
||||
long_types["LC"] = _translate("LateralContribution", "Lateral contribution")
|
||||
long_types["RA"] = _translate("LateralContribution", "Rain")
|
||||
long_types["EV"] = _translate("LateralContribution", "Evaporation")
|
||||
|
|
|
|||
Loading…
Reference in New Issue