diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts index 49d0ac47b9aa372c10cb20224aa5ccfac3f2ecf4..221c69c1e88b1b646986a8b460af0addc253e186 100644 --- a/src/app/components/generic-calculator/calculator.component.ts +++ b/src/app/components/generic-calculator/calculator.component.ts @@ -20,6 +20,7 @@ import { ParSimulationParams, ParSimulation, PreBarrage, + PbCloison, Espece, VariatedDetails } from "jalhyd"; @@ -53,6 +54,7 @@ import { FormulairePrebarrage } from "../../formulaire/definition/form-prebarrag import { HotkeysService, Hotkey } from "angular2-hotkeys"; import { MatomoTracker } from "ngx-matomo"; +import { sprintf } from 'sprintf-js'; @Component({ selector: "hydrocalc", @@ -229,7 +231,20 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe } public get uitextResultsTitle() { - return this.intlService.localizeText("INFO_CALCULATOR_RESULTS_TITLE"); + let title = this.intlService.localizeText("INFO_CALCULATOR_RESULTS_TITLE"); + if (this.isPB) { + const selectedItem = (this._formulaire as FormulairePrebarrage).selectedItem; + if (selectedItem instanceof PbCloison) { + // suffix with wall name + title = sprintf( + this.intlService.localizeText("INFO_CALCULATOR_RESULTS_TITLE_PB_WALL"), + this.intlService.localizeMessage(selectedItem.description) + ); + } else { + title = this.intlService.localizeText("INFO_CALCULATOR_RESULTS_TITLE_PB_BASINS"); + } + } + return title; } public get uitextGeneratePAB() { diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index f3b269f33d44926d41b42f87790cc5a097cd3e01..cc742db9b83fb6bc8da405ea4d1ad2b37168de4c 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -90,6 +90,8 @@ "INFO_CALCULATOR_RESULTS_GENERATE_SP_AMONT": "Hydraulic details of upstream section", "INFO_CALCULATOR_RESULTS_GENERATE_SP_AVAL": "Hydraulic details of downstream section", "INFO_CALCULATOR_RESULTS_TITLE": "Results", + "INFO_CALCULATOR_RESULTS_TITLE_PB_BASINS": "Basins results", + "INFO_CALCULATOR_RESULTS_TITLE_PB_WALL": "Résults for %s", "INFO_CALCULATOR_SAVE": "Save", "INFO_CALCULATOR_USED_BY": "Used by", "INFO_CALCULATOR_VALEURS": "Values", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 5f9abffd11744f442c606430bb0c97b84bbc5e76..9fba60cb03ef6c5db726a1c6f8c3e2030f3c53c0 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -90,6 +90,8 @@ "INFO_CALCULATOR_RESULTS_GENERATE_SP_AMONT": "Détails hydrauliques de la section amont", "INFO_CALCULATOR_RESULTS_GENERATE_SP_AVAL": "Détails hydrauliques de la section aval", "INFO_CALCULATOR_RESULTS_TITLE": "Résultats", + "INFO_CALCULATOR_RESULTS_TITLE_PB_BASINS": "Résultats des bassins", + "INFO_CALCULATOR_RESULTS_TITLE_PB_WALL": "Résultats de %s", "INFO_CALCULATOR_SAVE": "Enregistrer", "INFO_CALCULATOR_USED_BY": "Utilisé par", "INFO_CALCULATOR_VALEURS": "Valeurs",