From e5115f91d5924176f28990c91ab5004b564f07a9 Mon Sep 17 00:00:00 2001 From: "mathias.chouet" <mathias.chouet@irstea.fr> Date: Fri, 8 Feb 2019 17:45:31 +0100 Subject: [PATCH] Traduction --- .../dialog-edit-param-computed.component.ts | 3 +-- .../generic-calculator/calculator.component.html | 2 +- .../generic-calculator/calculator.component.ts | 4 ++++ .../param-computed/param-computed.component.ts | 9 ++++++--- src/app/components/param-link/param-link.component.ts | 11 ++++++++--- .../components/results-graph/graph-type.component.ts | 9 ++++++--- src/locale/messages.en.json | 6 ++++++ src/locale/messages.fr.json | 6 ++++++ 8 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/app/components/dialog-edit-param-computed/dialog-edit-param-computed.component.ts b/src/app/components/dialog-edit-param-computed/dialog-edit-param-computed.component.ts index e7979965f..5321f476f 100644 --- a/src/app/components/dialog-edit-param-computed/dialog-edit-param-computed.component.ts +++ b/src/app/components/dialog-edit-param-computed/dialog-edit-param-computed.component.ts @@ -30,8 +30,7 @@ export class DialogEditParamComputedComponent implements OnInit { } public get uitextEditParamComputedInitialValue() { - return "Modifier la valeur initiale (à traduire)"; - // return this.intlService.localizeText("INFO_OPTION_ALL"); + return this.intlService.localizeText("INFO_DIALOG_COMPUTED_VALUE_TITLE"); } public ngOnInit() { diff --git a/src/app/components/generic-calculator/calculator.component.html b/src/app/components/generic-calculator/calculator.component.html index e2820e129..d5d0c4c40 100644 --- a/src/app/components/generic-calculator/calculator.component.html +++ b/src/app/components/generic-calculator/calculator.component.html @@ -48,7 +48,7 @@ <mat-card id="calc-card-results" fxFlex.gt-xs="1 0 400px" fxFlex.lt-sm="1 0 300px"> <mat-card-header> <mat-card-title> - Resultats (à traduire) + {{ uitextResultsTitle }} </mat-card-title> </mat-card-header> <mat-card-content> diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts index e696082cb..de45460ff 100644 --- a/src/app/components/generic-calculator/calculator.component.ts +++ b/src/app/components/generic-calculator/calculator.component.ts @@ -142,6 +142,10 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit, return this.intlService.localizeText("INFO_CALCULATOR_CALC_NAME"); } + public get uitextResultsTitle() { + return this.intlService.localizeText("INFO_CALCULATOR_RESULTS_TITLE"); + } + ngOnInit() { this.intlService.addObserver(this); this.formulaireService.addObserver(this); diff --git a/src/app/components/param-computed/param-computed.component.ts b/src/app/components/param-computed/param-computed.component.ts index a1148d90b..6bfced00b 100644 --- a/src/app/components/param-computed/param-computed.component.ts +++ b/src/app/components/param-computed/param-computed.component.ts @@ -3,6 +3,7 @@ import { MatDialog } from "@angular/material"; import { NgParameter } from "../../formulaire/ngparam"; import { ParamCalculability } from "jalhyd"; import { DialogEditParamComputedComponent } from "../dialog-edit-param-computed/dialog-edit-param-computed.component"; +import { I18nService } from "../../services/internationalisation/internationalisation.service"; @Component({ selector: "param-computed", @@ -20,7 +21,8 @@ export class ParamComputedComponent { public title: string; constructor( - private editInitialValueDialog: MatDialog + private editInitialValueDialog: MatDialog, + private intlService: I18nService ) { } public get isDicho() { @@ -28,9 +30,10 @@ export class ParamComputedComponent { } public get infoText() { - let text = "En calcul (à traduire)"; // @TODO traduire "in calculation" + let text = this.intlService.localizeText("INFO_PARAMFIELD_IN_CALCULATION"); if (this.isDicho) { - text += " (valeur initiale: " + this.param.getValue() + ")"; + text += " (" + this.intlService.localizeText("INFO_PARAMFIELD_IN_CALCULATION_INITIAL_VALUE") + + ": " + this.param.getValue() + ")"; } return text; } diff --git a/src/app/components/param-link/param-link.component.ts b/src/app/components/param-link/param-link.component.ts index 4add3db05..6ef2f06c9 100644 --- a/src/app/components/param-link/param-link.component.ts +++ b/src/app/components/param-link/param-link.component.ts @@ -4,6 +4,7 @@ import { NgParameter } from "../../formulaire/ngparam"; import { ServiceFactory } from "../../services/service-factory"; import { ParamValueMode, Observer } from "jalhyd"; import { FormulaireService } from "../../services/formulaire/formulaire.service"; +import { I18nService } from "../..//services/internationalisation/internationalisation.service"; @Component({ selector: "param-link", @@ -53,9 +54,9 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy { private _formService: FormulaireService; - public label = "Choix du paramètre lié (à traduire)"; - - constructor() { + constructor( + private intlService: I18nService + ) { this.valid = new EventEmitter(); this._formService = ServiceFactory.instance.formulaireService; this._formService.addObserver(this); @@ -69,6 +70,10 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy { return this._message; } + public get label() { + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMLIE_LABEL"); + } + public set currentLinkedParam(p: any) { for (let i = 0; i < this._linkableParams.length; i++) { if (this._linkableParams[i].value.uid === p.uid) { diff --git a/src/app/components/results-graph/graph-type.component.ts b/src/app/components/results-graph/graph-type.component.ts index c3d41ebd9..b2ced5a55 100644 --- a/src/app/components/results-graph/graph-type.component.ts +++ b/src/app/components/results-graph/graph-type.component.ts @@ -1,6 +1,7 @@ import { Component } from "@angular/core"; import { Observable, IObservable, Observer } from "jalhyd"; import { GraphType } from "../../results/var-results"; +import { I18nService } from "../../services/internationalisation/internationalisation.service"; @Component({ selector: "graph-type", @@ -13,9 +14,7 @@ export class GraphTypeSelectComponent implements IObservable { private _observable: Observable; - public label = "Type de graphe (à traduire)"; - - constructor() { + constructor(private intlService: I18nService) { this._observable = new Observable(); } @@ -42,6 +41,10 @@ export class GraphTypeSelectComponent implements IObservable { } } + public get label() { + return this.intlService.localizeText("INFO_PARAMFIELD_GRAPH_TYPE"); + } + // interface IObservable /** diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 6f454dc41..554fbba13 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -34,6 +34,7 @@ "INFO_CALCULATOR_CALC_NAME": "Calculator name", "INFO_CALCULATOR_CALCULER": "Compute", "INFO_CALCULATOR_PARAMFIXES": "Fixed parameters", + "INFO_CALCULATOR_RESULTS_TITLE": "Results", "INFO_CALCULATOR_VALEURS": "Values", "INFO_CLOISONS_TITRE": "Fish ladder: Cross walls", "INFO_CLOSE_DIALOGUE_TEXT": "Warning ! Parameters and results will be lost. Really close?", @@ -51,6 +52,7 @@ "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1": "Partially submerged", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2": "Submerged", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3": "Zero flow", + "INFO_DIALOG_COMPUTED_VALUE_TITLE": "Edit initial value", "INFO_DIALOG_LOAD_SESSION_FILENAME": "Choose a file", "INFO_DIALOG_LOAD_SESSION_TITLE": "Load calculator modules", "INFO_DIALOG_SAVE_SESSION_FILENAME": "File name", @@ -135,9 +137,13 @@ "INFO_PABDIMENSIONS_TITRE": "Fish ladder: dimensions", "INFO_PABPUISSANCE_TITRE": "Fish ladder: dissipated power", "INFO_PARALLELSTRUCTURE_TITRE": "Parallel structures", + "INFO_PARAMFIELD_GRAPH_TYPE": "Graph type", + "INFO_PARAMFIELD_IN_CALCULATION": "In calculation", + "INFO_PARAMFIELD_IN_CALCULATION_INITIAL_VALUE": "initial value", "INFO_PARAMFIELD_PARAMCALCULER": "Calculate", "INFO_PARAMFIELD_PARAMFIXE": "Fixed", "INFO_PARAMFIELD_PARAMLIE": "Link", + "INFO_PARAMFIELD_PARAMLIE_LABEL": "Linked parameter", "INFO_PARAMFIELD_PARAMVARIER": "Vary", "INFO_PARAMFIELD_PASVARIATION": "With a variation step of", "INFO_PARAMFIELD_VALEURMAXI": "To maximum value", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 490f83bec..f510f9910 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -34,6 +34,7 @@ "INFO_CALCULATOR_CALC_NAME": "Nom du module de calcul", "INFO_CALCULATOR_CALCULER": "Calculer", "INFO_CALCULATOR_PARAMFIXES": "Paramètres fixés", + "INFO_CALCULATOR_RESULTS_TITLE": "Résultats", "INFO_CALCULATOR_VALEURS": "Valeurs", "INFO_CLOISONS_TITRE": "Passe à bassin : Cloisons", "INFO_CLOSE_DIALOGUE_TEXT": "Attention ! Les paramètres et résultats de la calculette seront perdus. Vraiment fermer ?", @@ -51,6 +52,7 @@ "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_1": "Partiellement noyé", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_2": "Noyé", "INFO_EXTRARES_ENUM_STRUCTUREFLOWREGIME_3": "Débit nul", + "INFO_DIALOG_COMPUTED_VALUE_TITLE": "Modifier la valeur initiale", "INFO_DIALOG_LOAD_SESSION_FILENAME": "Choisir un fichier", "INFO_DIALOG_LOAD_SESSION_TITLE": "Charger des modules de calcul", "INFO_DIALOG_SAVE_SESSION_FILENAME": "Nom de fichier", @@ -135,9 +137,13 @@ "INFO_PABDIMENSIONS_TITRE": "Passe à bassin : dimensions", "INFO_PABPUISSANCE_TITRE": "Passe à bassin : puissance dissipée", "INFO_PARALLELSTRUCTURE_TITRE": "Lois d'ouvrages", + "INFO_PARAMFIELD_GRAPH_TYPE": "Type de graphe", + "INFO_PARAMFIELD_IN_CALCULATION": "En calcul", + "INFO_PARAMFIELD_IN_CALCULATION_INITIAL_VALUE": "valeur initiale", "INFO_PARAMFIELD_PARAMCALCULER": "calculer", "INFO_PARAMFIELD_PARAMFIXE": "fixé", "INFO_PARAMFIELD_PARAMLIE": "lié", + "INFO_PARAMFIELD_PARAMLIE_LABEL": "Paramètre lié", "INFO_PARAMFIELD_PARAMVARIER": "varier", "INFO_PARAMFIELD_PASVARIATION": "Avec un pas de", "INFO_PARAMFIELD_VALEURMAXI": "À la valeur maximum", -- GitLab