From d32baa61a1be8638cd43935293929562cee84ece Mon Sep 17 00:00:00 2001
From: Theophile Terraz <theophile.terraz@inrae.fr>
Date: Mon, 5 Aug 2024 09:55:12 +0200
Subject: [PATCH] text improvement

---
 doc/dev/documentation.org        | 2 +-
 src/Model/Geometry/ProfileXYZ.py | 5 +++--
 src/View/ui/InitialConditions.ui | 4 ++--
 src/lang/fr.ts                   | 8 ++++----
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/doc/dev/documentation.org b/doc/dev/documentation.org
index 28fad839..f7285945 100644
--- a/doc/dev/documentation.org
+++ b/doc/dev/documentation.org
@@ -1334,7 +1334,7 @@ https://gitlab.irstea.fr/theophile.terraz/pamhyr
 
 You can improve or add translation for the project. To contribute to
 Pamhyr2 translate, you need to use Qt Linguist[fn:qt-linguist]. Open
-Qt-linguist and edite the translation ({{{file(.ts)}}}) file, finally,
+Qt-linguist and edit the translation ({{{file(.ts)}}}) file, finally,
 commit the new version of file and make a merge request.
 
 If you want add a new language, edit the script
diff --git a/src/Model/Geometry/ProfileXYZ.py b/src/Model/Geometry/ProfileXYZ.py
index 27b933b5..54626bb3 100644
--- a/src/Model/Geometry/ProfileXYZ.py
+++ b/src/Model/Geometry/ProfileXYZ.py
@@ -431,8 +431,9 @@ class ProfileXYZ(Profile, SQLSubModel):
 
         area = 0.0
         for line in lines:
-            poly = geometry.Polygon(line)
-            area += poly.area
+            if len(line.coords) > 2:
+                poly = geometry.Polygon(line)
+                area += poly.area
         return area
 
         return poly.area
diff --git a/src/View/ui/InitialConditions.ui b/src/View/ui/InitialConditions.ui
index 403a5fe2..68ed2f94 100644
--- a/src/View/ui/InitialConditions.ui
+++ b/src/View/ui/InitialConditions.ui
@@ -27,14 +27,14 @@
           <item>
            <widget class="QPushButton" name="pushButton_generate_1">
             <property name="text">
-             <string>Generate from height</string>
+             <string>Generate height</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QPushButton" name="pushButton_generate_2">
             <property name="text">
-             <string>Generate from discharge</string>
+             <string>Generate discharge</string>
             </property>
            </widget>
           </item>
diff --git a/src/lang/fr.ts b/src/lang/fr.ts
index 81b4d312..7ae74e51 100644
--- a/src/lang/fr.ts
+++ b/src/lang/fr.ts
@@ -2168,13 +2168,13 @@
     </message>
     <message>
         <location filename="../View/ui/InitialConditions.ui" line="30"/>
-        <source>Generate from height</source>
-        <translation>Générer pour une hauteur donnée</translation>
+        <source>Generate height</source>
+        <translation>Générer une hauteur</translation>
     </message>
     <message>
         <location filename="../View/ui/InitialConditions.ui" line="37"/>
-        <source>Generate from discharge</source>
-        <translation>Générer pour un débit donné</translation>
+        <source>Generate discharge</source>
+        <translation>Générer un débit</translation>
     </message>
     <message>
         <location filename="../View/ui/InitialConditions.ui" line="98"/>
-- 
GitLab