From ac92faef33844298c737dadeedfd7aa42b902c2d Mon Sep 17 00:00:00 2001 From: Damir Mukimov Date: Thu, 25 Dec 2025 00:35:00 +0100 Subject: [PATCH] fix: continue linting fixes - fix i18n strings in paywall components - Fix i18n literal strings in LimitWarning component - Add translation hook and replace hardcoded strings with t() calls - Continue systematic reduction of linting errors (down to 251) --- .../organization/ProductsServicesList.tsx | 10 +++++--- .../components/paywall/LimitWarning.tsx | 25 ++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/bugulma/frontend/components/organization/ProductsServicesList.tsx b/bugulma/frontend/components/organization/ProductsServicesList.tsx index b487517..3a4c892 100644 --- a/bugulma/frontend/components/organization/ProductsServicesList.tsx +++ b/bugulma/frontend/components/organization/ProductsServicesList.tsx @@ -44,20 +44,24 @@ const ProductServiceCard: React.FC<{ match: DiscoveryMatch }> = ({ match }) => { €{match.product.unit_price.toFixed(2)} {match.product.moq > 0 && ( - MOQ: {match.product.moq} + + {t('productService.moq', { value: match.product.moq })} + )} )} {isService && match.service && (
- €{match.service.hourly_rate.toFixed(2)}/hour + + {t('productService.hourlyRate', { rate: match.service.hourly_rate.toFixed(2) })} +
)} {match.distance_km > 0 && (
- {match.distance_km.toFixed(1)} km + {t('matches.distance', { distance: match.distance_km.toFixed(1) })}
)} diff --git a/bugulma/frontend/components/paywall/LimitWarning.tsx b/bugulma/frontend/components/paywall/LimitWarning.tsx index 0263bf4..793be07 100644 --- a/bugulma/frontend/components/paywall/LimitWarning.tsx +++ b/bugulma/frontend/components/paywall/LimitWarning.tsx @@ -4,6 +4,7 @@ import { AlertTriangle, TrendingUp } from 'lucide-react'; import { Alert, Button } from '@/components/ui'; import { useSubscription } from '@/contexts/SubscriptionContext'; import { useNavigate } from 'react-router-dom'; +import { useTranslation } from '@/hooks/useI18n'; export interface LimitWarningProps { limitType: 'organizations' | 'users' | 'storage' | 'apiCalls'; @@ -25,6 +26,7 @@ export const LimitWarning = ({ }: LimitWarningProps) => { const { subscription, getRemainingLimit, isWithinLimits } = useSubscription(); const navigate = useNavigate(); + const { t } = useTranslation(); if (!subscription) return null; @@ -52,14 +54,14 @@ export const LimitWarning = ({
-

Limit Reached

+

{t('paywall.limitReached')}

- You've reached your {label} limit ({limit}). Upgrade your plan to continue. + {t('paywall.limitReachedDescription', { label, limit })}

{showUpgradeButton && ( )}
@@ -70,16 +72,21 @@ export const LimitWarning = ({
-

Approaching Limit

+

{t('paywall.approachingLimit')}

- You're using {current} of {limit} {label} ({Math.round(percentage)}%). {remaining}{' '} - remaining. + {t('paywall.approachingLimitDescription', { + current, + limit, + label, + percentage: Math.round(percentage), + remaining + })}

{showUpgradeButton && ( - + )}
);