fix(storefront): replace hardcoded strings with i18n, neutral empty-state wording
- Route aria-label/alt/title strings (rating, discount, carousel arrows, hero slides, dialog close, toast dismiss, QR code, bank payment iframe, guest checkout fallback) through the translate pipe/service instead of literal English. - Drop the "Oops!"/"Упс!" apology framing from category/subcategory empty states (en/ru/hy) - zero results is not an error.
This commit is contained in:
@@ -2,13 +2,14 @@ import { CommonModule } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnDestroy, Output, SimpleChanges, computed, signal } from '@angular/core';
|
||||
import { SectionConfig } from '../../shared/models/config';
|
||||
import { HeroSlideData, HeroWidgetData } from '../contracts/widget-data.contract';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
|
||||
const AUTOPLAY_INTERVAL_MS = 5000;
|
||||
|
||||
@Component({
|
||||
selector: 'app-hero-widget',
|
||||
standalone: true,
|
||||
imports: [CommonModule],
|
||||
imports: [CommonModule, TranslatePipe],
|
||||
template: `
|
||||
<section class="hero-widget">
|
||||
@if (activeSlide(); as slide) {
|
||||
@@ -21,7 +22,7 @@ const AUTOPLAY_INTERVAL_MS = 5000;
|
||||
}
|
||||
|
||||
@if (allSlides().length > 1) {
|
||||
<div class="hero-widget__dots" role="tablist" aria-label="Slides">
|
||||
<div class="hero-widget__dots" role="tablist" [attr.aria-label]="'common.slidesLabel' | translate">
|
||||
@for (dot of allSlides(); track $index) {
|
||||
<button
|
||||
type="button"
|
||||
@@ -29,7 +30,7 @@ const AUTOPLAY_INTERVAL_MS = 5000;
|
||||
[class.hero-widget__dot--active]="$index === activeIndex()"
|
||||
role="tab"
|
||||
[attr.aria-selected]="$index === activeIndex()"
|
||||
[attr.aria-label]="'Slide ' + ($index + 1)"
|
||||
[attr.aria-label]="'common.slideLabel' | translate:{ value: $index + 1 }"
|
||||
(click)="goTo($index)"
|
||||
></button>
|
||||
}
|
||||
|
||||
@@ -3,11 +3,12 @@ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Ou
|
||||
import { SectionConfig } from '../../shared/models/config';
|
||||
import { CatalogProductGridComponent } from '../../features/website/catalog/components/product-grid/product-grid.component';
|
||||
import { ProductCollectionWidgetData } from '../contracts/widget-data.contract';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-product-carousel-widget',
|
||||
standalone: true,
|
||||
imports: [CommonModule, CatalogProductGridComponent],
|
||||
imports: [CommonModule, CatalogProductGridComponent, TranslatePipe],
|
||||
template: `
|
||||
<section class="product-carousel-widget">
|
||||
@if (data?.title) {
|
||||
@@ -20,7 +21,7 @@ import { ProductCollectionWidgetData } from '../contracts/widget-data.contract';
|
||||
<button
|
||||
type="button"
|
||||
class="product-carousel-widget__arrow product-carousel-widget__arrow--prev"
|
||||
aria-label="Previous products"
|
||||
[attr.aria-label]="'common.previousProducts' | translate"
|
||||
[disabled]="atStart()"
|
||||
(click)="scrollBy(-1)"
|
||||
>←</button>
|
||||
@@ -32,7 +33,7 @@ import { ProductCollectionWidgetData } from '../contracts/widget-data.contract';
|
||||
<button
|
||||
type="button"
|
||||
class="product-carousel-widget__arrow product-carousel-widget__arrow--next"
|
||||
aria-label="Next products"
|
||||
[attr.aria-label]="'common.nextProducts' | translate"
|
||||
[disabled]="atEnd()"
|
||||
(click)="scrollBy(1)"
|
||||
>→</button>
|
||||
|
||||
Reference in New Issue
Block a user