diff --git a/frontend/src/app/core/constants/colors.const.ts b/frontend/src/app/core/constants/colors.const.ts index 66b1336..7dde6f2 100644 --- a/frontend/src/app/core/constants/colors.const.ts +++ b/frontend/src/app/core/constants/colors.const.ts @@ -12,22 +12,22 @@ export interface ColorCategory { export const PRODUCT_COLORS: ColorCategory[] = [ { - name: 'Lucidi', // Glossy + name: 'COLOR.CATEGORY_GLOSSY', colors: [ - { label: 'Black', value: 'Black', hex: '#1a1a1a' }, // Not pure black for visibility - { label: 'White', value: 'White', hex: '#f5f5f5' }, - { label: 'Red', value: 'Red', hex: '#d32f2f', outOfStock: true }, - { label: 'Blue', value: 'Blue', hex: '#1976d2' }, - { label: 'Green', value: 'Green', hex: '#388e3c' }, - { label: 'Yellow', value: 'Yellow', hex: '#fbc02d' } + { label: 'COLOR.NAME.BLACK', value: 'Black', hex: '#1a1a1a' }, // Not pure black for visibility + { label: 'COLOR.NAME.WHITE', value: 'White', hex: '#f5f5f5' }, + { label: 'COLOR.NAME.RED', value: 'Red', hex: '#d32f2f', outOfStock: true }, + { label: 'COLOR.NAME.BLUE', value: 'Blue', hex: '#1976d2' }, + { label: 'COLOR.NAME.GREEN', value: 'Green', hex: '#388e3c' }, + { label: 'COLOR.NAME.YELLOW', value: 'Yellow', hex: '#fbc02d' } ] }, { - name: 'Opachi', // Matte + name: 'COLOR.CATEGORY_MATTE', colors: [ - { label: 'Matte Black', value: 'Matte Black', hex: '#2c2c2c' }, // Lighter charcoal for matte - { label: 'Matte White', value: 'Matte White', hex: '#e0e0e0' }, - { label: 'Matte Gray', value: 'Matte Gray', hex: '#757575' } + { label: 'COLOR.NAME.MATTE_BLACK', value: 'Matte Black', hex: '#2c2c2c' }, // Lighter charcoal for matte + { label: 'COLOR.NAME.MATTE_WHITE', value: 'Matte White', hex: '#e0e0e0' }, + { label: 'COLOR.NAME.MATTE_GRAY', value: 'Matte Gray', hex: '#757575' } ] } ]; diff --git a/frontend/src/app/features/about/about-page.component.html b/frontend/src/app/features/about/about-page.component.html index 20e8f97..5672ff1 100644 --- a/frontend/src/app/features/about/about-page.component.html +++ b/frontend/src/app/features/about/about-page.component.html @@ -40,11 +40,11 @@ (keydown.space)="toggleSelectedMember('joe'); $event.preventDefault()" >
- Joe Küng +
- Joe Küng - Studente Ingegneria Informatica + {{ 'ABOUT.MEMBER_JOE_NAME' | translate }} + {{ 'ABOUT.MEMBER_JOE_ROLE' | translate }}
- Matteo Caletti +
- Matteo Caletti - Studente Ingegneria Elettronica + {{ 'ABOUT.MEMBER_MATTEO_NAME' | translate }} + {{ 'ABOUT.MEMBER_MATTEO_ROLE' | translate }}
diff --git a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html index e6a9ff3..bc8da94 100644 --- a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html +++ b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.html @@ -20,8 +20,8 @@ @if (items().length === 0) { @@ -60,7 +60,11 @@ - diff --git a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts index e48d97b..c1f0ed2 100644 --- a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts +++ b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts @@ -1,7 +1,7 @@ import { Component, input, output, signal, OnInit, inject } 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 { AppSelectComponent } from '../../../../shared/components/app-select/app-select.component'; import { AppDropzoneComponent } from '../../../../shared/components/app-dropzone/app-dropzone.component'; @@ -32,6 +32,7 @@ export class UploadFormComponent implements OnInit { private estimator = inject(QuoteEstimatorService); private fb = inject(FormBuilder); + private translate = inject(TranslateService); form: FormGroup; @@ -127,8 +128,8 @@ export class UploadFormComponent implements OnInit { error: (err) => { console.error('Failed to load options', err); // Fallback for debugging/offline dev - this.materials.set([{ label: 'PLA (Fallback)', value: 'PLA' }]); - this.qualities.set([{ label: 'Standard', value: 'standard' }]); + this.materials.set([{ label: this.translate.instant('CALC.FALLBACK_MATERIAL'), value: 'PLA' }]); + this.qualities.set([{ label: this.translate.instant('CALC.FALLBACK_QUALITY_STANDARD'), value: 'standard' }]); this.nozzleDiameters.set([{ label: '0.4 mm', value: 0.4 }]); this.setDefaults(); } @@ -171,7 +172,7 @@ export class UploadFormComponent implements OnInit { } if (hasError) { - alert("Alcuni file superano il limite di 200MB e non sono stati aggiunti."); + alert(this.translate.instant('CALC.ERR_FILE_TOO_LARGE')); } if (validItems.length > 0) { diff --git a/frontend/src/app/features/checkout/checkout.component.ts b/frontend/src/app/features/checkout/checkout.component.ts index 36de38f..06f6288 100644 --- a/frontend/src/app/features/checkout/checkout.component.ts +++ b/frontend/src/app/features/checkout/checkout.component.ts @@ -112,7 +112,7 @@ export class CheckoutComponent implements OnInit { this.route.queryParams.subscribe(params => { this.sessionId = params['session']; if (!this.sessionId) { - this.error = 'No active session found. Please start a new quote.'; + this.error = 'CHECKOUT.ERR_NO_SESSION_START'; this.router.navigate(['/']); // Redirect if no session return; } @@ -143,7 +143,7 @@ export class CheckoutComponent implements OnInit { }, error: (err) => { console.error('Failed to load session', err); - this.error = 'Failed to load session details. Please try again.'; + this.error = 'CHECKOUT.ERR_LOAD_SESSION'; } }); } @@ -196,7 +196,7 @@ export class CheckoutComponent implements OnInit { }; if (!this.sessionId) { - this.error = 'No active session found. Cannot create order.'; + this.error = 'CHECKOUT.ERR_NO_SESSION_CREATE_ORDER'; this.isSubmitting.set(false); return; } @@ -208,7 +208,7 @@ export class CheckoutComponent implements OnInit { error: (err) => { console.error('Order creation failed', err); this.isSubmitting.set(false); - this.error = 'Failed to create order. Please try again.'; + this.error = 'CHECKOUT.ERR_CREATE_ORDER'; } }); } diff --git a/frontend/src/app/features/contact/components/contact-form/contact-form.component.html b/frontend/src/app/features/contact/components/contact-form/contact-form.component.html index bc526d4..6e0964b 100644 --- a/frontend/src/app/features/contact/components/contact-form/contact-form.component.html +++ b/frontend/src/app/features/contact/components/contact-form/contact-form.component.html @@ -61,7 +61,11 @@
- +
diff --git a/frontend/src/app/features/contact/components/contact-form/contact-form.component.ts b/frontend/src/app/features/contact/components/contact-form/contact-form.component.ts index 54f135a..3206cff 100644 --- a/frontend/src/app/features/contact/components/contact-form/contact-form.component.ts +++ b/frontend/src/app/features/contact/components/contact-form/contact-form.component.ts @@ -211,7 +211,7 @@ export class ContactFormComponent implements OnDestroy { }, error: (err) => { console.error('Submission failed', err); - alert('Error submitting request. Please try again.'); + alert(this.translate.instant('CONTACT.ERROR_SUBMIT')); } }); diff --git a/frontend/src/app/features/home/home.component.html b/frontend/src/app/features/home/home.component.html index ed3ffee..e481b74 100644 --- a/frontend/src/app/features/home/home.component.html +++ b/frontend/src/app/features/home/home.component.html @@ -110,9 +110,9 @@ {{ 'HOME.BTN_REQ_SOLUTION' | translate }}
-