From c5be9b6e116091e32f4829f639ebbce07019cfe4 Mon Sep 17 00:00:00 2001 From: "mathias.chouet" <mathias.chouet@irstea.fr> Date: Mon, 11 Feb 2019 10:59:19 +0100 Subject: [PATCH] Traduction --- .../dialog-edit-param-values.component.html | 2 +- .../dialog-edit-param-values.component.ts | 24 +++++++++---------- src/locale/messages.en.json | 11 +++++++-- src/locale/messages.fr.json | 11 +++++++-- src/styles.scss | 2 ++ 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html index 61ae3b59b..71744a105 100644 --- a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html +++ b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.html @@ -1,4 +1,4 @@ -<h1 mat-dialog-title [innerHTML]="uitextEditParamComputedInitialValue"></h1> +<h1 mat-dialog-title [innerHTML]="uitextEditParamVariableValues"></h1> <div mat-dialog-content> diff --git a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts index 76b32a877..e0e482b4c 100644 --- a/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts +++ b/src/app/components/dialog-edit-param-values/dialog-edit-param-values.component.ts @@ -4,6 +4,7 @@ import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { I18nService } from "../../services/internationalisation/internationalisation.service"; import { NgParameter } from "../../formulaire/ngparam"; import { ParamValueMode } from "jalhyd"; +import { sprintf } from 'sprintf-js'; @Component({ selector: "dialog-edit-param-values", @@ -50,20 +51,20 @@ export class DialogEditParamValuesComponent implements OnInit { this.valueModes = [ { value: ParamValueMode.MINMAX, - label: "Min/max" + label: this.intlService.localizeText("INFO_PARAMMODE_MINMAX") }, { value: ParamValueMode.LISTE, - label: "Liste (à traduire)" + label: this.intlService.localizeText("INFO_PARAMMODE_LIST") } ]; this.decimalSeparators = [ { - label: "Point (à traduire)", + label: this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_POINT"), value: "." }, { - label: "Virgule (à traduire)", + label: this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_VIRGULE"), value: "," } ]; @@ -93,7 +94,7 @@ export class DialogEditParamValuesComponent implements OnInit { } public get uiTextModeSelection() { - return "Mode de variabilité (à traduire)"; + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_MODE"); } public get uitextValeurMini() { @@ -112,25 +113,24 @@ export class DialogEditParamValuesComponent implements OnInit { return this.intlService.localizeText("INFO_OPTION_CLOSE"); } - public get uitextEditParamComputedInitialValue() { - return "Modifier les valeurs variables (à traduire)"; - // return this.intlService.localizeText("INFO_OPTION_ALL"); + public get uitextEditParamVariableValues() { + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_TITLE"); } public get uitextListeValeurs() { - return "valeurs séparées par ';' (à traduire)"; + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT"); } public get uitextMustBeListOfNumbers() { - return "les valeurs doivent être de la forme 3;4.5;6 (à traduire)"; + return sprintf(this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT_ERROR"), this.separatorPattern); } public get uitextDecimalSeparator() { - return "Séparateur décimal (à traduire)"; + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_DECIMAL"); } public get uitextImportFile() { - return "Importer un fichier (à traduire)"; + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER_IMPORT_FICHIER"); } public get isMinMax() { diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 59bfeb186..00d565c1f 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -146,9 +146,16 @@ "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_IMPORT_FICHIER": "Import file", + "INFO_PARAMFIELD_PARAMVARIER_MINMAXSTEP": "min: %s, max: %s, step: %s", + "INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_DECIMAL": "Decimal separator", + "INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_POINT": ". (dot)", + "INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_VIRGULE": ", (comma)", + "INFO_PARAMFIELD_PARAMVARIER_TITLE": "Multiple values", + "INFO_PARAMFIELD_PARAMVARIER_MODE": "Mode", "INFO_PARAMFIELD_PARAMVARIER_VALUES": "Values:", "INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT": "Values list", + "INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT_ERROR": "Incorrect format; accepted separator: %s", "INFO_PARAMFIELD_VALEURMAXI": "To maximum value", "INFO_PARAMFIELD_VALEURMINI": "From minimum value", "INFO_PARAMMODE_MINMAX": "Min/max", @@ -180,7 +187,7 @@ "INFO_THEME_PASSE_A_BASSIN_DESCRIPTION": "Tools for sizing a fish pass made with pools also called fish steps", "INFO_THEME_PASSE_NATURELLE_TITRE": "Natural pass", "INFO_THEME_PASSE_NATURELLE_DESCRIPTION": "Tools for sizing a natural fish pass also called macroroughness pass or rock-ramp fish pass", - "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_TITRE": "Hydraulics with free surfaces", + "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_TITRE": "Open-channel flow", "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_DESCRIPTION": "Calculation modules for flows in channels and rivers", "INFO_THEME_HYDRAULIQUE_EN_CHARGE_TITRE": "Pipe flow", "INFO_THEME_HYDRAULIQUE_EN_CHARGE_DESCRIPTION": "Modules for calculating head losses in pressure pipes", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index dd76ea2dd..1d781e399 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -146,9 +146,16 @@ "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_IMPORT_FICHIER": "Importer un fichier", + "INFO_PARAMFIELD_PARAMVARIER_MINMAXSTEP": "min : %s, max : %s, pas : %s", + "INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_DECIMAL": "Séparateur décimal", + "INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_POINT": ". (point)", + "INFO_PARAMFIELD_PARAMVARIER_SEPARATEUR_VIRGULE": ", (virgule)", + "INFO_PARAMFIELD_PARAMVARIER_TITLE": "Valeurs multiples", + "INFO_PARAMFIELD_PARAMVARIER_MODE": "Mode", "INFO_PARAMFIELD_PARAMVARIER_VALUES": "Valeurs:", "INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT": "Liste de valeurs", + "INFO_PARAMFIELD_PARAMVARIER_VALUES_FORMAT_ERROR": "Format incorrect; séparateurs acceptés: %s", "INFO_PARAMFIELD_VALEURMAXI": "À la valeur maximum", "INFO_PARAMFIELD_VALEURMINI": "De la valeur minimum", "INFO_PARAMMODE_MINMAX": "Min/max", @@ -180,7 +187,7 @@ "INFO_THEME_PASSE_A_BASSIN_DESCRIPTION": "Outils de dimensionnement d'une passe à poissons de type passe à bassin ou encore appelée échelle à poisson", "INFO_THEME_PASSE_NATURELLE_TITRE": "Passe naturelle", "INFO_THEME_PASSE_NATURELLE_DESCRIPTION": "Outils de dimensionnement d'une passe à poissons de type passe naturelle ou encore appelée passe à macro-rugosités", - "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_TITRE": "Hydraulique à surfaces libres", + "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_TITRE": "Hydraulique à surface libre", "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_DESCRIPTION": "Modules de calcul pour les écoulements en canaux et rivières", "INFO_THEME_HYDRAULIQUE_EN_CHARGE_TITRE": "Hydraulique en charge", "INFO_THEME_HYDRAULIQUE_EN_CHARGE_DESCRIPTION": "Modules de calcul de perte de charge dans les conduites sous pression", diff --git a/src/styles.scss b/src/styles.scss index c7f1c492c..ba26e2343 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -15,6 +15,8 @@ button { } mat-dialog-container { + min-width: 280px; + .mat-dialog-actions { margin-bottom: -5px; } -- GitLab