diff --git a/src/app/components/product-card/product-card.component.html b/src/app/components/product-card/product-card.component.html
index e499317..ad90796 100644
--- a/src/app/components/product-card/product-card.component.html
+++ b/src/app/components/product-card/product-card.component.html
@@ -6,7 +6,7 @@
-{{ item.discount }}%
}
@if (showStock && item.remainings) {
- {{ item.remainings }}
+ {{ stockLabelKey(item.remainings) | translate }}
}
@if (showFavoriteControl() || showCompareControl() || showShareAction || showQuickViewPlaceholder) {
diff --git a/src/app/components/product-card/product-card.component.ts b/src/app/components/product-card/product-card.component.ts
index d795665..3b2a9bb 100644
--- a/src/app/components/product-card/product-card.component.ts
+++ b/src/app/components/product-card/product-card.component.ts
@@ -6,6 +6,13 @@ import { LangRoutePipe } from '../../pipes/lang-route.pipe';
import { TranslatePipe } from '../../i18n/translate.pipe';
import { getBadgeClass, getDiscountedPrice, getMainImage } from '../../utils/item.utils';
+const STOCK_LABEL_KEYS: Record = {
+ high: 'catalog.stockHigh',
+ medium: 'catalog.stockMedium',
+ low: 'catalog.stockLow',
+ out: 'catalog.stockOut'
+};
+
export type ProductCardAppearance = 'standard' | 'compact';
@Component({
@@ -83,6 +90,10 @@ export class ProductCardComponent {
this.shareRequested.emit(this.item.itemID);
}
+ stockLabelKey(remainings: string): string {
+ return STOCK_LABEL_KEYS[remainings.toLowerCase()] ?? STOCK_LABEL_KEYS['high'];
+ }
+
showFavoriteControl(): boolean {
return this.showFavoriteAction || this.showFavoritePlaceholder;
}
diff --git a/src/app/i18n/en.ts b/src/app/i18n/en.ts
index 493453c..f35262d 100644
--- a/src/app/i18n/en.ts
+++ b/src/app/i18n/en.ts
@@ -261,6 +261,14 @@ export const en: Translations = {
filterColor: 'Color',
filterSize: 'Size',
filterAttributes: 'Attributes',
+ favorite: 'Add to favorites',
+ compare: 'Compare',
+ share: 'Share',
+ quickView: 'Quick view',
+ stockHigh: 'In stock',
+ stockMedium: 'Limited stock',
+ stockLow: 'Almost gone',
+ stockOut: 'Out of stock',
},
productDetails: {
loading: 'Loading product...',
diff --git a/src/app/i18n/hy.ts b/src/app/i18n/hy.ts
index 6d1dd02..710118b 100644
--- a/src/app/i18n/hy.ts
+++ b/src/app/i18n/hy.ts
@@ -261,6 +261,14 @@ export const hy: Translations = {
filterColor: 'Գույն',
filterSize: 'Չափ',
filterAttributes: 'Հատկանիշներ',
+ favorite: 'Ավելացնել ընտրյալներում',
+ compare: 'Համեմատել',
+ share: 'Կիսվել',
+ quickView: 'Արագ դիտում',
+ stockHigh: 'Առկա է',
+ stockMedium: 'Սահմանափակ քանակ',
+ stockLow: 'Գրեթե սպառված է',
+ stockOut: 'Առկա չէ',
},
productDetails: {
loading: 'Ապրանքի բեռնում...',
diff --git a/src/app/i18n/ru.ts b/src/app/i18n/ru.ts
index dff95a1..898e1e2 100644
--- a/src/app/i18n/ru.ts
+++ b/src/app/i18n/ru.ts
@@ -261,6 +261,14 @@ export const ru: Translations = {
filterColor: 'Цвет',
filterSize: 'Размер',
filterAttributes: 'Атрибуты',
+ favorite: 'В избранное',
+ compare: 'Сравнить',
+ share: 'Поделиться',
+ quickView: 'Быстрый просмотр',
+ stockHigh: 'В наличии',
+ stockMedium: 'Ограниченно',
+ stockLow: 'Почти распродано',
+ stockOut: 'Нет в наличии',
},
productDetails: {
loading: 'Загрузка товара...',
diff --git a/src/app/i18n/translations.ts b/src/app/i18n/translations.ts
index 5c463ed..b646c8e 100644
--- a/src/app/i18n/translations.ts
+++ b/src/app/i18n/translations.ts
@@ -259,6 +259,14 @@ export interface Translations {
filterColor: string;
filterSize: string;
filterAttributes: string;
+ favorite: string;
+ compare: string;
+ share: string;
+ quickView: string;
+ stockHigh: string;
+ stockMedium: string;
+ stockLow: string;
+ stockOut: string;
};
productDetails: {
loading: string;