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 { routes } from './app.routes';
import { provideHttpClient } from '@angular/common/http';
import { TranslateModule } from '@ngx-translate/core';
import { provideTranslateHttpLoader } from '@ngx-translate/http-loader';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { provideTranslateHttpLoader, TranslateHttpLoader } from '@ngx-translate/http-loader';
export const appConfig: ApplicationConfig = {
providers: [
@@ -16,7 +16,11 @@ export const appConfig: ApplicationConfig = {
}),
importProvidersFrom(
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 { CommonModule } from '@angular/common';
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 { AppButtonComponent } from '../../../../shared/components/app-button/app-button.component';
@@ -29,7 +29,7 @@ interface FilePreview {
<div class="row">
<!-- 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 -->
<app-input formControlName="phone" type="tel" [label]="('CONTACT.PHONE' | translate)" [placeholder]="'CONTACT.PLACEHOLDER_PHONE' | translate" class="col"></app-input>
</div>
@@ -45,7 +45,7 @@ interface FilePreview {
</div>
<!-- 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) -->
<div *ngIf="isCompany" class="company-fields">
@@ -242,7 +242,7 @@ export class ContactFormComponent {
{ value: 'question', label: 'CONTACT.REQ_TYPE_QUESTION' }
];
constructor(private fb: FormBuilder) {
constructor(private fb: FormBuilder, private translate: TranslateService) {
this.form = this.fb.group({
requestType: ['custom', Validators.required],
name: ['', Validators.required],
@@ -302,7 +302,7 @@ export class ContactFormComponent {
handleFiles(newFiles: File[]) {
const currentFiles = this.files();
if (currentFiles.length + newFiles.length > 15) {
alert("Max 15 files limit reached.");
alert(this.translate.instant('CONTACT.ERR_MAX_FILES'));
return;
}