Pamhyr2/src/View/Geometry/Translate.py

182 lines
6.8 KiB
Python

# Translate.py -- Pamhyr
# Copyright (C) 2023-2026 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.Translate import MainTranslate
from View.WeatherParameters.translate import WeatherParametersTranslate
_translate = QCoreApplication.translate
class GeometryTranslate(MainTranslate):
def __init__(self):
super(GeometryTranslate, self).__init__()
self._dict["Geometry"] = _translate(
"Geometry", "Geometry"
)
self._dict["open_file"] = _translate("Geometry", "Open a file")
self._dict["file_st"] = _translate(
"Geometry", "Mage geometry file (*.ST *.st)")
self._dict["file_m"] = _translate(
"Geometry", "Mage meshed geometry file (*.M *.m)")
self._dict["file_shp"] = _translate(
"Geometry", "Shapefile (*.SHP *.shp)")
self._dict["file_all"] = _translate("Geometry", "All files (*)")
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["cross_section_enabled_count"] = _translate(
"Geometry", "Cross-section enabled ({count} disabled)"
)
self._dict["profile_disable_blocked"] = _translate(
"Geometry", "The cross-section cannot be disabled."
)
self._dict["profile_disable_blocked_info"] = _translate(
"Geometry",
"It is referenced by the following data:\n{dependencies}\n\n"
"Change or remove these associations before disabling it."
)
self._dict["profile_dependency"] = _translate(
"Geometry", "{kind}{name}” ({association})"
)
self._dict["initial_condition"] = _translate(
"Geometry", "Initial condition"
)
self._dict["initial_condition_temperature"] = _translate(
"Geometry", "Initial condition temperature"
)
self._dict["hydraulic_structure"] = _translate(
"Geometry", "Hydraulic structure"
)
self._dict["lateral_contribution"] = _translate(
"Geometry", "Lateral contribution"
)
self._dict["weather_parameter"] = _translate(
"Geometry", "Weather parameter"
)
self._dict["section"] = _translate("Geometry", "cross-section")
self._dict["input_section"] = _translate(
"Geometry", "input cross-section"
)
self._dict["output_section"] = _translate(
"Geometry", "output cross-section"
)
self._dict["begin_section"] = _translate(
"Geometry", "first cross-section"
)
self._dict["end_section"] = _translate(
"Geometry", "last cross-section"
)
self._dict["cross_section_pk"] = _translate(
"Geometry", "cross-section PK"
)
weather_parameters = WeatherParametersTranslate().get_dict(
"weather_parameters"
)
self._sub_dict["weather_parameter_types"] = {
"AT": weather_parameters["air_temperature"],
"SH": weather_parameters["specific_humidity"],
"GR": weather_parameters["global_radiation"],
"RWS": weather_parameters["reference_wind_speed"],
"GT": weather_parameters["surface_temperature"],
"GFR": weather_parameters["surface_flow_rate"],
"ALB": weather_parameters["albedo"],
"SC": weather_parameters["shading_coefficient"],
"CCF": weather_parameters["cloud_cover_fraction"],
}
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": self._dict["name"],
"rk": self._dict["unit_rk"],
"poins": _translate("Geometry", "Points"),
}
self._sub_dict["lm_dict"] = {
"1": _translate("Geometry", "the first guide-line"),
"2": _translate("Geometry", "the second guide-line"),
"3": _translate(
"Geometry",
"the mean over the two guide-lines"
),
}
self._sub_dict["r_lm_dict"] = {}
for k in self._sub_dict["lm_dict"]:
v = self._sub_dict["lm_dict"][k]
self._sub_dict["r_lm_dict"][v] = k
self._dict["Meshing"] = _translate(
"Geometry", "Meshing"
)
self._dict["UpdateRK"] = _translate(
"Geometry", "UpdateRK"
)
self._dict["Purge"] = _translate(
"Geometry", "Purge"
)
self._dict["Shift"] = _translate(
"Geometry", "Shift"
)
self._dict["warning"] = _translate(
"Geometry", "Warning"
)
self._dict["format_not_exportable"] = _translate(
"Geometry", "The format of the file is not exportable."
)
self._dict["export_options"] = _translate(
"Geometry", "Export options"
)
self._dict["export_options_text"] = _translate(
"Geometry", "Choose which cross-sections to export."
)
self._dict["export_interpolated_profiles"] = _translate(
"Geometry", "Export interpolated cross-sections"
)
self._dict["update_rk_error"] = _translate(
"Geometry",
"RK update can't be executed."
)
self._dict["update_rk_empty_profiles"] = _translate(
"Geometry",
"Some profiles don't contain any point."
)
self._dict["update_rk_empty_profiles_info"] = _translate(
"Geometry",
"Profiles concerned:"
)