From fef93209cd2d3252f73fe3335cbfd1eb00b12b1e Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Mon, 7 Oct 2024 17:30:52 +0200 Subject: [PATCH] debug translation --- src/View/BoundaryCondition/Edit/Window.py | 2 + src/View/BoundaryCondition/Edit/translate.py | 10 ++-- src/View/MainWindow.py | 6 +- src/View/Translate.py | 3 + src/lang/fr.ts | 60 ++++++++++++++++---- 5 files changed, 64 insertions(+), 17 deletions(-) diff --git a/src/View/BoundaryCondition/Edit/Window.py b/src/View/BoundaryCondition/Edit/Window.py index a414dcaa..a65143c3 100644 --- a/src/View/BoundaryCondition/Edit/Window.py +++ b/src/View/BoundaryCondition/Edit/Window.py @@ -349,6 +349,7 @@ class EditBoundaryConditionWindow(PamhyrWindow): reach = self._data.reach(self._study.river)[0] if len(reach.profiles) == 0: self.message_box( + window_title=self._trad["Warning"], text=self._trad["title_need_geometry"], informative_text=self._trad["msg_need_geometry"] ) @@ -388,6 +389,7 @@ class EditBoundaryConditionWindow(PamhyrWindow): reach = self._data.reach(self._study.river)[0] if len(reach.profiles) == 0: self.message_box( + window_title=self._trad["Warning"], text=self._trad["title_need_geometry"], informative_text=self._trad["msg_need_geometry"] ) diff --git a/src/View/BoundaryCondition/Edit/translate.py b/src/View/BoundaryCondition/Edit/translate.py index 3912b81c..76b8ff3e 100644 --- a/src/View/BoundaryCondition/Edit/translate.py +++ b/src/View/BoundaryCondition/Edit/translate.py @@ -46,10 +46,12 @@ class BCETranslate(BCTranslate): } self._dict["title_need_geometry"] = _translate( - "Geometry", "No geometry" + "BoundaryCondition", "No geometry" ) self._dict["msg_need_geometry"] = _translate( - "Geometry", - "There is not geometry found for this reach, " - "a geometry is needed to this features" + "BoundaryCondition", + "No geometry found for this reach.\n" + "This feature requires a reach with a geometry." ) + self._dict["Warning"] = _translate("BoundaryCondition", + "Warning") diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 63732472..ca2b1d5b 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -749,9 +749,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): def msg_select_reach(self): self.message_box( - self._trad["mb_select_reach_title"], - self._trad["mb_select_reach_msg"] + window_title=self._trad["Warning"], + text=self._trad["mb_select_reach_title"], + informative_text=self._trad["mb_select_reach_msg"] ) + self.open_network() def dialog_reopen_study(self): dlg = QMessageBox(self) diff --git a/src/View/Translate.py b/src/View/Translate.py index 99b3e542..eb289f6a 100644 --- a/src/View/Translate.py +++ b/src/View/Translate.py @@ -106,6 +106,9 @@ class MainTranslate(UnitTranslate): ) # Message box + self._dict["Warning"] = _translate( + "MainWindow", "Warning" + ) self._dict["mb_select_reach_title"] = _translate( "MainWindow", "Please select a reach" ) diff --git a/src/lang/fr.ts b/src/lang/fr.ts index c8c8d0ba..6abba31a 100644 --- a/src/lang/fr.ts +++ b/src/lang/fr.ts @@ -1,6 +1,5 @@ - - + About @@ -247,6 +246,23 @@ Boundary Condition Options Options des conditions limites + + + No geometry + Pas de géométrie + + + + No geometry found for this reach. +This feature requires a reach with a geometry. + Aucune géométrie n'a été trouvée sur ce bief. +Cette fonctionnalité nécessite un bief muni d'une géométrie. + + + + Warning + Avertissement + BoundaryConditions @@ -1151,7 +1167,7 @@ - Copyright © 2022-2024 INRAE + Copyright © 2022-2024 INRAE Copyright © 2022-2024 INRAE @@ -1159,6 +1175,11 @@ Version: @version @codename Version : @version @codename + + + Copyright © 2022-2024 INRAE + + Frictions @@ -1190,7 +1211,7 @@ Edit frictions - Éditer les frotements + Éditer les frottements @@ -1355,6 +1376,18 @@ Shift Translater + + + No geometry + Aucune géométrie + + + + No geometry found for this reach. +This feature requires a reach with a geometry. + Aucune géométrie n'a été trouvée sur ce bief. +Cette fonctionnalité nécessite un bief muni d'une géométrie. + HydraulicStructures @@ -2390,7 +2423,7 @@ Edit frictions - Éditer les frotements + Éditer les frottements @@ -2503,7 +2536,7 @@ Données - + Please select a reach Veuillez sélectionner un bief @@ -2513,30 +2546,35 @@ L'édition de la géométrie nécessite un bief sélectionné dans le réseau fluvial pour pouvoir travailler dessus - + Last open study Dernière étude ouverte - + Do you want to open again the last open study? Voulez-vous rouvrir la dernière étude ? - + This edition window need a reach selected into the river network to work on it Cette fenêtre d'édition a besoin d'un bief sélectionné dans le réseau pour travailler dessus - + Close without saving study Fermer sans sauvegarder l'étude - + Do you want to save current study before closing it? Souhaitez-vous sauvegarder l'étude en cours avant de la fermer ? + + + Warning + Avertissement + MainWindow_reach