Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing translations #75

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/app/_components/cart-overlay/cart-overlay.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class CartOverlayComponent implements OnInit, OnDestroy {
autoFocus: false,
});
} else {
this.snackBar.open('Métadonnée indisponible pour le moment.', 'Fermer', {duration: 3000});
this.snackBar.open($localize`Métadonnée indisponible pour le moment.`, 'Fermer', {duration: 3000});
}
});
}
Expand All @@ -111,8 +111,7 @@ export class CartOverlayComponent implements OnInit, OnDestroy {
let dialogRef: MatDialogRef<ConfirmDialogComponent> | null = this.dialog.open(ConfirmDialogComponent, {
disableClose: false,
});

dialogRef.componentInstance.confirmMessage = 'Voulez-vous supprimer le panier (remise à zéro) ?';
dialogRef.componentInstance.confirmMessage = $localize`Voulez-vous supprimer le panier (remise à zéro) ?`;
dialogRef.afterClosed().subscribe(result => {
if (result) {
this.store.dispatch(fromCart.deleteOrder());
Expand Down
4 changes: 2 additions & 2 deletions src/app/_services/api-order.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class ApiOrderService {
}).pipe(
map(() => {
this.snackBar.open(
'Décision soumise avec succès', 'Ok', {
$localize`Décision soumise avec succès`, 'Ok', {
panelClass: 'notification-info'
}
);
Expand Down Expand Up @@ -235,7 +235,7 @@ export class ApiOrderService {
.pipe(
map(() => {
this.snackBar.open(
'Commande passée avec succès! Vous recevrez un email lorsque tous les téléchargements seront prêts.', 'Ok', {
$localize`Commande passée avec succès! Vous recevrez un email lorsque tous les téléchargements seront prêts.`, 'Ok', {
panelClass: 'notification-info'
}
);
Expand Down
3 changes: 3 additions & 0 deletions src/app/_services/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ export class MapService {

private addSingleFeatureToDrawingSource(features: FeatureLike[], sourceName: string): boolean {
if (!sourceName.endsWith('kml') || features.length === 0) {
// TODO: Translate???
this.snackBar.open(`Le fichier "${sourceName}" ne contient aucune donnée exploitable.
Le format supporté est le "kml".`, 'Ok', {
panelClass: 'notification-info'
Expand All @@ -478,6 +479,7 @@ export class MapService {
}

if (features.length > 1) {
// TODO: Translate???
this.snackBar.open(`Le fichier "${sourceName}" contient plusieurs géométries.
Un seul polygone sera affiché ici.`, 'Ok', {
panelClass: 'notification-info'
Expand Down Expand Up @@ -641,6 +643,7 @@ export class MapService {
}

private displayAreaMessage(area: string) {
// TODO: Translate???
this.snackBarRef = this.snackBar.open(`L'aire du polygone sélectionné est de ${area}`, 'Cancel', {
duration: 5000,
panelClass: 'primary-container'
Expand Down
8 changes: 4 additions & 4 deletions src/app/_store/auth/auth.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export class AuthEffects {
) :
of(LoginActions.refreshTokenFailure({
error: {
detail: 'Utilisateur non connecté'
detail: $localize`Utilisateur non connecté`
},
message: 'Utilisateur non connecté',
message: $localize`Utilisateur non connecté`,
name: '',
status: 401
}));
Expand All @@ -91,10 +91,10 @@ export class AuthEffects {
let dialogRef: MatDialogRef<ConfirmDialogComponent> | null = this.dialog.open(ConfirmDialogComponent, {
disableClose: false,
});

// TODO: Translate???
dialogRef.componentInstance.noButtonTitle = 'Ignorer';
dialogRef.componentInstance.yesButtonTitle = 'Recharger';
dialogRef.componentInstance.confirmMessage = `
dialogRef.componentInstance.confirmMessage = $localize`
Vous aviez une commande non finalisée dans votre panier la dernière fois que vous vous êtes déconnecté,
voulez-vous la recharger?`;
dialogRef.afterClosed().subscribe(result => {
Expand Down
7 changes: 7 additions & 0 deletions src/app/account/new-order/new-order.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<!-- Search -->
<mat-form-field style="flex:0.4;">
<input matInput
i18n-placeholder
placeholder="Rechercher dans mes contacts"
aria-label="Rechercher dans mes contacts"
[matAutocomplete]="auto"
Expand All @@ -104,6 +105,7 @@
</mat-form-field>
<button class="autocomplete-action-button"
mat-mini-fab
i18n-matTooltip
matTooltip="Créer un nouveau contact"
aria-label="Créer un nouveau contact"
color="primary"
Expand All @@ -112,6 +114,7 @@
</button>
<button class="autocomplete-action-button"
mat-mini-fab
i18n-matTooltip
matTooltip="Annuler les changements"
aria-label="Annuler les changements"
color="primary"
Expand All @@ -121,6 +124,7 @@
</button>
<button class="autocomplete-action-button"
mat-mini-fab
i18n-matTooltip
matTooltip="Supprimer ce contact"
aria-label="Supprimer ce contact"
color="warn"
Expand All @@ -139,6 +143,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Prénom">
<mat-error *ngIf="contactFormGroup?.get('first_name')?.hasError('required')">{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -150,6 +155,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Nom">
<mat-error *ngIf="contactFormGroup?.get('last_name')?.hasError('required')">{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -169,6 +175,7 @@
autofocus
spellcheck="false"
matInput
i18n-placeholder
placeholder="Société">
</mat-form-field>

Expand Down
7 changes: 4 additions & 3 deletions src/app/account/new-order/new-order.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,11 @@ export class NewOrderComponent implements OnInit, OnDestroy {
}

public getLocalizedTypeName(type: IOrderType): string {
switch (type.name) {
case 'Privé':
console.log(type.name.toLocaleLowerCase());
switch (type.id) {
case 0:
return ConstantsService.ORDER_NAME.PRIVATE;
case 'Public':
case 1:
return ConstantsService.ORDER_NAME.PUBLIC;
};
return type.name;
Expand Down
2 changes: 1 addition & 1 deletion src/app/account/orders/order/order.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class OrderComponent implements OnInit {
}
this.storeService.addOrderToStore(new Order(copy));
this.snackBar.open(
'La commande a été dupliquée dans votre panier.', 'Ok', {
$localize`La commande a été dupliquée dans votre panier.`, 'Ok', {
panelClass: 'notification-info',
duration: 5000,
}
Expand Down
11 changes: 11 additions & 0 deletions src/app/account/profile/modify-profile.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Prénom">
<mat-error *ngIf="formModifyUser.get('firstName')?.hasError('required')" >{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -25,6 +26,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Nom">
<mat-error *ngIf="formModifyUser.get('lastName')?.hasError('required')" >{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -36,6 +38,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Courriel">
<mat-error *ngIf="formModifyUser.get('email')?.hasError('required')" >{{ REQUIRED }}</mat-error>
<mat-error *ngIf="formModifyUser.get('email')?.hasError('pattern')">{{ WRONG_EMAIL }</mat-error>
Expand All @@ -47,6 +50,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Téléphone">
<mat-error *ngIf="formModifyUser.get('phone')?.hasError('required')" >{{ REQUIRED }}</mat-error>
<mat-error *ngIf="formModifyUser.get('phone')?.hasError('pattern')">
Expand All @@ -67,6 +71,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Adresse (utilisée pour la facturation)">
<mat-error *ngIf="formModifyUser.get('street')?.hasError('required')" >{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -76,6 +81,7 @@
autofocus
spellcheck="false"
matInput
i18n-placeholder
placeholder="Complément d'adresse">
</mat-form-field>
<mat-form-field color="primary">
Expand All @@ -85,6 +91,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Code postal">
<mat-error *ngIf="formModifyUser.get('postcode')?.hasError('required')" >{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -95,6 +102,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Ville">
<mat-error *ngIf="formModifyUser.get('city')?.hasError('required')" >{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -105,6 +113,7 @@
spellcheck="false"
required
matInput
i18n-placeholder
placeholder="Pays">
<mat-error *ngIf="formModifyUser.get('country')?.hasError('required')" >{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -114,6 +123,7 @@
autofocus
spellcheck="false"
matInput
i18n-placeholder
placeholder="Raison sociale">
</mat-form-field>
<mat-form-field color="primary">
Expand All @@ -122,6 +132,7 @@
autofocus
spellcheck="false"
matInput
i18n-placeholder
placeholder="N° IDE">
<mat-error *ngIf="formModifyUser?.get('ideId')?.hasError('pattern')"i18n="@@profil.bad_IDE_format">Mauvais format du numéro IDE, accepté : CHE-012.345.678</mat-error>
</mat-form-field>
Expand Down
2 changes: 1 addition & 1 deletion src/app/account/profile/modify-profile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ModifyProfileComponent implements OnInit {
onModifyUserSubmit(): void {

if (this.formModifyUser.pristine) {
this.snackBar.open('Vous n\'avez rien modifié !', 'Ok', {panelClass: 'notification-error'});
this.snackBar.open($localize`Vous n\'avez rien modifié !`, 'Ok', {panelClass: 'notification-error'});
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/auth/forget/forget.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<form [formGroup]="form" (ngSubmit)="onSubmit($event)">
<mat-form-field color="accent">
<input type="email" autocapitalize="off" spellcheck="false" id="email"
formControlName="email" required matInput placeholder="Courriel">
formControlName="email" required matInput i18n-placeholder placeholder="Courriel">
<mat-error *ngIf="email?.hasError('required')" i18n="@@auth.required">Requis</mat-error>
<mat-error *ngIf="email?.hasError('pattern')" i18n="@@auth.mail_awaiting">Courriel attendu</mat-error>
</mat-form-field>
Expand Down
2 changes: 1 addition & 1 deletion src/app/auth/forget/forget.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ForgetComponent implements OnInit {

@HostBinding('class') class = 'main-container';

private readonly successMessage = 'Le mot de passe a été envoyé à l\'adresse : ';
private readonly successMessage = $localize`Le mot de passe a été envoyé à l\'adresse : `;
form: UntypedFormGroup;

get email() {
Expand Down
1 change: 1 addition & 0 deletions src/app/auth/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<mat-form-field color="primary">
<input formControlName="password" autocapitalize="off" autocomplete="off" spellcheck="false"
required matInput
i18n-placeholder
placeholder="Mot de passe" type="password">
<mat-error *ngIf="password?.hasError('required')">{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand Down
2 changes: 2 additions & 0 deletions src/app/auth/reset/reset.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<mat-form-field color="accent">
<input formControlName="password" autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="off"
required matInput
i18n-placeholder
placeholder="Mot de passe" type="password">
<mat-error *ngIf="password?.hasError('required')">{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand All @@ -17,6 +18,7 @@
<input formControlName="passwordConfirm" autocorrect="off" autocapitalize="off" autocomplete="off"
spellcheck="off"
required matInput
i18n-placeholder
placeholder="Confirmation du mot de passe" type="password">
<mat-error *ngIf="passwordConfirm?.hasError('required')">{{ REQUIRED }}</mat-error>
</mat-form-field>
Expand Down
Loading