fix(web): traslation error
All checks were successful
Build, Test and Deploy / test-backend (push) Successful in 21s
Build, Test and Deploy / build-and-push (push) Successful in 21s
Build, Test and Deploy / deploy (push) Successful in 7s

This commit is contained in:
2026-02-04 16:31:38 +01:00
parent 810d5f6c0c
commit da8e476485
4 changed files with 16 additions and 8 deletions

View File

@@ -2,8 +2,8 @@ import { ApplicationConfig, provideZoneChangeDetection, importProvidersFrom } fr
import { provideRouter, withComponentInputBinding, withViewTransitions } from '@angular/router'; import { provideRouter, withComponentInputBinding, withViewTransitions } from '@angular/router';
import { routes } from './app.routes'; import { routes } from './app.routes';
import { provideHttpClient } from '@angular/common/http'; import { provideHttpClient } from '@angular/common/http';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { provideTranslateHttpLoader } from '@ngx-translate/http-loader'; import { provideTranslateHttpLoader, TranslateHttpLoader } from '@ngx-translate/http-loader';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [ providers: [
@@ -16,7 +16,11 @@ export const appConfig: ApplicationConfig = {
}), }),
importProvidersFrom( importProvidersFrom(
TranslateModule.forRoot({ TranslateModule.forRoot({
defaultLanguage: 'it' defaultLanguage: 'it',
loader: {
provide: TranslateLoader,
useClass: TranslateHttpLoader
}
}) })
) )
] ]

View File

@@ -1,7 +1,7 @@
import { Component, signal, effect } from '@angular/core'; import { Component, signal, effect } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms'; import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { AppInputComponent } from '../../../../shared/components/app-input/app-input.component'; import { AppInputComponent } from '../../../../shared/components/app-input/app-input.component';
import { AppButtonComponent } from '../../../../shared/components/app-button/app-button.component'; import { AppButtonComponent } from '../../../../shared/components/app-button/app-button.component';
@@ -29,7 +29,7 @@ interface FilePreview {
<div class="row"> <div class="row">
<!-- Phone --> <!-- Phone -->
<app-input formControlName="email" type="email" label="Email *" [placeholder]="'CONTACT.PLACEHOLDER_EMAIL' | translate" class="col"></app-input> <app-input formControlName="email" type="email" [label]="'CONTACT.LABEL_EMAIL' | translate" [placeholder]="'CONTACT.PLACEHOLDER_EMAIL' | translate" class="col"></app-input>
<!-- Phone --> <!-- Phone -->
<app-input formControlName="phone" type="tel" [label]="('CONTACT.PHONE' | translate)" [placeholder]="'CONTACT.PLACEHOLDER_PHONE' | translate" class="col"></app-input> <app-input formControlName="phone" type="tel" [label]="('CONTACT.PHONE' | translate)" [placeholder]="'CONTACT.PLACEHOLDER_PHONE' | translate" class="col"></app-input>
</div> </div>
@@ -45,7 +45,7 @@ interface FilePreview {
</div> </div>
<!-- Personal Name (Only if NOT Company) --> <!-- Personal Name (Only if NOT Company) -->
<app-input *ngIf="!isCompany" formControlName="name" label="Nome *" [placeholder]="'CONTACT.PLACEHOLDER_NAME' | translate"></app-input> <app-input *ngIf="!isCompany" formControlName="name" [label]="'CONTACT.LABEL_NAME' | translate" [placeholder]="'CONTACT.PLACEHOLDER_NAME' | translate"></app-input>
<!-- Company Fields (Only if Company) --> <!-- Company Fields (Only if Company) -->
<div *ngIf="isCompany" class="company-fields"> <div *ngIf="isCompany" class="company-fields">
@@ -242,7 +242,7 @@ export class ContactFormComponent {
{ value: 'question', label: 'CONTACT.REQ_TYPE_QUESTION' } { value: 'question', label: 'CONTACT.REQ_TYPE_QUESTION' }
]; ];
constructor(private fb: FormBuilder) { constructor(private fb: FormBuilder, private translate: TranslateService) {
this.form = this.fb.group({ this.form = this.fb.group({
requestType: ['custom', Validators.required], requestType: ['custom', Validators.required],
name: ['', Validators.required], name: ['', Validators.required],
@@ -302,7 +302,7 @@ export class ContactFormComponent {
handleFiles(newFiles: File[]) { handleFiles(newFiles: File[]) {
const currentFiles = this.files(); const currentFiles = this.files();
if (currentFiles.length + newFiles.length > 15) { if (currentFiles.length + newFiles.length > 15) {
alert("Max 15 files limit reached."); alert(this.translate.instant('CONTACT.ERR_MAX_FILES'));
return; return;
} }

View File

@@ -85,6 +85,8 @@
"PLACEHOLDER_COMPANY": "Company Name", "PLACEHOLDER_COMPANY": "Company Name",
"PLACEHOLDER_REF_PERSON": "Reference Person", "PLACEHOLDER_REF_PERSON": "Reference Person",
"LABEL_MESSAGE": "Message *", "LABEL_MESSAGE": "Message *",
"LABEL_EMAIL": "Email *",
"LABEL_NAME": "Name *",
"MSG_SENT": "Sent!", "MSG_SENT": "Sent!",
"ERR_MAX_FILES": "Max 15 files limit reached." "ERR_MAX_FILES": "Max 15 files limit reached."
} }

View File

@@ -90,6 +90,8 @@
"PLACEHOLDER_COMPANY": "Nome Azienda", "PLACEHOLDER_COMPANY": "Nome Azienda",
"PLACEHOLDER_REF_PERSON": "Persona di Riferimento", "PLACEHOLDER_REF_PERSON": "Persona di Riferimento",
"LABEL_MESSAGE": "Messaggio *", "LABEL_MESSAGE": "Messaggio *",
"LABEL_EMAIL": "Email *",
"LABEL_NAME": "Nome *",
"MSG_SENT": "Inviato!", "MSG_SENT": "Inviato!",
"ERR_MAX_FILES": "Limite massimo di 15 file raggiunto." "ERR_MAX_FILES": "Limite massimo di 15 file raggiunto."
} }