mirror of https://gitlab.com/pamhyr/pamhyr2
Pamhyr: Factorize some translate.
parent
b3a7e7f465
commit
2e158f4c1b
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
from View.BoundaryCondition.translate import BCTranslate
|
||||
|
||||
|
|
@ -36,9 +36,9 @@ class BCETranslate(BCTranslate):
|
|||
self._sub_dict["table_headers"] = {
|
||||
"x": _translate("BoundaryCondition", "X"),
|
||||
"y": _translate("BoundaryCondition", "Y"),
|
||||
"time": _translate("BoundaryCondition", "Time"),
|
||||
"date": _translate("BoundaryCondition", "Date"),
|
||||
"discharge": _translate("BoundaryCondition", "Discharge (m³/s)"),
|
||||
"z": _translate("BoundaryCondition", "Z (m)"),
|
||||
"time": self._dict["time"],
|
||||
"date": self._dict["date"],
|
||||
"discharge": self._dict["unit_discharge"],
|
||||
"z": self._dict["unit_elevation"],
|
||||
"solid": _translate("BoundaryCondition", "Solid (kg/s)"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
from Model.BoundaryCondition.BoundaryConditionTypes import (
|
||||
NotDefined, PonctualContribution,
|
||||
|
|
@ -38,7 +38,7 @@ BC_types = {
|
|||
}
|
||||
|
||||
|
||||
class BCTranslate(PamhyrTranslate):
|
||||
class BCTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(BCTranslate, self).__init__()
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ class BCTranslate(PamhyrTranslate):
|
|||
}
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("BoundaryCondition", "Name"),
|
||||
"type": _translate("BoundaryCondition", "Type"),
|
||||
"name": self._dict["name"],
|
||||
"type": self._dict["type"],
|
||||
"node": _translate("BoundaryCondition", "Node")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class CheckListTranslate(PamhyrTranslate):
|
||||
class CheckListTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(CheckListTranslate, self).__init__()
|
||||
|
||||
|
|
@ -32,6 +32,6 @@ class CheckListTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("CheckList", "Name"),
|
||||
"name": self._dict["name"],
|
||||
"status": _translate("CheckList", "Status"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class ConfigureTranslate(PamhyrTranslate):
|
||||
class ConfigureTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(ConfigureTranslate, self).__init__()
|
||||
|
||||
|
|
@ -32,9 +32,9 @@ class ConfigureTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("Configure", "Name"),
|
||||
"type": _translate("Configure", "Type"),
|
||||
"description": _translate("Configure", "Description"),
|
||||
"name": self._dict["name"],
|
||||
"type": self._dict["type"],
|
||||
"description": self._dict["description"],
|
||||
}
|
||||
|
||||
# Solvers
|
||||
|
|
|
|||
|
|
@ -18,18 +18,16 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class FrictionsTranslate(PamhyrTranslate):
|
||||
class FrictionsTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(FrictionsTranslate, self).__init__()
|
||||
|
||||
self._dict["kp"] = _translate(
|
||||
"Frictions", "Kp (m)"
|
||||
)
|
||||
self._dict["kp"] = self._dict["unit_kp"]
|
||||
self._dict["stricklers"] = _translate(
|
||||
"Frictions", "Stricklers"
|
||||
)
|
||||
|
|
@ -39,8 +37,8 @@ class FrictionsTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
# "name": _translate("Frictions", "Name"),
|
||||
# "edge": _translate("Frictions", "Reach"),
|
||||
# "name": self._dict["name"],
|
||||
# "edge": self._dict["reach"],
|
||||
"begin_kp": _translate("Frictions", "Begin kp (m)"),
|
||||
"end_kp": _translate("Frictions", "End kp (m)"),
|
||||
"begin_strickler": _translate("Frictions", "Begin strickler"),
|
||||
|
|
|
|||
|
|
@ -21,12 +21,6 @@ import logging
|
|||
from tools import timer
|
||||
from View.Tools.PamhyrPlot import PamhyrPlot
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
QCoreApplication
|
||||
)
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
||||
|
|
@ -46,20 +40,12 @@ class PlotAC(PamhyrPlot):
|
|||
self._auto_relim_update = True
|
||||
self._autoscale_update = True
|
||||
|
||||
self.label_x = _translate(
|
||||
"Geometry", "Transverse abscissa (m)"
|
||||
)
|
||||
self.label_y = _translate("Geometry", "Height (m)")
|
||||
self.label_x = self._trad["transverse_abscissa"]
|
||||
self.label_y = self._trad["unit_height"]
|
||||
|
||||
self.label_previous_plot_selected = _translate(
|
||||
"Geometry", "Previous cross-section"
|
||||
)
|
||||
self.label_plot_selected = _translate(
|
||||
"Geometry", "Cross-section"
|
||||
)
|
||||
self.label_next_plot_selected = _translate(
|
||||
"Geometry", "Next cross-section"
|
||||
)
|
||||
self.label_previous_plot_selected = self._trad["prev_cs"]
|
||||
self.label_plot_selected = self._trad["cs"]
|
||||
self.label_next_plot_selected = self._trad["next_cs"]
|
||||
|
||||
self.previous_plot_selected = None
|
||||
self.plot_selected = None
|
||||
|
|
|
|||
|
|
@ -21,12 +21,6 @@ import logging
|
|||
from tools import timer
|
||||
from View.Tools.PamhyrPlot import PamhyrPlot
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
QCoreApplication
|
||||
)
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
||||
|
|
@ -48,8 +42,8 @@ class PlotKPZ(PamhyrPlot):
|
|||
self.line_kp_zmin_zmax = None
|
||||
self.line_kp_zmin_zmax_highlight = None
|
||||
|
||||
self.label_x = _translate("MainWindow_reach", "Kp (m)")
|
||||
self.label_y = _translate("MainWindow_reach", "Height (m)")
|
||||
self.label_x = self._trad["unit_kp"]
|
||||
self.label_y = self._trad["unit_height"]
|
||||
|
||||
self.before_plot_selected = None
|
||||
self.plot_selected = None
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ class PlotXY(PamhyrPlot):
|
|||
self.line_xy = []
|
||||
self.line_gl = []
|
||||
|
||||
self.label_x = _translate("Geometry", "X (m)")
|
||||
self.label_y = _translate("Geometry", "Y (m)")
|
||||
self.label_x = self._trad["x"]
|
||||
self.label_y = self._trad["y"]
|
||||
|
||||
self.before_plot_selected = None
|
||||
self.plot_selected = None
|
||||
|
|
|
|||
|
|
@ -47,16 +47,18 @@ class Plot(PamhyrPlot):
|
|||
self.line_xy = []
|
||||
self.line_gl = []
|
||||
|
||||
self.label_x = self._trad["unit_kp"]
|
||||
self.label_y = self._trad["unit_height"]
|
||||
|
||||
self.before_plot_selected = None
|
||||
self.plot_selected = None
|
||||
self.after_plot_selected = None
|
||||
|
||||
self._isometric_axis = False
|
||||
|
||||
@timer
|
||||
def draw(self):
|
||||
self.canvas.axes.cla()
|
||||
self.canvas.axes.grid(
|
||||
color='grey', linestyle='--', linewidth=0.5
|
||||
)
|
||||
self.init_axes()
|
||||
|
||||
x = self.data.get_station()
|
||||
y = self.data.z()
|
||||
|
|
@ -71,19 +73,10 @@ class Plot(PamhyrPlot):
|
|||
gl = map(lambda p: p.name, self.data.points)
|
||||
|
||||
self.profile_line2D, = self.canvas.axes.plot(
|
||||
x, y, color='r', lw=1.5,
|
||||
markersize=7, marker='+',
|
||||
x, y, color=self.color_plot,
|
||||
lw=1.5, markersize=7, marker='+',
|
||||
picker=30
|
||||
)
|
||||
self.canvas.axes.set_xlabel(
|
||||
_translate("MainWindowProfile",
|
||||
"Transverse abscissa (m)"),
|
||||
color='black', fontsize=10
|
||||
)
|
||||
self.canvas.axes.set_ylabel(
|
||||
_translate("MainWindowProfile", "Height (m)"),
|
||||
color='black', fontsize=10
|
||||
)
|
||||
|
||||
# Add label on graph
|
||||
self.annotation = []
|
||||
|
|
@ -142,10 +135,8 @@ class Plot(PamhyrPlot):
|
|||
self.onclick_event.onclick
|
||||
)
|
||||
|
||||
self.canvas.figure.tight_layout()
|
||||
self.canvas.figure.canvas.draw_idle()
|
||||
self.idle()
|
||||
|
||||
@timer
|
||||
def update(self, ind=None):
|
||||
logger.info("TODO: implemente update")
|
||||
def update(self):
|
||||
self.draw()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
from View.Geometry.Translate import GeometryTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
|
@ -33,9 +33,9 @@ class GeometryProfileTranslate(GeometryTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"x": _translate("Geometry", "X (m)"),
|
||||
"y": _translate("Geometry", "Y (m)"),
|
||||
"z": _translate("Geometry", "Z (m)"),
|
||||
"name": _translate("Geometry", "Name"),
|
||||
"x": self._dict["x"],
|
||||
"y": self._dict["y"],
|
||||
"z": self._dict["z"],
|
||||
"name": self._dict["name"],
|
||||
"abs": _translate("Geometry", "Traversal abs (m)"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ class ProfileWindow(PamhyrWindow):
|
|||
self._plot = Plot(
|
||||
canvas=self._canvas,
|
||||
data=self._profile,
|
||||
trad=self._trad,
|
||||
toolbar=self._toolbar,
|
||||
table=self.find(QTableView, "tableView")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class GeometryTranslate(PamhyrTranslate):
|
||||
class GeometryTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(GeometryTranslate, self).__init__()
|
||||
|
||||
|
|
@ -38,17 +38,28 @@ class GeometryTranslate(PamhyrTranslate):
|
|||
"Geometry", "File mage meshed geometry (*.M *.m)")
|
||||
self._dict["file_all"] = _translate("Geometry", "All file (*)")
|
||||
|
||||
self._dict["reach"] = _translate("Geometry", "reach")
|
||||
self._dict["reachs"] = _translate("Geometry", "reachs")
|
||||
|
||||
self._dict["cross_section"] = _translate("Geometry", "cross-section")
|
||||
self._dict["cross_sections"] = _translate("Geometry", "cross-sections")
|
||||
self._dict["profile"] = _translate("Geometry", "cross-section")
|
||||
self._dict["profiles"] = _translate("Geometry", "cross-sections")
|
||||
|
||||
self._dict["transverse_abscissa"] = _translate(
|
||||
"Geometry", "Transverse abscissa (m)"
|
||||
)
|
||||
|
||||
self._dict["prev_cs"] = _translate(
|
||||
"Geometry", "Previous cross-section"
|
||||
)
|
||||
self._dict["cs"] = _translate("Geometry", "Cross-section")
|
||||
self._dict["next_cs"] = _translate("Geometry", "Next cross-section")
|
||||
|
||||
self._dict["x"] = _translate("Geometry", "X (m)")
|
||||
self._dict["y"] = _translate("Geometry", "Y (m)")
|
||||
self._dict["z"] = _translate("Geometry", "Z (m)")
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("Geometry", "Name"),
|
||||
"kp": _translate("Geometry", "KP (m)"),
|
||||
"name": self._dict["name"],
|
||||
"kp": self._dict["unit_kp"],
|
||||
"poins": _translate("Geometry", "Points"),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -327,6 +327,7 @@ class GeometryWindow(PamhyrWindow):
|
|||
self._plot_xy = PlotXY(
|
||||
canvas=self._canvas_xy,
|
||||
data=self._reach,
|
||||
trad=self._trad,
|
||||
toolbar=self._toolbar_xy
|
||||
)
|
||||
self._plot_xy.draw()
|
||||
|
|
@ -344,6 +345,7 @@ class GeometryWindow(PamhyrWindow):
|
|||
self._plot_kpc = PlotKPZ(
|
||||
canvas=self._canvas_kpc,
|
||||
data=self._reach,
|
||||
trad=self._trad,
|
||||
toolbar=self._toolbar_kpc
|
||||
)
|
||||
self._plot_kpc.draw()
|
||||
|
|
@ -361,6 +363,7 @@ class GeometryWindow(PamhyrWindow):
|
|||
self._plot_ac = PlotAC(
|
||||
canvas=self._canvas_ac,
|
||||
data=self._reach,
|
||||
trad=self._trad,
|
||||
toolbar=self._toolbar_ac,
|
||||
)
|
||||
self._plot_ac.draw()
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class BasicHydraulicStructuresTranslate(PamhyrTranslate):
|
||||
class BasicHydraulicStructuresTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(BasicHydraulicStructuresTranslate, self).__init__()
|
||||
|
||||
|
|
@ -44,18 +44,10 @@ hydraulic structure values?"
|
|||
|
||||
# BHSValues translation
|
||||
|
||||
self._dict['width'] = _translate(
|
||||
"BasicHydraulicStructures", "Width (m)"
|
||||
)
|
||||
self._dict['height'] = _translate(
|
||||
"BasicHydraulicStructures", "Thickness (m)"
|
||||
)
|
||||
self._dict['elevation'] = _translate(
|
||||
"BasicHydraulicStructures", "Elevation (m)"
|
||||
)
|
||||
self._dict['diameter'] = _translate(
|
||||
"BasicHydraulicStructures", "Diameter (m)"
|
||||
)
|
||||
self._dict['width'] = self._dict["unit_width"]
|
||||
self._dict['height'] = self._dict["unit_thickness"]
|
||||
self._dict['elevation'] = self._dict["unit_elevation"]
|
||||
self._dict['diameter'] = self._dict["unit_diameter"]
|
||||
self._dict['discharge_coefficient'] = _translate(
|
||||
"BasicHydraulicStructures", "Discharge coefficient"
|
||||
)
|
||||
|
|
@ -155,11 +147,11 @@ hydraulic structure values?"
|
|||
# Tables
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("BasicHydraulicStructures", "Name"),
|
||||
"type": _translate("BasicHydraulicStructures", "Type"),
|
||||
"name": self._dict["name"],
|
||||
"type": self._dict["type"],
|
||||
}
|
||||
|
||||
self._sub_dict["table_headers_parameters"] = {
|
||||
"name": _translate("BasicHydraulicStructures", "Name"),
|
||||
"value": _translate("BasicHydraulicStructures", "Value"),
|
||||
"name": self._dict["name"],
|
||||
"value": self._dict["value"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,6 @@ from tools import timer
|
|||
from View.Tools.PamhyrPlot import PamhyrPlot
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
QCoreApplication
|
||||
)
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class PlotAC(PamhyrPlot):
|
||||
def __init__(self, canvas=None, trad=None, toolbar=None,
|
||||
|
|
@ -42,8 +36,8 @@ class PlotAC(PamhyrPlot):
|
|||
self._current_reach = reach
|
||||
self._current_profile = profile
|
||||
|
||||
self.label_x = _translate("MainWindow_reach", "X (m)")
|
||||
self.label_y = _translate("MainWindow_reach", "Elevation (m)")
|
||||
self.label_x = self._trad["x"]
|
||||
self.label_y = self._trad["unit_elevation"]
|
||||
|
||||
self._isometric_axis = False
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ class PlotKPC(PamhyrPlot):
|
|||
self._current_reach = reach
|
||||
self._current_profile = profile
|
||||
|
||||
self.label_x = _translate("MainWindow_reach", "KP (m)")
|
||||
self.label_y = _translate("MainWindow_reach", "Elevation (m)")
|
||||
self.label_x = self._trad["unit_kp"]
|
||||
self.label_y = self._trad["unit_elevation"]
|
||||
|
||||
self._isometric_axis = False
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class HydraulicStructuresTranslate(PamhyrTranslate):
|
||||
class HydraulicStructuresTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(HydraulicStructuresTranslate, self).__init__()
|
||||
|
||||
|
|
@ -31,8 +31,10 @@ class HydraulicStructuresTranslate(PamhyrTranslate):
|
|||
"HydraulicStructures", "Hydraulic Structures"
|
||||
)
|
||||
|
||||
self._dict["x"] = _translate("HydraulicStructures", "X (m)")
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("HydraulicStructures", "Name"),
|
||||
"reach": _translate("HydraulicStructures", "Reach"),
|
||||
"kp": _translate("HydraulicStructures", "Kp (m)"),
|
||||
"name": self._dict["name"],
|
||||
"reach": self._dict["reach"],
|
||||
"kp": self._dict["unit_kp"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,6 @@ from View.HydraulicStructures.BasicHydraulicStructures.Window import (
|
|||
BasicHydraulicStructuresWindow
|
||||
)
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
||||
|
|
@ -142,6 +140,7 @@ class HydraulicStructuresWindow(PamhyrWindow):
|
|||
river=self._study.river,
|
||||
reach=None,
|
||||
profile=None,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar
|
||||
)
|
||||
self.plot_kpc.draw()
|
||||
|
|
@ -160,6 +159,7 @@ class HydraulicStructuresWindow(PamhyrWindow):
|
|||
river=self._study.river,
|
||||
reach=None,
|
||||
profile=None,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_2
|
||||
)
|
||||
self.plot_ac.draw()
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class ICTranslate(PamhyrTranslate):
|
||||
class ICTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(ICTranslate, self).__init__()
|
||||
|
||||
|
|
@ -34,18 +34,16 @@ class ICTranslate(PamhyrTranslate):
|
|||
self._dict["Height"] = _translate(
|
||||
"InitialCondition", "Height")
|
||||
|
||||
self._dict["elevation"] = _translate(
|
||||
"InitialCondition", "Elevation (m)")
|
||||
self._dict["discharge"] = _translate(
|
||||
"InitialCondition", "Discharge (m³/s)")
|
||||
self._dict["kp"] = _translate("InitialCondition", "KP (m)")
|
||||
self._dict["elevation"] = self._dict["unit_elevation"]
|
||||
self._dict["discharge"] = self._dict["unit_discharge"]
|
||||
self._dict["kp"] = self._dict["unit_kp"]
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
# "name": _translate("InitialCondition", "Name"),
|
||||
"kp": _translate("InitialCondition", "KP (m)"),
|
||||
"kp": self._dict["unit_kp"],
|
||||
# "speed": _translate("InitialCondition", "Speed (m/s)"),
|
||||
"discharge": _translate("InitialCondition", "Discharge (m³/s)"),
|
||||
"elevation": _translate("InitialCondition", "Elevation (m)"),
|
||||
"height": _translate("InitialCondition", "Height (m)"),
|
||||
"discharge": self._dict["unit_discharge"],
|
||||
"elevation": self._dict["unit_elevation"],
|
||||
"height": self._dict["unit_height"],
|
||||
# "comment": _translate("InitialCondition", "Comment"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
from View.LateralContribution.translate import LCTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
|
@ -34,8 +34,8 @@ class LCETranslate(LCTranslate):
|
|||
self._sub_dict["table_headers"] = {
|
||||
"x": _translate("LateralContribution", "X"),
|
||||
"y": _translate("LateralContribution", "Y"),
|
||||
"time": _translate("LateralContribution", "Time"),
|
||||
"date": _translate("LateralContribution", "Date"),
|
||||
"discharge": _translate("LateralContribution", "Discharge (m³/s)"),
|
||||
"z": _translate("LateralContribution", "Z (m)")
|
||||
"time": self._dict["time"],
|
||||
"date": self._dict["date"],
|
||||
"discharge": self._dict["unit_discharge"],
|
||||
"z": self._dict["unit_elevation"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
from Model.LateralContribution.LateralContributionTypes import (
|
||||
NotDefined, LateralContrib, Rain, Evaporation,
|
||||
|
|
@ -34,7 +34,7 @@ LC_types = {
|
|||
}
|
||||
|
||||
|
||||
class LCTranslate(PamhyrTranslate):
|
||||
class LCTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(LCTranslate, self).__init__()
|
||||
|
||||
|
|
@ -50,9 +50,9 @@ class LCTranslate(PamhyrTranslate):
|
|||
}
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("LateralContribution", "Name"),
|
||||
"type": _translate("LateralContribution", "Type"),
|
||||
"edge": _translate("LateralContribution", "Reach"),
|
||||
"name": self._dict["name"],
|
||||
"type": self._dict["type"],
|
||||
"edge": self._dict["reach"],
|
||||
"begin_kp": _translate("LateralContribution", "Begin kp (m)"),
|
||||
"end_kp": _translate("LateralContribution", "End kp (m)")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ from View.Tools.ASubWindow import WindowToolKit
|
|||
from View.Tools.ListedSubWindow import ListedSubWindow
|
||||
from View.DummyWindow import DummyWindow
|
||||
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
from View.Configure.Window import ConfigureWindow
|
||||
from View.Study.Window import NewStudyWindow
|
||||
from View.About.Window import AboutWindow
|
||||
|
|
@ -73,8 +75,6 @@ except Exception as e:
|
|||
|
||||
from Model.Study import Study
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
no_model_action = [
|
||||
|
|
@ -128,6 +128,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
# Model
|
||||
self._study = None
|
||||
|
||||
# Translate
|
||||
self._trad = MainTranslate()
|
||||
|
||||
# Results
|
||||
self._last_solver = None
|
||||
self._last_results = None
|
||||
|
|
@ -145,9 +148,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
self.setup_results()
|
||||
self.setup_timer()
|
||||
|
||||
self.trans = QTranslator(self)
|
||||
# self.ui.retranslateUi()
|
||||
|
||||
if not self.conf.close_correctly:
|
||||
if self.conf.last_study != "":
|
||||
self.dialog_reopen_study()
|
||||
|
|
@ -305,18 +305,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
|
||||
if init:
|
||||
self.debug_action = QAction("Debug", self)
|
||||
self.debug_action.setToolTip(
|
||||
_translate("MainWindow", "Open debug window")
|
||||
)
|
||||
self.debug_action.setToolTip(self._trad["open_debug"])
|
||||
self.debug_action.triggered.connect(self.open_debug)
|
||||
|
||||
self.debug_sqlite_action = QAction("Debug SQLite", self)
|
||||
self.debug_sqlite_action.setToolTip(
|
||||
_translate(
|
||||
"MainWindow",
|
||||
"Open SQLite debuging tool ('sqlitebrowser')"
|
||||
)
|
||||
)
|
||||
self.debug_sqlite_action.setToolTip(self._trad["open_debug_sql"])
|
||||
self.debug_sqlite_action.triggered.connect(self.open_sqlite)
|
||||
|
||||
if self.conf.debug:
|
||||
|
|
@ -635,9 +628,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
return lambda: self._activate_window(h)
|
||||
|
||||
action = QAction(window._title, self)
|
||||
action.setToolTip(
|
||||
_translate("MainWindow", "Activate this window")
|
||||
)
|
||||
action.setToolTip(self._trad["active_window"])
|
||||
h = window.hash()
|
||||
fn = lambda_generator(h)
|
||||
action.triggered.connect(fn)
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class NetworkTranslate(PamhyrTranslate):
|
||||
class NetworkTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(NetworkTranslate, self).__init__()
|
||||
|
||||
|
|
@ -32,12 +32,12 @@ class NetworkTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers_node"] = {
|
||||
"name": _translate("Network", "Name"),
|
||||
"type": _translate("Network", "Type"),
|
||||
"name": self._dict['name'],
|
||||
"type": self._dict['type'],
|
||||
}
|
||||
|
||||
self._sub_dict["table_headers_edge"] = {
|
||||
"name": _translate("Network", "Name"),
|
||||
"name": self._dict['name'],
|
||||
"node1": _translate("Network", "Source node"),
|
||||
"node2": _translate("Network", "Destination node"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
from View.Reservoir.Translate import ReservoirTranslate
|
||||
|
||||
|
|
@ -34,6 +34,6 @@ class EditReservoirTranslate(ReservoirTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"z": _translate("Reservoir", "Elevation (m)"),
|
||||
"Area": _translate("Reservoir", "Area (hectare)"),
|
||||
"z": self._dict["unit_elevation"],
|
||||
"Area": self._dict["unit_area"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class ReservoirTranslate(PamhyrTranslate):
|
||||
class ReservoirTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(ReservoirTranslate, self).__init__()
|
||||
|
||||
|
|
@ -32,6 +32,6 @@ class ReservoirTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("Reservoir", "Name"),
|
||||
"node": _translate("Reservoir", "Node")
|
||||
"name": self._dict["name"],
|
||||
"node": _translate("Reservoir", "Node"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,30 +33,20 @@ class CustomPlotTranslate(ResultsTranslate):
|
|||
|
||||
# Value type
|
||||
|
||||
self._dict['time'] = _translate(
|
||||
"CustomPlot", "Time (sec)"
|
||||
)
|
||||
self._dict['kp'] = _translate(
|
||||
"CustomPlot", "Kp (m)"
|
||||
)
|
||||
self._dict['time'] = self._dict["unit_time_s"]
|
||||
self._dict['kp'] = self._dict["unit_kp"]
|
||||
self._dict['water_elevation'] = self._dict["unit_water_elevation"]
|
||||
self._dict['discharge'] = self._dict["unit_discharge"]
|
||||
self._dict['elevation'] = _translate(
|
||||
"CustomPlot", "Bed load elevation (m)"
|
||||
)
|
||||
self._dict['water_elevation'] = _translate(
|
||||
"CustomPlot", "Water elevation (m)"
|
||||
)
|
||||
self._dict['discharge'] = _translate(
|
||||
"CustomPlot", "Discharge (m³/s)"
|
||||
)
|
||||
|
||||
# Unit corresponding long name (plot axes display)
|
||||
|
||||
self._dict['0-meter'] = _translate(
|
||||
"CustomPlot", "Bed load elevation (m)"
|
||||
)
|
||||
self._dict['1-m3s'] = _translate(
|
||||
"CustomPlot", "Discharge (m³/s)"
|
||||
)
|
||||
self._dict['1-m3s'] = self._dict["unit_discharge"]
|
||||
|
||||
# SubDict
|
||||
|
||||
|
|
|
|||
|
|
@ -43,12 +43,12 @@ class PlotAC(PamhyrPlot):
|
|||
self._current_reach_id = reach_id
|
||||
self._current_profile_id = profile_id
|
||||
|
||||
self.label_x = _translate("Results", "X (m)")
|
||||
self.label_y = _translate("MainWindow_reach", "Elevation (m)")
|
||||
self.label_x = self._trad['x']
|
||||
self.label_y = self._trad["unit_elevation"]
|
||||
|
||||
self.label_bottom = _translate("Results", "River bottom")
|
||||
self.label_water = _translate("Results", "Water elevation")
|
||||
self.label_water_max = _translate("Results", "Max water elevation")
|
||||
self.label_bottom = self._trad['label_bottom']
|
||||
self.label_water = self._trad['label_water']
|
||||
self.label_water_max = self._trad['label_water_max']
|
||||
|
||||
self._isometric_axis = False
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ from PyQt5.QtCore import (
|
|||
|
||||
logger = logging.getLogger()
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class PlotKPC(PamhyrPlot):
|
||||
def __init__(self, canvas=None, trad=None, toolbar=None,
|
||||
|
|
@ -49,12 +47,12 @@ class PlotKPC(PamhyrPlot):
|
|||
self._current_reach_id = reach_id
|
||||
self._current_profile_id = profile_id
|
||||
|
||||
self.label_x = _translate("Results", "KP (m)")
|
||||
self.label_y = _translate("Results", "Elevation (m)")
|
||||
self.label_x = self._trad["unit_kp"]
|
||||
self.label_y = self._trad["unit_elevation"]
|
||||
|
||||
self.label_bottom = _translate("Results", "River bottom")
|
||||
self.label_water = _translate("Results", "Water elevation")
|
||||
self.label_water_max = _translate("Results", "Max water elevation")
|
||||
self.label_bottom = self._trad["label_bottom"]
|
||||
self.label_water = self._trad["label_water"]
|
||||
self.label_water_max = self._trad["label_water_max"]
|
||||
|
||||
self._isometric_axis = False
|
||||
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ class ResultsWindow(PamhyrWindow):
|
|||
results=self._results,
|
||||
reach_id=0,
|
||||
profile_id=0,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar,
|
||||
display_current=True
|
||||
)
|
||||
|
|
@ -190,6 +191,7 @@ class ResultsWindow(PamhyrWindow):
|
|||
results=self._results,
|
||||
reach_id=0,
|
||||
profile_id=0,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_2
|
||||
)
|
||||
self.plot_kpc.draw()
|
||||
|
|
@ -208,6 +210,7 @@ class ResultsWindow(PamhyrWindow):
|
|||
results=self._results,
|
||||
reach_id=0,
|
||||
profile_id=0,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_3
|
||||
)
|
||||
self.plot_ac.draw()
|
||||
|
|
@ -227,6 +230,7 @@ class ResultsWindow(PamhyrWindow):
|
|||
results=self._results,
|
||||
reach_id=0,
|
||||
profile_id=0,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_4
|
||||
)
|
||||
self.plot_h.draw()
|
||||
|
|
|
|||
|
|
@ -18,24 +18,27 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class ResultsTranslate(PamhyrTranslate):
|
||||
class ResultsTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(ResultsTranslate, self).__init__()
|
||||
|
||||
self._dict["Results"] = _translate(
|
||||
"Results", "Results"
|
||||
)
|
||||
self._dict["Results"] = _translate("Results", "Results")
|
||||
|
||||
self._dict['day'] = _translate(
|
||||
"Results", "day"
|
||||
)
|
||||
self._dict['days'] = _translate(
|
||||
"Results", "days"
|
||||
self._dict['day'] = _translate("Results", "day")
|
||||
self._dict['days'] = _translate("Results", "days")
|
||||
|
||||
self._dict['x'] = _translate("Results", "X (m)")
|
||||
|
||||
self._dict['label_bottom'] = _translate("Results", "River bottom")
|
||||
self._dict['label_water'] = _translate("Results", "Water elevation")
|
||||
self._dict['label_water_max'] = _translate(
|
||||
"Results",
|
||||
"Max water elevation"
|
||||
)
|
||||
|
||||
self._sub_dict["table_headers_reach"] = {
|
||||
|
|
@ -43,12 +46,12 @@ class ResultsTranslate(PamhyrTranslate):
|
|||
}
|
||||
|
||||
self._sub_dict["table_headers_profile"] = {
|
||||
"name": _translate("Results", "Name"),
|
||||
"kp": _translate("Results", "KP (m)"),
|
||||
"name": self._dict["name"],
|
||||
"kp": self._dict["unit_kp"],
|
||||
}
|
||||
|
||||
self._sub_dict["table_headers_raw_data"] = {
|
||||
"name": _translate("Results", "Profile"),
|
||||
"water_elevation": _translate("Results", "Water elevation (m)"),
|
||||
"discharge": _translate("Results", "Discharge (m³/s)"),
|
||||
"water_elevation": self._dict["unit_water_elevation"],
|
||||
"discharge": self._dict["unit_discharge"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,14 +31,15 @@ class SedimentEditTranslate(SedimentTranslate):
|
|||
"SedimentLayers", "Edit Sediment Layers"
|
||||
)
|
||||
|
||||
self._dict["height"] = _translate("SedimentLayers", "Thickness (m)")
|
||||
self._dict["height"] = self._dict["unit_thickness"]
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("SedimentLayers", "Name"),
|
||||
# "type": _translate("SedimentLayers", "Type"),
|
||||
"height": _translate("SedimentLayers", "Thickness (m)"),
|
||||
"name": self._dict["name"],
|
||||
# "type": self._dict["type"],
|
||||
"height": self._dict["unit_thickness"],
|
||||
"d50": _translate("SedimentLayers", "D50"),
|
||||
"sigma": _translate("SedimentLayers", "Sigma"),
|
||||
"critical_constraint": _translate("SedimentLayers",
|
||||
"Critical constraint"),
|
||||
"critical_constraint": _translate(
|
||||
"SedimentLayers", "Critical constraint"
|
||||
),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ class SedimentProfileTranslate(SedimentReachTranslate):
|
|||
self._dict["x"] = _translate(
|
||||
"SedimentLayers", "X (m)"
|
||||
)
|
||||
self._dict["height"] = _translate(
|
||||
"SedimentLayers", "Height (m)"
|
||||
)
|
||||
self._dict["height"] = self._dict["unit_height"]
|
||||
|
||||
self._dict["Profile sediment layers"] = _translate(
|
||||
"SedimentLayers", "Profile sediment layers"
|
||||
|
|
@ -42,6 +40,6 @@ class SedimentProfileTranslate(SedimentReachTranslate):
|
|||
"x": _translate("SedimentLayers", "X (m)"),
|
||||
"y": _translate("SedimentLayers", "Y (m)"),
|
||||
"z": _translate("SedimentLayers", "Z (m)"),
|
||||
"name": _translate("SedimentLayers", "Name"),
|
||||
"name": self._dict["name"],
|
||||
"sl": _translate("SedimentLayers", "Sediment layers"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ class SedimentReachTranslate(SedimentTranslate):
|
|||
)
|
||||
|
||||
self._dict["nd"] = _translate("SedimentLayers", "Not defined")
|
||||
self._dict["kp"] = _translate("SedimentLayers", "Kp (m)")
|
||||
self._dict["height"] = _translate("SedimentLayers", "Height (m)")
|
||||
self._dict["kp"] = self._dict["unit_kp"]
|
||||
self._dict["height"] = self._dict["unit_height"]
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("SedimentLayers", "Name"),
|
||||
"kp": _translate("SedimentLayers", "KP (m)"),
|
||||
"name": self._dict["name"],
|
||||
"kp": self._dict["unit_kp"],
|
||||
"sl": _translate("SedimentLayers", "Sediment layers"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class SedimentTranslate(PamhyrTranslate):
|
||||
class SedimentTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(SedimentTranslate, self).__init__()
|
||||
|
||||
|
|
@ -32,6 +32,6 @@ class SedimentTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("SedimentLayers", "Name"),
|
||||
"comment": _translate("SedimentLayers", "Comment"),
|
||||
"name": self._dict["name"],
|
||||
"comment": self._dict["comment"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class ParamTranslate(PamhyrTranslate):
|
||||
class ParamTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(ParamTranslate, self).__init__()
|
||||
|
||||
|
|
@ -32,8 +32,8 @@ class ParamTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("SolverParameters", "Name"),
|
||||
"value": _translate("SolverParameters", "Value")
|
||||
"name": self._dict["name"],
|
||||
"value": self._dict["value"],
|
||||
}
|
||||
|
||||
self._sub_dict["yes_no"] = {
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
from View.Translate import MainTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class StricklersTranslate(PamhyrTranslate):
|
||||
class StricklersTranslate(MainTranslate):
|
||||
def __init__(self):
|
||||
super(StricklersTranslate, self).__init__()
|
||||
|
||||
|
|
@ -32,8 +32,8 @@ class StricklersTranslate(PamhyrTranslate):
|
|||
)
|
||||
|
||||
self._sub_dict["table_headers"] = {
|
||||
"name": _translate("Stricklers", "Name"),
|
||||
"minor": _translate("Stricklers", "Main channel"),
|
||||
"medium": _translate("Stricklers", "Floodway"),
|
||||
"comment": _translate("Stricklers", "Comment"),
|
||||
"name": self._dict["name"],
|
||||
"minor": self._dict["main_channel"],
|
||||
"medium": self._dict["floodway"],
|
||||
"comment": self._dict["comment"],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
# Translate.py -- Pamhyr
|
||||
# Copyright (C) 2023-2024 INRAE
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from View.Tools.PamhyrTranslate import PamhyrTranslate
|
||||
|
||||
_translate = QCoreApplication.translate
|
||||
|
||||
|
||||
class CommonWordTranslate(PamhyrTranslate):
|
||||
def __init__(self):
|
||||
super(CommonWordTranslate, self).__init__()
|
||||
|
||||
self._dict["name"] = _translate("CommonWord", "Name")
|
||||
self._dict["type"] = _translate("CommonWord", "Type")
|
||||
self._dict["value"] = _translate("CommonWord", "Value")
|
||||
self._dict["comment"] = _translate("CommonWord", "Comment")
|
||||
self._dict["description"] = _translate("CommonWord", "Description")
|
||||
|
||||
self._dict["time"] = _translate("CommonWord", "Time")
|
||||
self._dict["date"] = _translate("CommonWord", "Date")
|
||||
|
||||
self._dict["reach"] = _translate("CommonWord", "Reach")
|
||||
self._dict["reaches"] = _translate("CommonWord", "Reaches")
|
||||
self._dict["cross_section"] = _translate("CommonWord", "Coss-section")
|
||||
self._dict["main_channel"] = _translate("CommonWord", "Main channel")
|
||||
self._dict["floodway"] = _translate("CommonWord", "Floodway")
|
||||
|
||||
|
||||
class UnitTranslate(CommonWordTranslate):
|
||||
def __init__(self):
|
||||
super(UnitTranslate, self).__init__()
|
||||
|
||||
self._dict["unit_kp"] = _translate("Unit", "KP (m)")
|
||||
self._dict["unit_width"] = _translate("Unit", "Width (m)")
|
||||
self._dict["unit_height"] = _translate("Unit", "Height (m)")
|
||||
self._dict["unit_diameter"] = _translate("Unit", "Diameter (m)")
|
||||
self._dict["unit_thickness"] = _translate("Unit", "Thickness (m)")
|
||||
self._dict["unit_elevation"] = _translate("Unit", "Elevation (m)")
|
||||
self._dict["unit_water_elevation"] = _translate(
|
||||
"Unit", "Water elevation (m)"
|
||||
)
|
||||
self._dict["unit_discharge"] = _translate("Unit", "Discharge (m³/s)")
|
||||
self._dict["unit_area"] = _translate("Unit", "Area (hectare)"),
|
||||
|
||||
self._dict["unit_time_s"] = _translate("Unit", "Time (sec)")
|
||||
self._dict["unit_time_p"] = _translate("Unit", "Time (JJJ:HH:MM:SS)")
|
||||
|
||||
self._dict["unit_date_s"] = _translate("Unit", "Date (sec)")
|
||||
self._dict["unit_date_iso"] = _translate("Unit", "Date (ISO format)")
|
||||
|
||||
|
||||
class MainTranslate(UnitTranslate):
|
||||
def __init__(self):
|
||||
super(MainTranslate, self).__init__()
|
||||
|
||||
self._dict["open_debug"] = _translate(
|
||||
"MainWindow", "Open debug window"
|
||||
)
|
||||
self._dict["open_debug_sql"] = _translate(
|
||||
"MainWindow", "Open SQLite debuging tool ('sqlitebrowser')"
|
||||
)
|
||||
self._dict["active_window"] = _translate(
|
||||
"MainWindow", "Activate this window"
|
||||
)
|
||||
|
|
@ -252,7 +252,6 @@ def old_pamhyr_date_to_timestamp(date: str):
|
|||
|
||||
|
||||
def timestamp_to_old_pamhyr_date(time: int):
|
||||
logger.debug(f"timestamp_to_old_pamhyr_date({time}: {type(time)})")
|
||||
t0 = datetime.fromtimestamp(0)
|
||||
|
||||
# HACK: Windows do not accept negative timestamps
|
||||
|
|
|
|||
Loading…
Reference in New Issue