From e65667784ed309d06dbd7e967bcca810ba68c739 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Wed, 17 Jul 2019 12:01:15 +0200
Subject: [PATCH] Tooltips on calculator icon buttons

---
 .../generic-calculator/calculator.component.html | 16 ++++++++++++----
 .../generic-calculator/calculator.component.ts   | 16 ++++++++++++++++
 src/locale/messages.en.json                      |  4 ++++
 src/locale/messages.fr.json                      |  4 ++++
 4 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/src/app/components/generic-calculator/calculator.component.html b/src/app/components/generic-calculator/calculator.component.html
index f94d21d49..08366714a 100644
--- a/src/app/components/generic-calculator/calculator.component.html
+++ b/src/app/components/generic-calculator/calculator.component.html
@@ -4,13 +4,21 @@
 
         <div class="hyd-window-btns">
             <!-- bouton d'aide -->
-            <mat-icon *ngIf="enableHelpButton" (click)="openHelp()" color="accent">help</mat-icon>
+            <mat-icon *ngIf="enableHelpButton" (click)="openHelp()" color="accent" [title]="uitextOpenHelp">
+                help
+            </mat-icon>
             <!-- bouton de duplication -->
-            <mat-icon id="clone-calc" (click)="cloneCalculator()">content_copy</mat-icon>
+            <mat-icon id="clone-calc" (click)="cloneCalculator()" [title]="uitextCloneCalculator">
+                content_copy
+            </mat-icon>
             <!-- bouton de sauvegarde -->
-            <mat-icon id="save-calc" (click)="saveCalculator()">file_download</mat-icon>
+            <mat-icon id="save-calc" (click)="saveCalculator()" [title]="uitextSaveCalculator">
+                file_download
+            </mat-icon>
             <!-- bouton de fermeture -->
-            <mat-icon id="close-calc" (click)="closeCalculator()">close</mat-icon>
+            <mat-icon id="close-calc" (click)="closeCalculator()" [title]="uitextCloseCalculator">
+                close
+            </mat-icon>
         </div>
 
         <!-- titre -->
diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts
index 842aeb727..34a300783 100644
--- a/src/app/components/generic-calculator/calculator.component.ts
+++ b/src/app/components/generic-calculator/calculator.component.ts
@@ -178,6 +178,22 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
         return this.intlService.localizeText("INFO_CALCULATOR_RESULTS_GENERATE_PAB");
     }
 
+    public get uitextOpenHelp() {
+        return this.intlService.localizeText("INFO_CALCULATOR_OPEN_HELP");
+    }
+
+    public get uitextCloneCalculator() {
+        return this.intlService.localizeText("INFO_CALCULATOR_CLONE");
+    }
+
+    public get uitextSaveCalculator() {
+        return this.intlService.localizeText("INFO_CALCULATOR_SAVE");
+    }
+
+    public get uitextCloseCalculator() {
+        return this.intlService.localizeText("INFO_CALCULATOR_CLOSE");
+    }
+
     /**
      * Triggered at calculator instanciation
      */
diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json
index cdc0d46c4..70f91ad49 100644
--- a/src/locale/messages.en.json
+++ b/src/locale/messages.en.json
@@ -46,9 +46,13 @@
     "ERROR_STRUCTURE_Q_TROP_ELEVE": "The flow passing through the other devices is too high: the requested parameter is not calculable.",
     "INFO_CALCULATOR_CALC_NAME": "Calculator name",
     "INFO_CALCULATOR_CALCULER": "Compute",
+    "INFO_CALCULATOR_CLONE": "Duplicate",
+    "INFO_CALCULATOR_CLOSE": "Close",
+    "INFO_CALCULATOR_OPEN_HELP": "Help",
     "INFO_CALCULATOR_PARAMFIXES": "Fixed parameters",
     "INFO_CALCULATOR_RESULTS_GENERATE_PAB": "Generate a fish ladder",
     "INFO_CALCULATOR_RESULTS_TITLE": "Results",
+    "INFO_CALCULATOR_SAVE": "Save",
     "INFO_CALCULATOR_VALEURS": "Values",
     "INFO_CLOISONS_TITRE_COURT": "Cross walls",
     "INFO_CLOISONS_TITRE": "Fish ladder: Cross walls",
diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json
index 34523b4b9..b1a7681d4 100644
--- a/src/locale/messages.fr.json
+++ b/src/locale/messages.fr.json
@@ -46,9 +46,13 @@
     "ERROR_STRUCTURE_Q_TROP_ELEVE": "Le débit passant par les autres ouvrages est trop élevé: le paramètre demandé n'est pas calculable.",
     "INFO_CALCULATOR_CALC_NAME": "Nom du module de calcul",
     "INFO_CALCULATOR_CALCULER": "Calculer",
+    "INFO_CALCULATOR_CLONE": "Dupliquer",
+    "INFO_CALCULATOR_CLOSE": "Fermer",
+    "INFO_CALCULATOR_OPEN_HELP": "Aide",
     "INFO_CALCULATOR_PARAMFIXES": "Paramètres fixés",
     "INFO_CALCULATOR_RESULTS_GENERATE_PAB": "Générer une passe à bassins",
     "INFO_CALCULATOR_RESULTS_TITLE": "Résultats",
+    "INFO_CALCULATOR_SAVE": "Enregistrer",
     "INFO_CALCULATOR_VALEURS": "Valeurs",
     "INFO_CLOISONS_TITRE_COURT": "Cloisons",
     "INFO_CLOISONS_TITRE": "Passe à bassins&nbsp;: Cloisons",
-- 
GitLab