Pamhyr2/src/View/Results/CustomPlot/Translate.py

62 lines
2.0 KiB
Python

# 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.Results.translate import ResultsTranslate
_translate = QCoreApplication.translate
class CustomPlotTranslate(ResultsTranslate):
def __init__(self):
super(CustomPlotTranslate, self).__init__()
self._dict["Custom Plot Selection"] = _translate(
"CustomPlot", "Custom plot selection"
)
# Value type
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 elevation (m)"
)
# Unit corresponding long name (plot axes display)
self._dict['0-meter'] = _translate(
"CustomPlot", "Bed elevation (m)"
)
self._dict['1-m3s'] = self._dict["unit_discharge"]
# SubDict
self._sub_dict["values_x"] = {
"kp": self._dict["kp"],
"time": self._dict["time"],
}
self._sub_dict["values_y"] = {
"elevation": self._dict["elevation"],
"water_elevation": self._dict["water_elevation"],
"discharge": self._dict["discharge"],
}