Internationalisation de la page d'ajout

de sauts
This commit is contained in:
Sébastien André
2021-06-09 15:17:38 +02:00
parent 63c971ed1b
commit a5f8ee390a
4 changed files with 43 additions and 17 deletions

View File

@@ -5,8 +5,6 @@
min-width: 150px; min-width: 150px;
max-width: 500px; max-width: 500px;
width: 100%; width: 100%;
padding: 15px
} }
.content { .content {

View File

@@ -1,12 +1,12 @@
<div class="content"> <div class="content">
<div> <div>
<button mat-raised-button color="accent" [routerLink]="['/jumps']" [routerLinkActive]="['active']" skipLocationChange>View the jumps</button> <button mat-raised-button color="accent" [routerLink]="['/jumps']" [routerLinkActive]="['active']" skipLocationChange>{{ 'NewJump_GoToJump' | translate }}</button>
<p><mat-checkbox [(ngModel)]="resetForm" labelPosition="before">Reset form after adding</mat-checkbox></p> <p><mat-checkbox [(ngModel)]="resetForm" labelPosition="before">{{ 'NewJump_ResetForm' | translate }}</mat-checkbox></p>
</div> </div>
<form class="formNewJumps" (ngSubmit)="onFormSubmit()" *ngIf="notLoadingToDisplay() else loading"> <form class="formNewJumps" (ngSubmit)="onFormSubmit()" *ngIf="notLoadingToDisplay() else loading">
<mat-form-field> <mat-form-field>
<mat-label>Choose the jump type</mat-label> <mat-label>{{ 'NewJump_ChooseJumpType' | translate }}</mat-label>
<input type="text" matInput [matAutocomplete]="autoJumpType" [(ngModel)]="selectedJumpType" <input type="text" matInput [matAutocomplete]="autoJumpType" [(ngModel)]="selectedJumpType"
name="selectedJumpType"> name="selectedJumpType">
<mat-autocomplete #autoJumpType="matAutocomplete" [displayWith]="displayNameFn"> <mat-autocomplete #autoJumpType="matAutocomplete" [displayWith]="displayNameFn">
@@ -21,7 +21,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-label>Choose the aircraft</mat-label> <mat-label>{{ 'NewJump_ChooseAircraft' | translate }}</mat-label>
<input type="text" matInput [matAutocomplete]="autoAircraft" [(ngModel)]="selectedAircraft" <input type="text" matInput [matAutocomplete]="autoAircraft" [(ngModel)]="selectedAircraft"
name="selectedAircraft"> name="selectedAircraft">
<mat-autocomplete #autoAircraft="matAutocomplete" [displayWith]="displayNameFn"> <mat-autocomplete #autoAircraft="matAutocomplete" [displayWith]="displayNameFn">
@@ -36,7 +36,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-label>Choose the DZ</mat-label> <mat-label>{{ 'NewJump_ChooseDz' | translate }}</mat-label>
<input type="text" matInput [matAutocomplete]="autoDropZone" [(ngModel)]="selectedDz" <input type="text" matInput [matAutocomplete]="autoDropZone" [(ngModel)]="selectedDz"
(ngModelChange)="onChangeDz($event)" name="selectedDz"> (ngModelChange)="onChangeDz($event)" name="selectedDz">
<mat-autocomplete #autoDropZone="matAutocomplete" [displayWith]="displayNameFn"> <mat-autocomplete #autoDropZone="matAutocomplete" [displayWith]="displayNameFn">
@@ -52,7 +52,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-label>Choose the used gear</mat-label> <mat-label>{{ 'NewJump_ChooseGear' | translate }}</mat-label>
<input type="text" matInput [matAutocomplete]="autoGear" [(ngModel)]="selectedGear" name="selectedGear"> <input type="text" matInput [matAutocomplete]="autoGear" [(ngModel)]="selectedGear" name="selectedGear">
<mat-autocomplete #autoGear="matAutocomplete" [displayWith]="displayGearFn"> <mat-autocomplete #autoGear="matAutocomplete" [displayWith]="displayGearFn">
<mat-option *ngFor="let gear of listOfGear" [value]="gear"> <mat-option *ngFor="let gear of listOfGear" [value]="gear">
@@ -65,8 +65,8 @@
</button> </button>
</mat-form-field> </mat-form-field>
<mat-checkbox [(ngModel)]="withCutaway" name="withCutaway">With a cutaway ?</mat-checkbox> <mat-checkbox [(ngModel)]="withCutaway" name="withCutaway">{{ 'NewJump_Cutaway' | translate }}</mat-checkbox>
<mat-checkbox [(ngModel)]="isSpecial" name="isSpecial">Is a special jump ?</mat-checkbox> <mat-checkbox [(ngModel)]="isSpecial" name="isSpecial">{{ 'NewJump_Special' | translate }}</mat-checkbox>
<mat-form-field> <mat-form-field>
<input matInput [matDatepicker]="beginDateDp" [(ngModel)]="beginDate" <input matInput [matDatepicker]="beginDateDp" [(ngModel)]="beginDate"
@@ -82,14 +82,14 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Exit altitude" [(ngModel)]="exitAltitude" name="exitAltitude" type="number"> <input matInput placeholder="{{ 'NewJump_ExitAlt' | translate }}" [(ngModel)]="exitAltitude" name="exitAltitude" type="number">
<button mat-button *ngIf="exitAltitude" matSuffix mat-icon-button aria-label="Clear" <button mat-button *ngIf="exitAltitude" matSuffix mat-icon-button aria-label="Clear"
(click)="exitAltitude=undefined"> (click)="exitAltitude=undefined">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Deploy altitude" [(ngModel)]="deployAltitude" name="deployAltitude" type="number"> <input matInput placeholder="{{ 'NewJump_DeployAlt' | translate }}" [(ngModel)]="deployAltitude" name="deployAltitude" type="number">
<button mat-button *ngIf="deployAltitude" matSuffix mat-icon-button aria-label="Clear" <button mat-button *ngIf="deployAltitude" matSuffix mat-icon-button aria-label="Clear"
(click)="deployAltitude=undefined"> (click)="deployAltitude=undefined">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
@@ -97,7 +97,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Count of jumps" [(ngModel)]="countOfJumps" name="countOfJumps" type="number"> <input matInput placeholder="{{ 'NewJump_Count' | translate }}" [(ngModel)]="countOfJumps" name="countOfJumps" type="number">
<button mat-button *ngIf="countOfJumps" matSuffix mat-icon-button aria-label="Clear" <button mat-button *ngIf="countOfJumps" matSuffix mat-icon-button aria-label="Clear"
(click)="countOfJumps=undefined"> (click)="countOfJumps=undefined">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
@@ -105,7 +105,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<textarea matInput placeholder="Comments" [(ngModel)]="comments" name="comments" type="text"></textarea> <textarea matInput placeholder="{{ 'NewJump_Comments' | translate }}" [(ngModel)]="comments" name="comments" type="text"></textarea>
<button mat-button *ngIf="comments" matSuffix mat-icon-button aria-label="Clear" <button mat-button *ngIf="comments" matSuffix mat-icon-button aria-label="Clear"
(click)="comments=undefined"> (click)="comments=undefined">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
@@ -113,7 +113,7 @@
</mat-form-field> </mat-form-field>
<br /> <br />
<button mat-raised-button color="accent" *ngIf="isValidatedForm()">Submit</button> <button mat-raised-button color="accent" *ngIf="isValidatedForm()">{{ 'NewJump_Submit' | translate }}</button>
</form> </form>
<ng-template #loading> <ng-template #loading>

View File

@@ -95,5 +95,19 @@
"Summary_ByAircraft_Title" : "By aircraft", "Summary_ByAircraft_Title" : "By aircraft",
"Summary_ByGear_Title" : "By gear", "Summary_ByGear_Title" : "By gear",
"Summary_ByJumpType_Title" : "By jump type", "Summary_ByJumpType_Title" : "By jump type",
"Summary_ByYear_Title" : "By year" "Summary_ByYear_Title" : "By year",
"NewJump_GoToJump" : "View the jumps",
"NewJump_ResetForm" : "Reset form after adding",
"NewJump_ChooseJumpType" : "Choose the jump type",
"NewJump_ChooseAircraft" : "Choose the aircraft",
"NewJump_ChooseDz" : "Choose the DZ",
"NewJump_ChooseGear" : "Choose the used gear",
"NewJump_Cutaway" : "With a cutaway ?",
"NewJump_Special" : "Is a special jump ?",
"NewJump_ExitAlt" : "Exit altitude",
"NewJump_DeployAlt" : "Deploy altitude",
"NewJump_Count" : "Count of jumps",
"NewJump_Comments" : "Comments",
"NewJump_Submit" : "Submit"
} }

View File

@@ -95,5 +95,19 @@
"Summary_ByAircraft_Title" : "Par avion", "Summary_ByAircraft_Title" : "Par avion",
"Summary_ByGear_Title" : "Par piège", "Summary_ByGear_Title" : "Par piège",
"Summary_ByJumpType_Title" : "Par type de saut", "Summary_ByJumpType_Title" : "Par type de saut",
"Summary_ByYear_Title" : "Par an" "Summary_ByYear_Title" : "Par an",
"NewJump_GoToJump" : "Voir les sauts",
"NewJump_ResetForm" : "Reset du formulaire après l'ajout",
"NewJump_ChooseJumpType" : "Choisir un type de saut",
"NewJump_ChooseAircraft" : "Choisir un avion largueur",
"NewJump_ChooseDz" : "Choisir un centre",
"NewJump_ChooseGear" : "Choisir un piège",
"NewJump_Cutaway" : "Libération ?",
"NewJump_Special" : "Saut spécial ?",
"NewJump_ExitAlt" : "Altitude de sortie",
"NewJump_DeployAlt" : "Altitude d'ouverture",
"NewJump_Count" : "Nombre de sauts",
"NewJump_Comments" : "Commentaires",
"NewJump_Submit" : "Ajouter"
} }