diff --git a/src/View/SedimentLayers/Edit/Window.py b/src/View/SedimentLayers/Edit/Window.py index 080eee3f7db94d5122eafde60f17a2fc921b10c2..2c19c0e15968198bbd1f73052109fe7f1c6a7454 100644 --- a/src/View/SedimentLayers/Edit/Window.py +++ b/src/View/SedimentLayers/Edit/Window.py @@ -1,5 +1,5 @@ # Window.py -- Pamhyr -# Copyright (C) 2023 INRAE +# 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 @@ -60,19 +60,20 @@ class EditSedimentLayersWindow(PamhyrWindow): sl=None, parent=None): self._sl = sl - name = self._sl.name - if name == "": - name = _translate("SedimentLayers", "(no name)") + sl_name = self._sl.name + if sl_name == "": + sl_name = _translate("SedimentLayers", "(no name)") + trad = SedimentEditTranslate() name = ( - self._pamhyr_name + " - " + study.name + " - " + name + trad[self._pamhyr_name] + " - " + study.name + " - " + sl_name ) super(EditSedimentLayersWindow, self).__init__( title=name, study=study, config=config, - trad=SedimentEditTranslate(), + trad=trad, parent=parent ) diff --git a/src/View/SedimentLayers/Edit/translate.py b/src/View/SedimentLayers/Edit/translate.py index 94ab91eb5e50513f47294e56467adcdb360f2962..31117fd7439c1bc56d6ade6bb9b5292cd29028d7 100644 --- a/src/View/SedimentLayers/Edit/translate.py +++ b/src/View/SedimentLayers/Edit/translate.py @@ -11,7 +11,11 @@ class SedimentEditTranslate(SedimentTranslate): def __init__(self): super(SedimentEditTranslate, self).__init__() - self._dict["height"] = _translate("SedimentLayers", "Thickness (m)"), + self._dict["Edit Sediment Layers"] = _translate( + "SedimentLayers", "Edit Sediment Layers" + ) + + self._dict["height"] = _translate("SedimentLayers", "Thickness (m)") self._sub_dict["table_headers"] = { "name": _translate("SedimentLayers", "Name"), diff --git a/src/View/SedimentLayers/Reach/Profile/Window.py b/src/View/SedimentLayers/Reach/Profile/Window.py index 22ca8fcbd2e410acdba097b5403d7bfd961b7aee..b7bdec221d575cef84ec0fffd7c04e34163963bd 100644 --- a/src/View/SedimentLayers/Reach/Profile/Window.py +++ b/src/View/SedimentLayers/Reach/Profile/Window.py @@ -1,3 +1,19 @@ +# Window.py -- Pamhyr +# Copyright (C) 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 -*- import logging @@ -49,13 +65,14 @@ class ProfileSedimentLayersWindow(PamhyrWindow): self._profile = profile self._reach = profile.reach - name = self.compute_name(study) + trad = SedimentProfileTranslate() + name = self.compute_name(study, trad) super(ProfileSedimentLayersWindow, self).__init__( title=name, study=study, config=config, - trad=SedimentProfileTranslate(), + trad=trad, parent=parent ) @@ -65,7 +82,7 @@ class ProfileSedimentLayersWindow(PamhyrWindow): self.ui.setWindowTitle(self._title) - def compute_name(self, study): + def compute_name(self, study, trad): rname = self._reach.name if rname == "": rname = _translate("SedimentLayers", "(no name)") @@ -78,7 +95,7 @@ class ProfileSedimentLayersWindow(PamhyrWindow): ) return ( - self._pamhyr_name + " - " + trad[self._pamhyr_name] + " - " + study.name + " - " + rname + " - " + pname ) diff --git a/src/View/SedimentLayers/Reach/Profile/translate.py b/src/View/SedimentLayers/Reach/Profile/translate.py index 81e6623d0c5d2f99449621f30c8949887de6020d..c811b18873c4b02f3e0266d3a292c35054716265 100644 --- a/src/View/SedimentLayers/Reach/Profile/translate.py +++ b/src/View/SedimentLayers/Reach/Profile/translate.py @@ -1,3 +1,19 @@ +# translate.py -- Pamhyr +# Copyright (C) 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 @@ -11,6 +27,10 @@ class SedimentProfileTranslate(SedimentReachTranslate): def __init__(self): super(SedimentProfileTranslate, self).__init__() + self._dict["Profile sediment layers"] = _translate( + "SedimentLayers", "Profile sediment layers" + ) + self._sub_dict["table_headers"] = { "x": _translate("SedimentLayers", "X (m)"), "y": _translate("SedimentLayers", "Y (m)"), diff --git a/src/View/SedimentLayers/Reach/SLDialog.py b/src/View/SedimentLayers/Reach/SLDialog.py index 9f3c878bc87657a2fbba4448460c81da05dc6725..b829d4379ee8a25a3af9b6720fdd9a5ab92427d0 100644 --- a/src/View/SedimentLayers/Reach/SLDialog.py +++ b/src/View/SedimentLayers/Reach/SLDialog.py @@ -24,9 +24,9 @@ class SLDialog(PamhyrDialog): _pamhyr_ui = "SLDialog" _pamhyr_name = "SL" - def __init__(self, study=None, config=None, parent=None): + def __init__(self, study=None, config=None, trad=None, parent=None): super(SLDialog, self).__init__( - title=self._pamhyr_name, + title=trad[self._pamhyr_name], study=study, config=config, parent=parent diff --git a/src/View/SedimentLayers/Reach/Window.py b/src/View/SedimentLayers/Reach/Window.py index 854e06a59564138de185f56994f71903bd25edff..1289dcf432ca00993fb6d83e8cf054f026bdf005 100644 --- a/src/View/SedimentLayers/Reach/Window.py +++ b/src/View/SedimentLayers/Reach/Window.py @@ -53,8 +53,9 @@ class ReachSedimentLayersWindow(PamhyrWindow): else: self._reach = reach + trad = SedimentReachTranslate() name = ( - self._pamhyr_name + " - " + + trad[self._pamhyr_name] + " - " + study.name + " - " + self._reach.name ) @@ -63,7 +64,7 @@ class ReachSedimentLayersWindow(PamhyrWindow): title=name, study=study, config=config, - trad=SedimentReachTranslate(), + trad=trad, parent=parent ) @@ -165,6 +166,7 @@ class ReachSedimentLayersWindow(PamhyrWindow): def apply_sl_each_profile(self): slw = SLDialog( study=self._study, + trad=self._trad, parent=self ) if slw.exec(): diff --git a/src/View/SedimentLayers/Reach/translate.py b/src/View/SedimentLayers/Reach/translate.py index fd2d3bdb6ab10e75f334f967863cb4521eaa6297..8f97876d2449acf55823ff483ef75f199271da81 100644 --- a/src/View/SedimentLayers/Reach/translate.py +++ b/src/View/SedimentLayers/Reach/translate.py @@ -1,3 +1,19 @@ +# translate.py -- Pamhyr +# Copyright (C) 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 @@ -11,6 +27,13 @@ class SedimentReachTranslate(SedimentTranslate): def __init__(self): super(SedimentReachTranslate, self).__init__() + self._dict["Reach sediment layers"] = _translate( + "SedimentLayers", "Reach sediment layers" + ) + self._dict["SL"] = _translate( + "SedimentLayers", "Apply sediment layers to reach" + ) + self._dict["nd"] = _translate("SedimentLayers", "Not defined") self._dict["kp"] = _translate("SedimentLayers", "Kp (m)") self._dict["height"] = _translate("SedimentLayers", "Height (m)") diff --git a/src/View/SedimentLayers/Window.py b/src/View/SedimentLayers/Window.py index 1ff2c7f9d49c4f524cce6651eac11a8d19cd4897..ae36f2e9cd37d41c576439d971aa5965c5c254cb 100644 --- a/src/View/SedimentLayers/Window.py +++ b/src/View/SedimentLayers/Window.py @@ -59,15 +59,16 @@ class SedimentLayersWindow(PamhyrWindow): def __init__(self, study=None, config=None, parent=None): self._sediment_layers = study.river.sediment_layers + trad = SedimentTranslate() name = ( - self._pamhyr_name + " - " + study.name + trad[self._pamhyr_name] + " - " + study.name ) super(SedimentLayersWindow, self).__init__( title=name, study=study, config=config, - trad=SedimentTranslate(), + trad=trad, parent=parent ) diff --git a/src/View/SedimentLayers/translate.py b/src/View/SedimentLayers/translate.py index 83a6169d73a676faa243ede33c9e95912f3db979..6f27fb3a409bd0b2e5e9db6afe4c763ab69142bb 100644 --- a/src/View/SedimentLayers/translate.py +++ b/src/View/SedimentLayers/translate.py @@ -11,6 +11,10 @@ class SedimentTranslate(PamhyrTranslate): def __init__(self): super(SedimentTranslate, self).__init__() + self._dict["Sediment Layers List"] = _translate( + "SedimentLayers", "Sediment Layers List" + ) + self._sub_dict["table_headers"] = { "name": _translate("SedimentLayers", "Name"), "comment": _translate("SedimentLayers", "Comment"),