From 8abf6959642a8162a0797499a3483333b70ab36a Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Mon, 11 Feb 2019 09:58:20 +0100
Subject: [PATCH] Orthographe et traduction

---
 docs-fr/calculators/pam/macrorugo.md               |  4 ++--
 package-lock.json                                  |  5 +++++
 package.json                                       |  1 +
 .../param-values/param-values.component.ts         | 14 +++++++++-----
 src/app/config.json                                |  2 +-
 src/locale/messages.en.json                        |  5 +++++
 src/locale/messages.fr.json                        |  7 ++++++-
 7 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/docs-fr/calculators/pam/macrorugo.md b/docs-fr/calculators/pam/macrorugo.md
index 6b4014b03..0ad40bbb5 100644
--- a/docs-fr/calculators/pam/macrorugo.md
+++ b/docs-fr/calculators/pam/macrorugo.md
@@ -1,6 +1,6 @@
-# Passe à macro-rugosité
+# Passe à macro-rugosités
 
-Le module de calcul passe à macro rugosité permet de calculer les caractéristiques d'une passe à macro-rugosité constituée de blocs uniformément répartis avec des espacements transversaux \(ay\) et longitudinaux \(ay\) égaux.
+Le module de calcul passe à macro-rugosités permet de calculer les caractéristiques d'une passe à macro-rugosités constituée de blocs uniformément répartis avec des espacements transversaux \(ay\) et longitudinaux \(ay\) égaux.
 
 ![Schéma d'une disposition régulière des enrochements et notations](pam_schema_enrochement_regulier.png)
 
diff --git a/package-lock.json b/package-lock.json
index e5839dd8a..417c24a9d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1159,6 +1159,11 @@
       "integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==",
       "dev": true
     },
