From 7f5d29c2c81ddee67d5abf0a4a0a7969fac116ef Mon Sep 17 00:00:00 2001 From: "francois.grand" <francois.grand@irstea.fr> Date: Thu, 16 Nov 2017 15:50:30 +0100 Subject: [PATCH] =?UTF-8?q?-=20suppression=20d'i18n=20pour=20la=20traducti?= =?UTF-8?q?on=20-=20traduction=20anglaise=20compl=C3=A9t=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 -- package.json | 3 +- src/app/app.component.ts | 5 - .../cond_distri/conddistri.component.html | 12 +- .../cond_distri/conddistri.component.ts | 10 +- .../generic/calculator.component.html | 4 +- .../generic/calculator.component.ts | 41 +++--- src/app/calculators/generic/formulaire.ts | 19 +-- src/app/calculators/generic/ngparam.ts | 4 - .../lechaptcalmon.component.html | 12 +- .../lechapt-calmon/lechaptcalmon.component.ts | 8 ++ .../regime-uniforme.component.html | 2 +- .../regime-uniforme.component.ts | 8 ++ .../regime-uniforme/regime-uniforme.en.json | 26 ++++ .../calculators/remous/remous.component.html | 2 +- .../calculators/remous/remous.component.ts | 8 ++ src/app/calculators/remous/remous.en.json | 53 +++++++ .../section-param.component.html | 2 +- .../section-param/section-param.component.ts | 8 ++ .../section-param/section-param.en.json | 45 ++++++ .../section-param/section-param.fr.json | 4 +- .../calculator-results.component.html | 4 +- .../calculator-results.component.ts | 12 ++ src/app/components/field-set/field-set.html | 10 +- .../param-field-line.component.ts | 27 +++- .../param-field-line/param-field-line.html | 20 +-- .../param-input/param-input.component.html | 7 +- .../param-input/param-input.component.ts | 6 +- .../remous-results.component.html | 12 +- .../remous-results.component.ts | 130 ++++++++++++------ src/app/i18n-providers.ts | 35 ----- .../internationalisation.service.ts | 11 ++ src/locale/error_messages.en.json | 43 +++++- src/locale/error_messages.fr.json | 53 ++++++- src/locale/messages.en.xlf | 25 ---- src/main.ts | 7 +- 36 files changed, 456 insertions(+), 231 deletions(-) create mode 100644 src/app/calculators/regime-uniforme/regime-uniforme.en.json create mode 100644 src/app/calculators/remous/remous.en.json create mode 100644 src/app/calculators/section-param/section-param.en.json delete mode 100644 src/app/i18n-providers.ts delete mode 100644 src/locale/messages.en.xlf diff --git a/README.md b/README.md index 8f60da8dd..dbf6b6701 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,3 @@ and then : ### To flag suspicious language usage `npm run lint` - -### To generate translation file - -`npm run i18n` - -This creates a _src/messages.xlf_ file. Move it to _src/locale/messages.<locale>.xlf_ - - -!!!! comment fait on pour mettre à jour un fichier messages.<locale>.xlf_ existant ? !!!! diff --git a/package.json b/package.json index 9ba0343c8..8ac553805 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,7 @@ "test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"", "pretest:once": "npm run build", "test:once": "karma start karma.conf.js --single-run", - "lint": "tslint ./src/**/*.ts -t verbose", - "i18n": "ng-xi18n --i18nFormat=xlf -p src/tsconfig.json" + "lint": "tslint ./src/**/*.ts -t verbose" }, "keywords": [], "author": "", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4972f2dba..0ef2e47b8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -58,11 +58,6 @@ export class AppComponent implements Observer { this.errorService.addObserver(this); } - /* - angular i18n ne prend pas en charge le changement dynamique de langue : - https://github.com/angular/angular/issues/13905 - */ - private onSelectLang(evt: any) { let v = evt.target.value; let lc = LanguageCode[v]; diff --git a/src/app/calculators/cond_distri/conddistri.component.html b/src/app/calculators/cond_distri/conddistri.component.html index c3bec4eb3..5d69e1710 100644 --- a/src/app/calculators/cond_distri/conddistri.component.html +++ b/src/app/calculators/cond_distri/conddistri.component.html @@ -1,10 +1,2 @@ -<h1 i18n="@@titre_cond_distri">Conduite distributrice</h1> -<hydrocalc type="ConduiteDistributrice"></hydrocalc> -<!-- - <field-set *ngFor="let fs of _fieldSets" [fieldSet]=fs (onRadio)=onRadioClick($event)></field-set> - - <div style="text-align:center;"> - <button type="button" class="button_compute" name="Calculer" (click)="doCompute()" i18n="@@hyd_compute">Calculer</button> - </div> - <calc-results [style.display]="getResultsStyleDisplay()"></calc-results> - --> \ No newline at end of file +<h1>{{uitextTitre}}</h1> +<hydrocalc type="ConduiteDistributrice"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/cond_distri/conddistri.component.ts b/src/app/calculators/cond_distri/conddistri.component.ts index 45b4fce07..d9605a153 100644 --- a/src/app/calculators/cond_distri/conddistri.component.ts +++ b/src/app/calculators/cond_distri/conddistri.component.ts @@ -1,8 +1,16 @@ -import { Component, } from '@angular/core'; +import { Component } from '@angular/core'; + +import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; @Component({ selector: 'cond-distri', templateUrl: "./conddistri.component.html" }) export class CondDistriComponent { + private get uitextTitre() { + return this.intlService.localizeText("INFO_CONDDISTRI_TITRE") + } + + constructor(private intlService: InternationalisationService) { + } } diff --git a/src/app/calculators/generic/calculator.component.html b/src/app/calculators/generic/calculator.component.html index af3fb204b..eb1c36d1d 100644 --- a/src/app/calculators/generic/calculator.component.html +++ b/src/app/calculators/generic/calculator.component.html @@ -4,8 +4,8 @@ </table> <div style="text-align:center;"> - <button type="button" class="button_compute" name="Calculer" (click)="doCompute()" i18n="@@hyd_compute">Calculer</button> + <button type="button" class="button_compute" name="Calculer" (click)="doCompute()">{{uitextCalculer}}</button> </div> <calc-results [style.display]="getResultsStyleDisplay()"></calc-results> <section-results [style.display]="getSectionResultsStyleDisplay()"></section-results> -<remous-results [style.display]="getRemousResultsStyleDisplay()"></remous-results> +<remous-results [style.display]="getRemousResultsStyleDisplay()"></remous-results> \ No newline at end of file diff --git a/src/app/calculators/generic/calculator.component.ts b/src/app/calculators/generic/calculator.component.ts index 37e6aff36..0ed680b2f 100644 --- a/src/app/calculators/generic/calculator.component.ts +++ b/src/app/calculators/generic/calculator.component.ts @@ -93,6 +93,10 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, Observer { return this._formulaire.getFieldSets(this._nodeType); } + private get uitextCalculer() { + return this.intlService.localizeText("INFO_CALCULATOR_CALCULER"); + } + private loadLocalisation(): Promise<string> { let ths = this; let processData = function (s: string) { @@ -190,7 +194,8 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, Observer { prom.then( _ => { let ssf: SelectField = <SelectField>this._formulaire.getFormulaireElementById("select_section"); - this.updateSectionType(ssf.getValue()); + if (ssf != undefined) + this.updateSectionType(ssf.getValue()); this.applyDependencies(); } @@ -388,71 +393,71 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, Observer { // charge spécifique let Hs = sect.Calc("Hs", Y); - this.addSectionFixedResult(Hs, "La charge spécifique (m)", nDigits, "Hs"); + this.addSectionFixedResult(Hs, this.intlService.localizeText("INFO_GRANDEUR_HS"), nDigits, "Hs"); // charge critique let Hsc = sect.Calc("Hsc", Y); - this.addSectionFixedResult(Hsc, "La charge critique (m)", nDigits, "Hsc"); + this.addSectionFixedResult(Hsc, this.intlService.localizeText("INFO_GRANDEUR_HSC"), nDigits, "Hsc"); // largeur au miroir let B = sect.Calc("B", Y); - this.addSectionFixedResult(B, "La largeur au miroir (m)", nDigits); + this.addSectionFixedResult(B, this.intlService.localizeText("INFO_GRANDEUR_B"), nDigits); // périmètre hydraulique let P = sect.Calc("P", Y); - this.addSectionFixedResult(P, "Le périmètre mouillé (m)", nDigits); + this.addSectionFixedResult(P, this.intlService.localizeText("INFO_GRANDEUR_P"), nDigits); // surface hydraulique let S = sect.Calc("S", Y); - this.addSectionFixedResult(S, "La surface mouillée (m2)", nDigits); + this.addSectionFixedResult(S, this.intlService.localizeText("INFO_GRANDEUR_S"), nDigits); // rayon hydraulique let R = sect.Calc("R", Y); - this.addSectionFixedResult(R, "Le rayon hydraulique (m)", nDigits); + this.addSectionFixedResult(R, this.intlService.localizeText("INFO_GRANDEUR_R"), nDigits); // vitesse moyenne let V = sect.Calc("V", Y); - this.addSectionFixedResult(V, "La vitesse moyenne (m/s)", nDigits); + this.addSectionFixedResult(V, this.intlService.localizeText("INFO_GRANDEUR_V"), nDigits); // nombre de Froude let Fr = sect.Calc("Fr", Y); - this.addSectionFixedResult(Fr, "Le Froude", nDigits); + this.addSectionFixedResult(Fr, this.intlService.localizeText("INFO_GRANDEUR_FR"), nDigits); // tirant d'eau critique let Yc = sect.Calc("Yc", Y); - this.addSectionFixedResult(Yc, "Le tirant d'eau critique (m)", nDigits, "Yc"); + this.addSectionFixedResult(Yc, this.intlService.localizeText("INFO_GRANDEUR_YC"), nDigits, "Yc"); // tirant d'eau normal let Yn = sect.Calc("Yn", Y); - this.addSectionFixedResult(Yn, "Le tirant d'eau normal (m)", nDigits, "Yn"); + this.addSectionFixedResult(Yn, this.intlService.localizeText("INFO_GRANDEUR_YN"), nDigits, "Yn"); // tirant d'eau fluvial let Yf = sect.Calc("Yf", Y); - this.addSectionFixedResult(Yf, "Le tirant d'eau fluvial (m)", nDigits, "Yf"); + this.addSectionFixedResult(Yf, this.intlService.localizeText("INFO_GRANDEUR_YF"), nDigits, "Yf"); // tirant d'eau torrentiel let Yt = sect.Calc("Yt", Y); - this.addSectionFixedResult(Yt, "Le tirant d'eau torrentiel (m)", nDigits, "Yt"); + this.addSectionFixedResult(Yt, this.intlService.localizeText("INFO_GRANDEUR_YT"), nDigits, "Yt"); // tirant d'eau conjugué let Yco = sect.Calc("Yco", Y); - this.addSectionFixedResult(Yco, "Le tirant d'eau conjugué (m)", nDigits, "Yco"); + this.addSectionFixedResult(Yco, this.intlService.localizeText("INFO_GRANDEUR_YCO"), nDigits, "Yco"); // perte de charge let J = sect.Calc("J", Y); - this.addSectionFixedResult(J, "La perte de charge (m/m)", nDigits); + this.addSectionFixedResult(J, this.intlService.localizeText("INFO_GRANDEUR_J"), nDigits); // Variation linéaire de l'énergie spécifique let IJ = sect.Calc("I-J", Y); - this.addSectionFixedResult(IJ, "Variation linéaire de l'énergie spécifique (m/m)", nDigits); + this.addSectionFixedResult(IJ, this.intlService.localizeText("INFO_GRANDEUR_I-J"), nDigits); // impulsion hydraulique let Imp = sect.Calc("Imp", Y); - this.addSectionFixedResult(Imp, "Impulsion (m/m)", nDigits); + this.addSectionFixedResult(Imp, this.intlService.localizeText("INFO_GRANDEUR_IMP"), nDigits); // contrainte de cisaillement let Tau0 = sect.Calc("Tau0", Y); - this.addSectionFixedResult(Tau0, "La force tractrice (N)", nDigits); + this.addSectionFixedResult(Tau0, this.intlService.localizeText("INFO_GRANDEUR_TAU0"), nDigits); this.sectionResultsComponent.section = sect; this._showResultsSection = true; diff --git a/src/app/calculators/generic/formulaire.ts b/src/app/calculators/generic/formulaire.ts index c3004c012..6a1f9957a 100644 --- a/src/app/calculators/generic/formulaire.ts +++ b/src/app/calculators/generic/formulaire.ts @@ -469,7 +469,9 @@ export abstract class FormulaireElement { return this.verifyDependency(d); } - public abstract updateLocalisation(loc: StringMap): void; + public updateLocalisation(loc: StringMap) { + this.label = loc[this.id]; + } public toString() { return "id:" + this._id + (this.isDisplayed ? " displayed" : " NOT displayed") + " label:" + this.label; @@ -539,10 +541,6 @@ export class FieldSet extends FormulaireElement { protected verifyDependency(d: Dependency): boolean { throw "FieldSet.verifyDependency() : type de condition '" + DependencyConditionType[d.masterCondition.type] + "' non pris en charge"; } - - public updateLocalisation(loc: StringMap) { - this.label = loc[this.id]; - } } export class SelectEntry { @@ -611,7 +609,8 @@ export class SelectField extends Field { } public updateLocalisation(loc: StringMap) { - this.label = loc[this.id]; + super.updateLocalisation(loc); + for (let e of this._entries) { e.label = loc[e.value]; } @@ -637,10 +636,6 @@ export class CheckField extends Field { protected verifyDependency(d: Dependency): boolean { throw "CheckField.verifyDependency() : type de condition '" + DependencyConditionType[d.masterCondition.type] + "' non pris en charge"; } - - public updateLocalisation(loc: StringMap) { - this.label = loc[this.id]; - } } export abstract class InputField extends Field { @@ -657,10 +652,6 @@ export abstract class InputField extends Field { public setValue(val: any) { this._value = val; } - - public updateLocalisation(loc: StringMap) { - this.label = loc[this.id]; - } } export enum DependencyConditionType { diff --git a/src/app/calculators/generic/ngparam.ts b/src/app/calculators/generic/ngparam.ts index 8d7f12bdb..d1e2e96f5 100644 --- a/src/app/calculators/generic/ngparam.ts +++ b/src/app/calculators/generic/ngparam.ts @@ -109,8 +109,4 @@ export class NgParameter extends InputField { throw "NgParameter.verifyDependency() : type de condition '" + DependencyConditionType[d.masterCondition.type] + "' non pris en charge"; } } - - public updateLocalisation(loc: StringMap) { - this.label = loc[this.id]; - } } diff --git a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.html b/src/app/calculators/lechapt-calmon/lechaptcalmon.component.html index 00f365ed7..f4342e38c 100644 --- a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.html +++ b/src/app/calculators/lechapt-calmon/lechaptcalmon.component.html @@ -1,10 +1,2 @@ -<h1>Lechapt-Calmon</h1> -<hydrocalc type="LechaptCalmon"></hydrocalc> -<!-- -<field-set *ngFor="let fs of _fieldSets" [fieldSet]=fs (onRadio)=onRadioClick($event)></field-set> - -<div style="text-align:center;"> - <button type="button" class="button_compute" name="Calculer" (click)="doCompute()" i18n="@@hyd_compute">Calculer</button> -</div> -<calc-results [style.display]="getResultsStyleDisplay()"></calc-results> ---> \ No newline at end of file +<h1>{{uitextTitre}}</h1> +<hydrocalc type="LechaptCalmon"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.ts b/src/app/calculators/lechapt-calmon/lechaptcalmon.component.ts index 811e4d247..af8ee271e 100644 --- a/src/app/calculators/lechapt-calmon/lechaptcalmon.component.ts +++ b/src/app/calculators/lechapt-calmon/lechaptcalmon.component.ts @@ -1,8 +1,16 @@ import { Component } from '@angular/core'; +import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; + @Component({ selector: 'lechapt-calmon', templateUrl: "./lechaptcalmon.component.html" }) export class LechaptCalmonComponent { + private get uitextTitre() { + return this.intlService.localizeText("INFO_LECHAPT_TITRE") + } + + constructor(private intlService: InternationalisationService) { + } } diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.component.html b/src/app/calculators/regime-uniforme/regime-uniforme.component.html index 81c52c289..2f171cdac 100644 --- a/src/app/calculators/regime-uniforme/regime-uniforme.component.html +++ b/src/app/calculators/regime-uniforme/regime-uniforme.component.html @@ -1,2 +1,2 @@ -<h1>Régime uniforme</h1> +<h1>{{uitextTitre}}</h1> <hydrocalc type="RegimeUniforme"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.component.ts b/src/app/calculators/regime-uniforme/regime-uniforme.component.ts index 3200751bc..5881e4003 100644 --- a/src/app/calculators/regime-uniforme/regime-uniforme.component.ts +++ b/src/app/calculators/regime-uniforme/regime-uniforme.component.ts @@ -1,8 +1,16 @@ import { Component } from '@angular/core'; +import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; + @Component({ selector: 'regime-uniforme', templateUrl: "./regime-uniforme.component.html" }) export class RegimeUniformeComponent { + private get uitextTitre() { + return this.intlService.localizeText("INFO_REGUNI_TITRE") + } + + constructor(private intlService: InternationalisationService) { + } } diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.en.json b/src/app/calculators/regime-uniforme/regime-uniforme.en.json new file mode 100644 index 000000000..f40a0edaf --- /dev/null +++ b/src/app/calculators/regime-uniforme/regime-uniforme.en.json @@ -0,0 +1,26 @@ +{ + "fs_section": "Type of section", + "select_section": "Choice of section type", + "select_section_trapez": "Trapezoidal", + "select_section_rect": "Rectangular", + "select_section_circ": "Circular", + "select_section_puiss": "Parabolic", + "fs_section_trapez": "Definition of trapezoidal section", + "LargeurFond": "Width at bottom", + "Fruit": "Bank slope", + "fs_section_rect": "Definition of rectangular section", + "LargeurBerge": "Width at embankment level", + "fs_section_circ": "Definition of circular section", + "D": "Diameter", + "fs_section_puiss": "Definition of parabolic section", + "k": "Coefficient", + "fs_bief": "Features reach", + "Ks": "Strickler coefficient", + "If": "Bottom slope", + "YB": "Embankment elevation", + "fs_hydraulique": "Hydraulic features", + "Q": "Flow", + "Y": "Draft", + "fs_param_calc": "Calculation parameters", + "Pr": "Display accuracy" +} \ No newline at end of file diff --git a/src/app/calculators/remous/remous.component.html b/src/app/calculators/remous/remous.component.html index add35e051..d17503f51 100644 --- a/src/app/calculators/remous/remous.component.html +++ b/src/app/calculators/remous/remous.component.html @@ -1,2 +1,2 @@ -<h1>Courbe de remous</h1> +<h1>{{uitextTitre}}</h1> <hydrocalc type="CourbeRemous"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/remous/remous.component.ts b/src/app/calculators/remous/remous.component.ts index eed0dc6d8..680163d20 100644 --- a/src/app/calculators/remous/remous.component.ts +++ b/src/app/calculators/remous/remous.component.ts @@ -1,8 +1,16 @@ import { Component } from '@angular/core'; +import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; + @Component({ selector: 'courbe-remous', templateUrl: "./remous.component.html" }) export class CourbeRemousComponent { + private get uitextTitre() { + return this.intlService.localizeText("INFO_REMOUS_TITRE") + } + + constructor(private intlService: InternationalisationService) { + } } diff --git a/src/app/calculators/remous/remous.en.json b/src/app/calculators/remous/remous.en.json new file mode 100644 index 000000000..8f9b0f722 --- /dev/null +++ b/src/app/calculators/remous/remous.en.json @@ -0,0 +1,53 @@ +{ + "fs_section": "Type of section", + "select_section": "Choice of section type", + "select_section_trapez": "Trapezoidal", + "select_section_rect": "Rectangular", + "select_section_circ": "Circular", + "select_section_puiss": "Parabolic", + "fs_section_trapez": "Definition of trapezoidal section", + "LargeurFond": "Width at bottom", + "Fruit": "Bank slope", + "fs_section_rect": "Definition of rectangular section", + "fs_section_circ": "Definition of circular section", + "D": "Diameter", + "fs_section_puiss": "Definition of parabolic section", + "k": "Coefficient", + "LargeurBerge": "Width at embankment level", + "fs_bief": "Features reach", + "Ks": "Strickler coefficient", + "Long": "Length of reach", + "If": "Bottom slope", + "YB": "Embankment elevation", + "fs_condlim": "Boundary conditions", + "Q": "Upstream flow", + "Yaval": "Water level imposed at downstream", + "Yamont": "Water level imposed at upstream", + "fs_param_calc": "Calculation parameters", + "Dx": "Discretisation step", + "Pr": "Display accuracy", + "select_resolution": "Resolution method", + "select_resolution_trap": "Integration by trapezoid", + "select_resolution_rk4": "Runge Kutta fourth order", + "select_resolution_euler": "Explicit Euler", + "fs_target_data": "Data to compute", + "select_target": "Choice of the data to compute", + "select_target_none": "None", + "select_target_Hs": "Specific head (m)", + "select_target_Hsc": "Critical head (m)", + "select_target_B": "Surface width (m)", + "select_target_P": "Wetted perimeter (m)", + "select_target_S": "Wetted area (m2)", + "select_target_R": "Hydraulic radius (m)", + "select_target_V": "Average speed (m/s)", + "select_target_Fr": "Froude number", + "select_target_Yc": "Critical depth (m)", + "select_target_Yn": "Normal depth (m)", + "select_target_Yf": "Subcritical depth (m)", + "select_target_Yt": "Supercritical depth (m)", + "select_target_Yco": "Conjugate depth (m)", + "select_target_J": "Head loss (m)", + "select_target_I-J": "Linear variation of specific head (m/m)", + "select_target_Imp": "Impulse (N)", + "select_target_Tau0": "Tractive force (Pa)" +} \ No newline at end of file diff --git a/src/app/calculators/section-param/section-param.component.html b/src/app/calculators/section-param/section-param.component.html index 25eb48d73..23795c8b7 100644 --- a/src/app/calculators/section-param/section-param.component.html +++ b/src/app/calculators/section-param/section-param.component.html @@ -1,2 +1,2 @@ -<h1>Section paramétrée</h1> +<h1>{{uitextTitre}}</h1> <hydrocalc type="SectionParametree"></hydrocalc> \ No newline at end of file diff --git a/src/app/calculators/section-param/section-param.component.ts b/src/app/calculators/section-param/section-param.component.ts index 3edb71596..013aa5940 100644 --- a/src/app/calculators/section-param/section-param.component.ts +++ b/src/app/calculators/section-param/section-param.component.ts @@ -1,8 +1,16 @@ import { Component } from '@angular/core'; +import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; + @Component({ selector: 'section-param', templateUrl: "./section-param.component.html" }) export class SectionParametreeComponent { + private get uitextTitre() { + return this.intlService.localizeText("INFO_SECTPARAM_TITRE") + } + + constructor(private intlService: InternationalisationService) { + } } diff --git a/src/app/calculators/section-param/section-param.en.json b/src/app/calculators/section-param/section-param.en.json new file mode 100644 index 000000000..22e764298 --- /dev/null +++ b/src/app/calculators/section-param/section-param.en.json @@ -0,0 +1,45 @@ +{ + "fs_section": "Type of section", + "select_section": "Choice of section type", + "select_section_trapez": "Trapezoidal", + "select_section_rect": "Rectangular", + "select_section_circ": "Circular", + "select_section_puiss": "Parabolic", + "fs_section_trapez": "Definition of trapezoidal section", + "LargeurFond": "Width at bottom", + "Fruit": "Bank slope", + "fs_section_rect": "Definition of rectangular section", + "fs_section_circ": "Definition of circular section", + "D": "Diameter", + "fs_section_puiss": "Definition of parabolic section", + "k": "Coefficient", + "LargeurBerge": "Width at embankment level", + "fs_bief": "Features reach", + "Ks": "Strickler coefficient", + "If": "Bottom slope", + "YB": "Embankment elevation", + "fs_hydraulique": "Hydraulic features", + "Q": "Flow", + "Y": "Draft", + "fs_param_calc": "Calculation parameters", + "Pr": "Display accuracy", + "fs_computed_var": "Data to compute", + "select_target": "Choice of the data to compute", + "select_target_Hs": "Specific head (m)", + "select_target_Hsc": "Critical head (m)", + "select_target_B": "Surface width (m)", + "select_target_P": "Wetted perimeter (m)", + "select_target_S": "Wetted area (m2)", + "select_target_R": "Hydraulic radius (m)", + "select_target_V": "Average speed (m/s)", + "select_target_Fr": "Froude number", + "select_target_Yc": "Critical depth (m)", + "select_target_Yn": "Normal depth (m)", + "select_target_Yf": "Subcritical depth (m)", + "select_target_Yt": "Supercritical depth (m)", + "select_target_Yco": "Conjugate depth (m)", + "select_target_J": "Head loss (m)", + "select_target_I-J": "Linear variation of specific head (m/m)", + "select_target_Imp": "Impulse (N)", + "select_target_Tau0": "Tractive force (Pa)" +} \ No newline at end of file diff --git a/src/app/calculators/section-param/section-param.fr.json b/src/app/calculators/section-param/section-param.fr.json index 7f13f3fdb..3f29b000b 100644 --- a/src/app/calculators/section-param/section-param.fr.json +++ b/src/app/calculators/section-param/section-param.fr.json @@ -40,6 +40,6 @@ "select_target_Yco": "Le tirant d'eau conjugué (m)", "select_target_J": "La perte de charge (m)", "select_target_I-J": "Variation linéaire de l'énergie spécifique (m/m)", - "select_target_Imp": "Impulsion (m/m)", - "select_target_Tau0": "La force tractrice (N)" + "select_target_Imp": "Impulsion (N)", + "select_target_Tau0": "La force tractrice (Pa)" } \ No newline at end of file diff --git a/src/app/components/calculator-results/calculator-results.component.html b/src/app/components/calculator-results/calculator-results.component.html index b5ea9c1ff..92b0803bd 100644 --- a/src/app/components/calculator-results/calculator-results.component.html +++ b/src/app/components/calculator-results/calculator-results.component.html @@ -5,8 +5,8 @@ <!-- table des résultats fixées --> <table style="float: left"> <tr> - <th>Paramètres fixés</th> - <th>Valeurs</th> + <th>{{uitextParamFixes}}</th> + <th>{{uitextValeurs}}</th> </tr> <tr *ngFor="let r of _fixedResults; let i=index" [class]="getFixedResultClass(i)"> <td class="result_label">{{r.label}}</td> diff --git a/src/app/components/calculator-results/calculator-results.component.ts b/src/app/components/calculator-results/calculator-results.component.ts index 04ebda0e9..b36bf4663 100644 --- a/src/app/components/calculator-results/calculator-results.component.ts +++ b/src/app/components/calculator-results/calculator-results.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { NgParameter } from '../../calculators/generic/ngparam'; +import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; @Component({ selector: 'calc-results', @@ -75,6 +76,17 @@ export class CalculatorResultsComponent { } }; + constructor(private intlService: InternationalisationService) { + } + + private get uitextParamFixes() { + return this.intlService.localizeText("INFO_CALCULATOR_PARAMFIXES"); + } + + private get uitextValeurs() { + return this.intlService.localizeText("INFO_CALCULATOR_VALEURS"); + } + public addFixedResult(p: NgParameter, v: number, fixedPrec: number, displaySymbol: boolean) { this._fixedResults.push({ "label": this.paramLabel(p, displaySymbol), "value": v.toFixed(fixedPrec) }); } diff --git a/src/app/components/field-set/field-set.html b/src/app/components/field-set/field-set.html index bf1aba27b..b7bc1e7d3 100644 --- a/src/app/components/field-set/field-set.html +++ b/src/app/components/field-set/field-set.html @@ -3,18 +3,10 @@ <div class="fieldset_title">{{_fieldSet.label}}</div> </td> </tr> -<!-- - <tr id="tr_fs_hydraulique_header"> - <td colspan="2"></td> - <td *ngIf="hasRadioFix()" align="center" class="radio_param_header" i18n="@@radio_param_header_fix">Paramètre fixé</td> - <td *ngIf="hasRadioVar()" align="center" class="radio_param_header" i18n="@@radio_param_header_var">Paramètre à varier</td> - <td *ngIf="hasRadioCal()" align="center" class="radio_param_header" i18n="@@radio_param_header_cal">Paramètre à calculer</td> - </tr> ---> <tr *ngFor="let p of _fieldSet.fields"> <td colspan="5"> <param-field-line *ngIf="p.isInput" [computeNodeType]=_fieldSet.computeNodeType [symbol]=p.symbol (onRadio)=onRadioClick($event)></param-field-line> <select-field-line *ngIf="p.isSelect" [id]=p.id (onSelectChange)=onSelectChanged($event)></select-field-line> <check-field-line *ngIf="p.isCheck" [id]=p.id></check-field-line> </td> -</tr> +</tr> \ No newline at end of file diff --git a/src/app/components/param-field-line/param-field-line.component.ts b/src/app/components/param-field-line/param-field-line.component.ts index 61632954e..c0286b46d 100644 --- a/src/app/components/param-field-line/param-field-line.component.ts +++ b/src/app/components/param-field-line/param-field-line.component.ts @@ -3,6 +3,7 @@ import { Component, Input, Output, DoCheck, EventEmitter } from '@angular/core'; import { ComputeNodeType } from 'jalhyd'; import { ParamService } from '../../services/param/param.service'; +import { InternationalisationService } from '../../services/internationalisation/internationalisation.service'; import { NgParameter, ParamRadioConfig } from '../../calculators/generic/ngparam'; @Component({ @@ -24,7 +25,7 @@ import { NgParameter, ParamRadioConfig } from '../../calculators/generic/ngparam export class ParamFieldLineComponent { private _param: NgParameter; - constructor(private paramService: ParamService) { + constructor(private paramService: ParamService, private intlService: InternationalisationService) { } private get title(): string { @@ -36,6 +37,30 @@ export class ParamFieldLineComponent { return t; } + private get uitextParamFixe() { + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMFIXE"); + } + + private get uitextParamVarier() { + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMVARIER"); + } + + private get uitextValeurMini() { + return this.intlService.localizeText("INFO_PARAMFIELD_VALEURMINI"); + } + + private get uitextValeurMaxi() { + return this.intlService.localizeText("INFO_PARAMFIELD_VALEURMAXI"); + } + + private get uitextPasVariation() { + return this.intlService.localizeText("INFO_PARAMFIELD_PASVARIATION"); + } + + private get uitextParamCalculer() { + return this.intlService.localizeText("INFO_PARAMFIELD_PARAMCALCULER"); + } + /** * type de noeud de calcul */ diff --git a/src/app/components/param-field-line/param-field-line.html b/src/app/components/param-field-line/param-field-line.html index a6fcee431..0e15bfd64 100644 --- a/src/app/components/param-field-line/param-field-line.html +++ b/src/app/components/param-field-line/param-field-line.html @@ -7,19 +7,19 @@ <td align="center" class="radio_param"> <input *ngIf="hasRadioFix()" type="radio" name="radio_param_{{symbol}}" value="fix" (click)="onRadioClick(symbol, 'fix')" [checked]=radioFixCheck [disabled]=isDisabled id="radio_fix" /> - <label *ngIf="hasRadioFix()" for="radio_fix" i18n="@@radio_param_header_fix">fixé</label> + <label *ngIf="hasRadioFix()" for="radio_fix">{{uitextParamFixe}}</label> </td> <td align="center" class="radio_param"> - <input *ngIf="hasRadioVar()" type="radio" name="radio_param_{{symbol}}" value="var" (click)="onRadioClick(symbol, 'var')" - [checked]=radioVarCheck [disabled]=isDisabled id="radio_var" /> - <label *ngIf="hasRadioVar()" for="radio_var" i18n="@@radio_param_header_var">varier</label> + <input *ngIf="hasRadioVar()" type="radio" name="radio_param_{{symbol}}" value="var" (click)="onRadioClick(symbol, + 'var')" [checked]=radioVarCheck [disabled]=isDisabled id="radio_var" /> + <label *ngIf="hasRadioVar()" for="radio_var">{{uitextParamVarier}}</label> </td> <td align="center" class="radio_param"> - <input *ngIf="hasRadioCal()" type="radio" name="radio_param_{{symbol}}" value="cal" (click)="onRadioClick(symbol, 'cal')" - [checked]=radioCalCheck [disabled]=isDisabled id="radio_cal" /> - <label *ngIf="hasRadioCal()" for="radio_cal" i18n="@@radio_param_header_cal">calculer</label> + <input *ngIf="hasRadioCal()" type="radio" name="radio_param_{{symbol}}" value="cal" (click)="onRadioClick(symbol, + 'cal')" [checked]=radioCalCheck [disabled]=isDisabled id="radio_cal" /> + <label *ngIf="hasRadioCal()" for="radio_cal">{{uitextParamCalculer}}</label> </td> </tr> <!-- @@ -72,15 +72,15 @@ --> <tr [style.display]="isVarRadio"> <div align="center"> - De la valeur minimum + {{uitextValeurMini}} <input [(ngModel)]="_param.minValue"> </div> <div align="center"> - à la valeur maximum + {{uitextValeurMaxi}} <input [(ngModel)]="_param.maxValue"> </div> <div align="center"> - avec un pas de : + {{uitextPasVariation}} <input [(ngModel)]="_param.stepValue"> </div> </tr> \ No newline at end of file diff --git a/src/app/components/param-input/param-input.component.html b/src/app/components/param-input/param-input.component.html index bde3b4185..31c213140 100644 --- a/src/app/components/param-input/param-input.component.html +++ b/src/app/components/param-input/param-input.component.html @@ -1,9 +1,4 @@ -<!-- -format de l'attribut i18n : -i18n="<meaning>|<description>@@<custom id>" -<p i18n="titre saisie|Titre du contrôle de saisie de paramètre@@titre_saisie_param">Saisie de paramètre</p> ---> -<p *ngIf="displayTitle" i18n="@@titre_saisie_param">Saisie de paramètre</p> +<p *ngIf="displayTitle">{{uitextParamInput}}</p> <input [disabled]="_inputDisabled" placeholder="{{_paramDef.symbol}}" [ngModel]="_uiValue.uncheckedValueString" (ngModelChange)="setValue($event)" /> <br/> {{_message}} diff --git a/src/app/components/param-input/param-input.component.ts b/src/app/components/param-input/param-input.component.ts index 47c7e7695..018cc3031 100644 --- a/src/app/components/param-input/param-input.component.ts +++ b/src/app/components/param-input/param-input.component.ts @@ -3,7 +3,7 @@ import { Component, Input, forwardRef, OnInit, DoCheck, ChangeDetectorRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormControl } from '@angular/forms'; -import { ComputeNodeType, ParamDefinition, NumericalString, Message } from 'jalhyd'; +import { ComputeNodeType, ParamDefinition, NumericalString, Message, MessageCode } from 'jalhyd'; import { ParamService } from '../../services/param/param.service'; import { InternationalisationService, LanguageCode } from '../../services/internationalisation/internationalisation.service'; @@ -104,6 +104,10 @@ export class ParamInputComponent implements ControlValueAccessor, OnInit, DoChec return " uiValue=" + v.toString() + ""; } + private get uitextParamInput(): string { + return this.intlService.localizeText("INFO_SAISIEPARAM_TITRE"); + } + ngOnInit() { // retrieve parameter from symbol this._paramDef = this.paramService.getParameter(this._computeNode, this._paramSymbol); diff --git a/src/app/components/remous-results/remous-results.component.html b/src/app/components/remous-results/remous-results.component.html index 5b8eb55f0..d08c8bb81 100644 --- a/src/app/components/remous-results/remous-results.component.html +++ b/src/app/components/remous-results/remous-results.component.html @@ -8,7 +8,7 @@ <table style="float: left"> <thead> <tr> - <th>Journal de calcul</th> + <th>{{uitextTitreJournal}}</th> </tr> </thead> <tr *ngFor="let r of _logEntries"> @@ -21,16 +21,16 @@ <thead> <tr> <th></th> - <th>Ligne d'eau fluviale</th> + <th>{{uitextLigneFluviale}}</th> <th></th> - <th>Ligne d'eau torrentielle</th> + <th>{{uitextLigneTorrentielle}}</th> <th></th> </tr> <tr> - <th>Abscisse (m)</th> - <th>Tirant d'eau (m)</th> + <th>{{uitextAbscisse}}</th> + <th>{{uitextTirant}}</th> <th>{{_extraParamLabel}}</th> - <th>Tirant d'eau (m)</th> + <th>{{uitextTirant}}</th> <th>{{_extraParamLabel}}</th> </tr> </thead> diff --git a/src/app/components/remous-results/remous-results.component.ts b/src/app/components/remous-results/remous-results.component.ts index c3dda2a70..7887f4c62 100644 --- a/src/app/components/remous-results/remous-results.component.ts +++ b/src/app/components/remous-results/remous-results.component.ts @@ -74,44 +74,14 @@ export class RemousResultsComponent { */ private graph1_type = 'line'; private graph1_data = {}; - private graph1_options = { - responsive: true, - maintainAspectRatio: true, - animation: { - duration: 0 - }, - legend: { - display: true, - position: "right" - }, - title: { - display: true, - text: "Abscisse (m)", - position: "bottom" - } - }; + private graph1_options = {}; /* * config du graphe secondaire (paramètre supplémentaire sauf Hs, Hsc, Yf, Yt, Yco) */ private graph2_type = 'line'; private graph2_data = {}; - private graph2_options = { - responsive: true, - maintainAspectRatio: true, - animation: { - duration: 0 - }, - legend: { - display: true, - position: "right" - }, - title: { - display: true, - text: "Abscisse (m)", - position: "bottom" - } - }; + private graph2_options = {}; /** * le paramètre supplémentaire est affiché dans un graphe séparé @@ -121,6 +91,42 @@ export class RemousResultsComponent { constructor(private intlService: InternationalisationService) { } + private get uitextTitreJournal() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_TITREJOURNAL") + } + + private get uitextLigneFluviale() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_LIGNEFLUVIALE") + } + + private get uitextLigneTorrentielle() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_LIGNETORRENTIELLE") + } + + private get uitextAbscisse() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_ABSCISSE") + } + + private get uitextTirant() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_TIRANT") + } + + private get uitextFond() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_FOND") + } + + private get uitextBerge() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_BERGE") + } + + private get uitextTirantNormal() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_TIRANTNORMAL") + } + + private get uitextTirantCritique() { + return this.intlService.localizeText("INFO_REMOUSRESULTS_TIRANTCRITIQUE") + } + public reset() { this._results = []; this._logEntries = []; @@ -232,16 +238,16 @@ export class RemousResultsComponent { } // ligne de fond - ds1.push(this.drawLine(0, 0, "#753F00", "Fond", "#753F00")); + ds1.push(this.drawLine(0, 0, "#753F00", this.uitextFond, "#753F00")); // ligne de berge - ds1.push(this.drawLine(this._hautBerge, this._hautBerge, "#C58F50", "Berge")); + ds1.push(this.drawLine(this._hautBerge, this._hautBerge, "#C58F50", this.uitextBerge)); // hauteur normale - ds1.push(this.drawLine(this._hautNormale, this._hautNormale, "#A4C537", "Tirant d'eau normal")); + ds1.push(this.drawLine(this._hautNormale, this._hautNormale, "#A4C537", this.uitextTirantNormal)); // hauteur critique - ds1.push(this.drawLine(this._hautCritique, this._hautCritique, "#FF0000", "Tirant d'eau critique")); + ds1.push(this.drawLine(this._hautCritique, this._hautCritique, "#FF0000", this.uitextTirantCritique)); // lignes d'eau torrentielle et fluviale @@ -267,10 +273,13 @@ export class RemousResultsComponent { if (yExtra != "") dataExtra.push({ "x": x, "y": this._extraGraph ? +yExtra : this.mapY(x, +yExtra) }); } - if (this._extraGraph) - ds2.push({ label: this._extraParamLabel, data: dataExtra, tension: 0, borderColor: "#0093BD", pointRadius: 5 }); - else - ds1.push({ label: this._extraParamLabel, data: dataExtra, tension: 0, borderColor: "#C17AF0", pointRadius: 5 }); + + if (dataExtra.length != 0) { + if (this._extraGraph) + ds2.push({ label: this._extraParamLabel, data: dataExtra, tension: 0, borderColor: "#0093BD", pointRadius: 5 }); + else + ds1.push({ label: this._extraParamLabel, data: dataExtra, tension: 0, borderColor: "#C17AF0", pointRadius: 5 }); + } // raccordement ligne fluviale -> torrentielle pour dessiner le ressaut @@ -278,19 +287,54 @@ export class RemousResultsComponent { // ajout des données au graphique - ds1.push({ label: "Ligne d'eau torrentielle", data: dataTor, tension: 0, borderColor: "#77A3CD", pointRadius: 5, backgroundColor: "#D1D0D4" }); - ds1.push({ label: "Ligne d'eau fluviale", data: dataFlu, tension: 0, borderColor: "#0093BD", pointRadius: 5, backgroundColor: "#D1D0D4" }); + ds1.push({ label: this.uitextLigneTorrentielle, data: dataTor, tension: 0, borderColor: "#77A3CD", pointRadius: 5, backgroundColor: "#D1D0D4" }); + ds1.push({ label: this.uitextLigneFluviale, data: dataFlu, tension: 0, borderColor: "#0093BD", pointRadius: 5, backgroundColor: "#D1D0D4" }); this.graph1_data = { labels: labs1, datasets: ds1 }; - if (this._extraGraph) + this.graph1_options = { + responsive: true, + maintainAspectRatio: true, + animation: { + duration: 0 + }, + legend: { + display: true, + position: "right" + }, + title: { + display: true, + text: this.uitextAbscisse, + position: "bottom" + } + }; + + if (this._extraGraph) { this.graph2_data = { labels: labs2, datasets: ds2 }; + + this.graph2_options = { + responsive: true, + maintainAspectRatio: true, + animation: { + duration: 0 + }, + legend: { + display: true, + position: "right" + }, + title: { + display: true, + text: this.uitextAbscisse, + position: "bottom" + } + }; + } } public addResult(x: string, flu: string, tor: string, extra: string) { diff --git a/src/app/i18n-providers.ts b/src/app/i18n-providers.ts deleted file mode 100644 index 6a4dfa8fb..000000000 --- a/src/app/i18n-providers.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy } from '@angular/core'; -import { CompilerConfig } from '@angular/compiler'; - -export function getTranslationProviders(): Promise<Object[]> { - - // Get the locale id from the global - // const locale = localStorage.getItem('localeId'); - const locale = document['locale'] as string; - - // return no providers if fail to get translation file for locale - const noProviders: Object[] = []; - - // No locale or French: no translation providers - if (!locale || locale === 'fr-FR' || locale === 'fr') { - return Promise.resolve(noProviders); - } - - // Ex: 'locale/messages.es.xlf` - const translationFile = `./locale/messages.${locale}.xlf`; - - return getTranslationsWithSystemJs(translationFile) - .then((translations: string) => [ - { provide: TRANSLATIONS, useValue: translations }, - { provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }, - { provide: LOCALE_ID, useValue: locale }, - { provide: CompilerConfig, useValue: new CompilerConfig({ missingTranslation: MissingTranslationStrategy.Error }) } - ]) - .catch(() => noProviders); // ignore if file not found -} - -declare var System: any; - -function getTranslationsWithSystemJs(file: string) { - return System.import(file + '!text'); // relies on text plugin -} diff --git a/src/app/services/internationalisation/internationalisation.service.ts b/src/app/services/internationalisation/internationalisation.service.ts index c1a2ffc6b..6668a1714 100644 --- a/src/app/services/internationalisation/internationalisation.service.ts +++ b/src/app/services/internationalisation/internationalisation.service.ts @@ -152,4 +152,15 @@ export class InternationalisationService extends Observable { return m; } + + /** + * Traduit un texte défini dans les fichiers error_message.xx.json + * Les ids dans ces fichiers sont soit un enum de JalHyd, soit une chaine libre correspondant au code passé à localizeText() + * @param code id du texte + */ + public localizeText(code: string) { + if (this._Messages == undefined) + return "<messages not loaded>"; + return this._Messages[code]; + } } diff --git a/src/locale/error_messages.en.json b/src/locale/error_messages.en.json index 5c90d9e4b..0db056345 100644 --- a/src/locale/error_messages.en.json +++ b/src/locale/error_messages.en.json @@ -27,5 +27,46 @@ "ERROR_REMOUS_RESSAUT_HYDRO": "Hydraulic jump detected between abscissa %xmin% and %xmax% m", "ERROR_REMOUS_PENTE_FORTE": "The water line slope is too steep at abscissa %x% m (the discretisation step should be reduced)", "ERROR_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Downstream boundary condition < Critical elevation : no possible calculation from downstream", - "ERROR_REMOUS_PAS_CALCUL_DEPUIS_AMONT": "Upstream boundary condition < Critical elevation : no possible calculation from upstream" + "ERROR_REMOUS_PAS_CALCUL_DEPUIS_AMONT": "Upstream boundary condition < Critical elevation : no possible calculation from upstream", + "INFO_SAISIEPARAM_TITRE": "Parameter input", + "INFO_PARAMFIELD_PARAMFIXE": "Fixed", + "INFO_PARAMFIELD_PARAMVARIER": "Vary", + "INFO_PARAMFIELD_PARAMCALCULER": "Calculate", + "INFO_PARAMFIELD_VALEURMINI": "From minimum value", + "INFO_PARAMFIELD_VALEURMAXI": "to maximum value", + "INFO_PARAMFIELD_PASVARIATION": "with a variation step of :", + "INFO_CALCULATOR_CALCULER": "Compute", + "INFO_CALCULATOR_PARAMFIXES": "Fixed parameters", + "INFO_CALCULATOR_VALEURS": "Values", + "INFO_CONDDISTRI_TITRE": "Distributor pipe", + "INFO_LECHAPT_TITRE": "Lechapt-Calmon", + "INFO_REGUNI_TITRE": "Uniform flow calculation", + "INFO_SECTPARAM_TITRE": "Parametric section", + "INFO_GRANDEUR_HS": "Specific head (m)", + "INFO_GRANDEUR_HSC": "Critical head (m)", + "INFO_GRANDEUR_B": "Surface width (m)", + "INFO_GRANDEUR_P": "Wetted perimeter (m)", + "INFO_GRANDEUR_S": "Wetted area (m2)", + "INFO_GRANDEUR_R": "Hydraulic radius (m)", + "INFO_GRANDEUR_V": "Average speed (m/s)", + "INFO_GRANDEUR_FR": "Froude number", + "INFO_GRANDEUR_YC": "Critical depth (m)", + "INFO_GRANDEUR_YN": "Normal depth (m)", + "INFO_GRANDEUR_YF": "Subcritical depth (m)", + "INFO_GRANDEUR_YT": "Supercritical depth (m)", + "INFO_GRANDEUR_YCO": "Conjugate depth (m)", + "INFO_GRANDEUR_J": "Head loss (m)", + "INFO_GRANDEUR_I-J": "Linear variation of specific head (m/m)", + "INFO_GRANDEUR_IMP": "Impulse (N)", + "INFO_GRANDEUR_TAU0": "Tractive force (Pa)", + "INFO_REMOUS_TITRE": "Backwater curves", + "INFO_REMOUSRESULTS_TITREJOURNAL": "Calculation log", + "INFO_REMOUSRESULTS_LIGNEFLUVIALE": "Subcritical water profile", + "INFO_REMOUSRESULTS_LIGNETORRENTIELLE": "Supercritical water profile", + "INFO_REMOUSRESULTS_ABSCISSE": "Abscissa (m)", + "INFO_REMOUSRESULTS_TIRANT": "Draft (m)", + "INFO_REMOUSRESULTS_FOND": "Bottom", + "INFO_REMOUSRESULTS_BERGE": "Embankment", + "INFO_REMOUSRESULTS_TIRANTNORMAL": "Normal water level", + "INFO_REMOUSRESULTS_TIRANTCRITIQUE": "Critical water level" } \ No newline at end of file diff --git a/src/locale/error_messages.fr.json b/src/locale/error_messages.fr.json index dd42ef85a..8a77498a0 100644 --- a/src/locale/error_messages.fr.json +++ b/src/locale/error_messages.fr.json @@ -29,9 +29,50 @@ "ERROR_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Condition limite aval < Hauteur critique: pas de calcul possible depuis l'aval", "ERROR_REMOUS_PAS_CALCUL_DEPUIS_AMONT": "Condition limite amont > Hauteur critique : pas de calcul possible depuis l'amont", "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCRITIQUE": "Non convergence du calcul de la hauteur critique (Méthode de Newton)", - "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HNORMALE":"Non convergence du calcul de la hauteur normale (Méthode de Newton)", - "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG":"Non convergence du calcul de la hauteur conjuguée (Méthode de Newton)", - "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HFLU":"Non convergence du calcul de la hauteur correspondante (Méthode de Newton) pour le calcul de la hauteur fluviale", - "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HTOR":"Non convergence du calcul de la hauteur correspondante (Méthode de Newton) pour le calcul de la hauteur torrentielle", - "ERROR_SECTION_PENTE_NEG_NULLE_HNORMALE_INF":"La pente est négative ou nulle, la hauteur normale est infinie" -} + "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HNORMALE": "Non convergence du calcul de la hauteur normale (Méthode de Newton)", + "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG": "Non convergence du calcul de la hauteur conjuguée (Méthode de Newton)", + "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HFLU": "Non convergence du calcul de la hauteur correspondante (Méthode de Newton) pour le calcul de la hauteur fluviale", + "ERROR_SECTION_NON_CONVERGENCE_NEWTON_HTOR": "Non convergence du calcul de la hauteur correspondante (Méthode de Newton) pour le calcul de la hauteur torrentielle", + "ERROR_SECTION_PENTE_NEG_NULLE_HNORMALE_INF": "La pente est négative ou nulle, la hauteur normale est infinie", + "INFO_SAISIEPARAM_TITRE": "Saisie de paramètre", + "INFO_PARAMFIELD_PARAMFIXE": "fixé", + "INFO_PARAMFIELD_PARAMVARIER": "varier", + "INFO_PARAMFIELD_PARAMCALCULER": "calculer", + "INFO_PARAMFIELD_VALEURMINI": "De la valeur minimum", + "INFO_PARAMFIELD_VALEURMAXI": "à la valeur maximum", + "INFO_PARAMFIELD_PASVARIATION": "avec un pas de :", + "INFO_CALCULATOR_PARAMFIXES": "Paramètres fixés", + "INFO_CALCULATOR_VALEURS": "Valeurs", + "INFO_CALCULATOR_CALCULER": "Calculer", + "INFO_CONDDISTRI_TITRE": "Conduite distributrice", + "INFO_LECHAPT_TITRE": "Lechapt-Calmon", + "INFO_REGUNI_TITRE": "Régime uniforme", + "INFO_SECTPARAM_TITRE": "Section paramétrée", + "INFO_GRANDEUR_HS": "La charge spécifique (m)", + "INFO_GRANDEUR_HSC": "La charge critique (m)", + "INFO_GRANDEUR_B": "La largeur au miroir (m)", + "INFO_GRANDEUR_P": "Le périmètre mouillé (m)", + "INFO_GRANDEUR_S": "La surface mouillée (m2)", + "INFO_GRANDEUR_R": "Le rayon hydraulique (m)", + "INFO_GRANDEUR_V": "La vitesse moyenne (m/s)", + "INFO_GRANDEUR_FR": "Le Froude", + "INFO_GRANDEUR_YC": "Le tirant d'eau critique (m)", + "INFO_GRANDEUR_YN": "Le tirant d'eau normal (m)", + "INFO_GRANDEUR_YF": "Le tirant d'eau fluvial (m)", + "INFO_GRANDEUR_YT": "Le tirant d'eau torrentiel (m)", + "INFO_GRANDEUR_YCO": "Le tirant d'eau conjugué (m)", + "INFO_GRANDEUR_J": "La perte de charge (m)", + "INFO_GRANDEUR_I-J": "Variation linéaire de l'énergie spécifique (m/m)", + "INFO_GRANDEUR_IMP": "Impulsion (N)", + "INFO_GRANDEUR_TAU0": "La force tractrice (Pa)", + "INFO_REMOUS_TITRE": "Courbes de remous", + "INFO_REMOUSRESULTS_TITREJOURNAL": "Journal de calcul", + "INFO_REMOUSRESULTS_LIGNEFLUVIALE": "Ligne d'eau fluviale", + "INFO_REMOUSRESULTS_LIGNETORRENTIELLE": "Ligne d'eau torrentielle", + "INFO_REMOUSRESULTS_ABSCISSE": "Abscisse (m)", + "INFO_REMOUSRESULTS_TIRANT": "Tirant d'eau (m)", + "INFO_REMOUSRESULTS_FOND": "Fond", + "INFO_REMOUSRESULTS_BERGE": "Berge", + "INFO_REMOUSRESULTS_TIRANTNORMAL": "Tirant d'eau normal", + "INFO_REMOUSRESULTS_TIRANTCRITIQUE": "Tirant d'eau critique" +} \ No newline at end of file diff --git a/src/locale/messages.en.xlf b/src/locale/messages.en.xlf deleted file mode 100644 index ecb1ebb65..000000000 --- a/src/locale/messages.en.xlf +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> - <file source-language="en" datatype="plaintext" original="ng2.template"> - <body> - <trans-unit id="titre_saisie_param" datatype="html"> - <target>Parameter input</target> - </trans-unit> - <trans-unit id="titre_cond_distri" datatype="html"> - <target>Distributor pipe</target> - </trans-unit> - <trans-unit id="radio_param_header_fix" datatype="html"> - <target>Fixed</target> - </trans-unit> - <trans-unit id="radio_param_header_var" datatype="html"> - <target>Vary</target> - </trans-unit> - <trans-unit id="radio_param_header_cal" datatype="html"> - <target>Calculate</target> - </trans-unit> - <trans-unit id="hyd_compute" datatype="html"> - <target>Compute</target> - </trans-unit> - </body> - </file> -</xliff> diff --git a/src/main.ts b/src/main.ts index d58d8c33d..311c44b76 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,5 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { getTranslationProviders } from './app/i18n-providers'; import { AppModule } from './app/app.module'; -//platformBrowserDynamic().bootstrapModule(AppModule); -getTranslationProviders().then(providers => { - const options = { providers }; - platformBrowserDynamic().bootstrapModule(AppModule, options); -}); +platformBrowserDynamic().bootstrapModule(AppModule); -- GitLab