diff --git a/src/app/calculators/generic/calculator.component.html b/src/app/calculators/generic/calculator.component.html index cc1b985220448e77009ca68c3dfad275acf4ce95..d8fd7b9a8d80c0b82c8463f20f6eadea6930df47 100644 --- a/src/app/calculators/generic/calculator.component.html +++ b/src/app/calculators/generic/calculator.component.html @@ -35,17 +35,14 @@ <button type="button" class="close pull-right" aria-label="Close" (click)="confirmModal.hide()"> <span aria-hidden="true">×</span> </button> - <h4 class="modal-title w-100" id="myModalLabel">Confirmer la fermeture</h4> + <h4 class="modal-title w-100" id="myModalLabel">{{uitextCloseDialogTitle}}</h4> </div> <div class="modal-body"> - <h4> - Attention ! Les paramètres et résultats de la calculette seront perdus. - <br/> Vraiment fermer ? - </h4> + <h4> {{uitextCloseDialogText}} </h4> </div> <div class="modal-footer"> - <button type="button" class="btn btn-danger relative waves-light" (click)="onCloseForm()" mdbRippleRadius>Oui</button> - <button type="button" class="btn btn-success waves-light" aria-label="Close" (click)="confirmModal.hide()" mdbRippleRadius>Non</button> + <button type="button" class="btn btn-danger relative waves-light" (click)="onCloseForm()" mdbRippleRadius>{{uitextCloseDialogYes}}</button> + <button type="button" class="btn btn-success waves-light" aria-label="Close" (click)="confirmModal.hide()" mdbRippleRadius>{{uitextCloseDialogNo}}</button> </div> </div> </div> diff --git a/src/app/calculators/generic/calculator.component.ts b/src/app/calculators/generic/calculator.component.ts index c308fc8e1ee21451e565cc2b82c335a256ca13a1..84a3cd6fba1809a3ee816b4ad4da9057916d4d36 100644 --- a/src/app/calculators/generic/calculator.component.ts +++ b/src/app/calculators/generic/calculator.component.ts @@ -77,6 +77,22 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, OnDestroy, O return this.intlService.localizeText("INFO_CALCULATOR_CALCULER"); } + private get uitextCloseDialogTitle() { + return this.intlService.localizeText("INFO_CLOSE_DIALOGUE_TITRE"); + } + + private get uitextCloseDialogText() { + return this.intlService.localizeText("INFO_CLOSE_DIALOGUE_TEXT"); + } + + private get uitextCloseDialogYes() { + return this.intlService.localizeText("INFO_OPTION_YES"); + } + + private get uitextCloseDialogNo() { + return this.intlService.localizeText("INFO_OPTION_NO"); + } + ngOnInit() { this.intlService.addObserver(this); this.formulaireService.addObserver(this); diff --git a/src/locale/error_messages.en.json b/src/locale/error_messages.en.json index 6ee038e8f530b70ae281f424015f03c7f5a2ede5..9fb41a8372f982e9fe333124213bf36c396f31ef 100644 --- a/src/locale/error_messages.en.json +++ b/src/locale/error_messages.en.json @@ -71,5 +71,9 @@ "INFO_SETUP_TITLE": "Application setup", "INFO_SETUP_PRECISION_AFFICHAGE": "Display accuracy", "INFO_SETUP_PRECISION_CALCUL": "Computation accuracy", - "INFO_MENU_NOUVELLE_CALC": "New calculator" + "INFO_MENU_NOUVELLE_CALC": "New calculator", + "INFO_CLOSE_DIALOGUE_TITRE": "Please confirm", + "INFO_CLOSE_DIALOGUE_TEXT": "Warning ! Parameters and results will be lost. Really close ?", + "INFO_OPTION_YES": "Yes", + "INFO_OPTION_NO": "No" } \ No newline at end of file diff --git a/src/locale/error_messages.fr.json b/src/locale/error_messages.fr.json index 70ef5433a799df3bcdf157a66098a3942edfbc64..95bc46592bd6aa9433f0dbfa83dd67299c9e3da7 100644 --- a/src/locale/error_messages.fr.json +++ b/src/locale/error_messages.fr.json @@ -77,5 +77,9 @@ "INFO_SETUP_TITLE": "Paramètres de l'application", "INFO_SETUP_PRECISION_AFFICHAGE": "Précision d'affichage", "INFO_SETUP_PRECISION_CALCUL": "Précision de calcul", - "INFO_MENU_NOUVELLE_CALC": "Nouvelle calculette" + "INFO_MENU_NOUVELLE_CALC": "Nouvelle calculette", + "INFO_CLOSE_DIALOGUE_TITRE": "Confirmer la fermeture", + "INFO_CLOSE_DIALOGUE_TEXT": "Attention ! Les paramètres et résultats de la calculette seront perdus. Vraiment fermer ?", + "INFO_OPTION_YES": "Oui", + "INFO_OPTION_NO": "Non" } \ No newline at end of file