+    "@types/sprintf-js": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/@types/sprintf-js/-/sprintf-js-1.1.1.tgz",
+      "integrity": "sha512-h8jF5yPUoHH1QUIDfHgqFs7Y0UykKB5CJ1Z32PHGmHRLmW0pI+kYKAEnXVqeUZ3ygFmDkyvhD4vUZN+RZyTd1w=="
+    },
     "@types/webpack-sources": {
       "version": "0.1.5",
       "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.5.tgz",
diff --git a/package.json b/package.json
index 9d2e430d1..fe7b6fcb0 100644
--- a/package.json
+++ b/package.json
@@ -32,6 +32,7 @@
     "@angular/platform-browser": "^7.2.1",
     "@angular/platform-browser-dynamic": "^7.2.1",
     "@angular/router": "^7.2.1",
+    "@types/sprintf-js": "^1.1.1",
     "angular2-chartjs": "^0.5.1",
     "core-js": "^2.6.3",
     "file-saver": "^2.0.0",
diff --git a/src/app/components/param-values/param-values.component.ts b/src/app/components/param-values/param-values.component.ts
index 3d872f349..f6333948d 100644
--- a/src/app/components/param-values/param-values.component.ts
+++ b/src/app/components/param-values/param-values.component.ts
@@ -3,6 +3,8 @@ import { NgParameter } from "../../formulaire/ngparam";
 import { DialogEditParamValuesComponent } from "../dialog-edit-param-values/dialog-edit-param-values.component";
 import { MatDialog } from "@angular/material";
 import { ParamValueMode } from "jalhyd";
+import { I18nService } from "../../services/internationalisation/internationalisation.service";
+import { sprintf } from "sprintf-js";
 
 @Component({
     selector: "param-values",
@@ -21,7 +23,8 @@ export class ParamValuesComponent implements AfterViewInit {
 
 
     constructor(
-        private editValuesDialog: MatDialog
+        private editValuesDialog: MatDialog,
+        private intlService: I18nService
     ) { }
 
     public get isMinMax() {
@@ -33,13 +36,14 @@ export class ParamValuesComponent implements AfterViewInit {
     }
 
     public get infoText() {
-        let text = "(à traduire) ";
+        let text: string;
         if (this.isMinMax) {
-            text += "min: " + this.param.minValue + ", max: " + this.param.maxValue + ", step: " + this.param.stepValue;
+            text = this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_MINMAXSTEP");
+            text = sprintf(text, this.param.minValue, this.param.maxValue, this.param.stepValue);
         } else if (this.isListe) {
+            text = this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_VALUES");
             const vals = this.param.valueList || [];
-            console.log("VALS", vals, this.param.valueList);
-            text += "values: " + vals.slice(0, 20).join(";");
+            text += vals.slice(0, 20).join(";");
         }
         return text;
     }
diff --git a/src/app/config.json b/src/app/config.json
index 721905441..cb7754e64 100644
--- a/src/app/config.json
+++ b/src/app/config.json
@@ -22,7 +22,7 @@
                 "title": "Passe à poisson sur le petit Buech, seuil de Chiala ou des Savoillons",
                 "credits": "Catherine Tailleux / Irstea"
             },
-            "calculators": [ ]
+            "calculators": [ 11 ]
         },
         {
             "name": "HYDRAULIQUE_A_SURFACE_LIBRE",
diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json
index fa9c47aa6..59bfeb186 100644
--- a/src/locale/messages.en.json
+++ b/src/locale/messages.en.json
@@ -146,8 +146,13 @@
     "INFO_PARAMFIELD_PARAMLIE_LABEL": "Linked parameter",
     "INFO_PARAMFIELD_PARAMVARIER": "Vary",
     "INFO_PARAMFIELD_PASVARIATION": "With a variation step of",
+    "INFO_PARAMFIELD_PARAMVARIER_MINMAXSTEP": "Min: %s, max: %s, step: %s",
+    "INFO_PARAMFIELD_PARAMVARIER_VALUES": "Values:",
+    "INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT": "Values list",
     "INFO_PARAMFIELD_VALEURMAXI": "To maximum value",
     "INFO_PARAMFIELD_VALEURMINI": "From minimum value",
+    "INFO_PARAMMODE_MINMAX": "Min/max",
+    "INFO_PARAMMODE_LIST": "Values list",
     "INFO_REGIMEUNIFORME_TITRE": "Uniform flow calculation",
     "INFO_REMOUSRESULTS_ABSCISSE": "Abscissa (m)",
     "INFO_REMOUSRESULTS_BERGE": "Embankment",
diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json
index d4d47df5a..dd76ea2dd 100644
--- a/src/locale/messages.fr.json
+++ b/src/locale/messages.fr.json
@@ -122,7 +122,7 @@
     "INFO_MENU_SELECT_CALC": "Choisir un module de calcul",
     "INFO_MENU_EMPTY_SESSION_TITLE": "Nouvelle session",
     "INFO_MENU_NOUVELLE_CALC": "Nouveau module de calcul",
-    "INFO_MACRORUGO_TITRE": "Passe à macro-rugosité",
+    "INFO_MACRORUGO_TITRE": "Passe à macro-rugosités",
     "INFO_OPTION_NO": "Non",
     "INFO_OPTION_YES": "Oui",
     "INFO_OPTION_CANCEL": "Annuler",
@@ -146,8 +146,13 @@
     "INFO_PARAMFIELD_PARAMLIE_LABEL": "Paramètre lié",
     "INFO_PARAMFIELD_PARAMVARIER": "varier",
     "INFO_PARAMFIELD_PASVARIATION": "Avec un pas de",
+    "INFO_PARAMFIELD_PARAMVARIER_MINMAXSTEP": "Min: %s, max: %s, pas: %s",
+    "INFO_PARAMFIELD_PARAMVARIER_VALUES": "Valeurs:",
+    "INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT": "Liste de valeurs",
     "INFO_PARAMFIELD_VALEURMAXI": "À la valeur maximum",
     "INFO_PARAMFIELD_VALEURMINI": "De la valeur minimum",
+    "INFO_PARAMMODE_MINMAX": "Min/max",
+    "INFO_PARAMMODE_LIST": "Liste de valeurs",
     "INFO_REGIMEUNIFORME_TITRE": "Régime uniforme",
     "INFO_REMOUSRESULTS_ABSCISSE": "Abscisse (m)",
     "INFO_REMOUSRESULTS_BERGE": "Berge",
-- 
GitLab