From 77de17d7e3485cd3c35805e16e82e667e272bff9 Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Mon, 12 Feb 2024 14:19:31 +0100
Subject: [PATCH] Friction: Add window title translate.

---
 src/View/Frictions/Window.py    | 6 ++++--
 src/View/Frictions/translate.py | 4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/View/Frictions/Window.py b/src/View/Frictions/Window.py
index 95b41d8b..56b76bbc 100644
--- a/src/View/Frictions/Window.py
+++ b/src/View/Frictions/Window.py
@@ -62,6 +62,8 @@ class FrictionsWindow(PamhyrWindow):
     _pamhyr_name = "Edit frictions"
 
     def __init__(self, reach=None, study=None, config=None, parent=None):
+        trad = FrictionsTranslate()
+
         if reach is not None:
             self._reach = reach
         else:
@@ -70,7 +72,7 @@ class FrictionsWindow(PamhyrWindow):
         self._frictions = self._reach.frictions
 
         name = (
-            self._pamhyr_name + " - "
+            trad[self._pamhyr_name] + " - "
             + study.name + " - "
             + self._reach.name
         )
@@ -79,7 +81,7 @@ class FrictionsWindow(PamhyrWindow):
             title=name,
             study=study,
             config=config,
-            trad=FrictionsTranslate(),
+            trad=trad,
             parent=parent
         )
 
diff --git a/src/View/Frictions/translate.py b/src/View/Frictions/translate.py
index 15f8dc7d..4fa6de1e 100644
--- a/src/View/Frictions/translate.py
+++ b/src/View/Frictions/translate.py
@@ -27,6 +27,10 @@ class FrictionsTranslate(PamhyrTranslate):
     def __init__(self):
         super(FrictionsTranslate, self).__init__()
 
+        self._dict["Edit frictions"] = _translate(
+            "Frictions", "Edit frictions"
+        )
+
         self._sub_dict["table_headers"] = {
             # "name": _translate("Frictions", "Name"),
             # "edge": _translate("Frictions", "Reach"),
-- 
GitLab