diff --git a/docs-fr/calculators/pam/macrorugo.md b/docs-fr/calculators/pam/macrorugo.md index 6b4014b03e016a98e79878f67356ba4a731d7d77..0ad40bbb53e9ba02cc37a99108d5f57e0bb77a7a 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.  diff --git a/package-lock.json b/package-lock.json index e5839dd8addd49453ffe173ae960ebd23db062b7..417c24a9dce47f61e28a2fc3c265792bb85a48d5 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 9d2e430d150f2bc558292d5eaf4b43daed41b19a..fe7b6fcb0dfda3824c6f96ae20bec378df412b52 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 3d872f349813123f5d15347486840495c70b8236..f6333948d35f32c001d75b8ac3912824c6f0c9da 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 721905441c65af6249c659459768f170da6f6f41..cb7754e64b271455f1e1d128346868fd88441224 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 fa9c47aa6cabcb374aebf71bbf016197443cb4e3..59bfeb1866f5792d4bf0db3fc5f15d9beffbe8ac 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 d4d47df5ac68c9440b8bb7f78a723f88229732b1..dd76ea2dd806b54a694188a2b08c6ca927cd15fb 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",