Browse Source

fix: correct Hungarian translation and add i18n to dashboard components #69

Claude 5 months ago
parent
commit
d23d19f671

+ 4 - 2
shopcall.ai-main/src/components/ResolutionRateChart.tsx

@@ -1,7 +1,9 @@
 import { Loader2 } from "lucide-react";
 import { Loader2 } from "lucide-react";
 import { useDashboard } from "./context/DashboardContext";
 import { useDashboard } from "./context/DashboardContext";
+import { useTranslation } from "react-i18next";
 
 
 export function ResolutionRateChart() {
 export function ResolutionRateChart() {
+  const { t } = useTranslation();
   const { stats, loading } = useDashboard();
   const { stats, loading } = useDashboard();
 
 
   if (loading) {
   if (loading) {
@@ -23,7 +25,7 @@ export function ResolutionRateChart() {
   return (
   return (
     <div className="space-y-6">
     <div className="space-y-6">
       <div>
       <div>
-        <h3 className="text-lg font-semibold text-white">Resolution Rate</h3>
+        <h3 className="text-lg font-semibold text-white">{t('dashboard.charts.resolutionRate')}</h3>
       </div>
       </div>
 
 
       <div className="flex items-center justify-center">
       <div className="flex items-center justify-center">
@@ -53,7 +55,7 @@ export function ResolutionRateChart() {
 
 
           <div className="absolute inset-0 flex flex-col items-center justify-center">
           <div className="absolute inset-0 flex flex-col items-center justify-center">
             <div className="text-4xl font-bold text-white">{resolutionRate.toFixed(1)}%</div>
             <div className="text-4xl font-bold text-white">{resolutionRate.toFixed(1)}%</div>
-            <div className="text-sm text-slate-400">Success Rate</div>
+            <div className="text-sm text-slate-400">{t('analytics.charts.resolutionRateTrend')}</div>
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>

+ 7 - 5
shopcall.ai-main/src/components/TopCallIntents.tsx

@@ -1,7 +1,9 @@
 import { Loader2 } from "lucide-react";
 import { Loader2 } from "lucide-react";
 import { useDashboard } from "./context/DashboardContext";
 import { useDashboard } from "./context/DashboardContext";
+import { useTranslation } from "react-i18next";
 
 
 export function TopCallIntents() {
 export function TopCallIntents() {
+  const { t } = useTranslation();
   const { stats, loading } = useDashboard();
   const { stats, loading } = useDashboard();
 
 
   if (loading) {
   if (loading) {
@@ -18,11 +20,11 @@ export function TopCallIntents() {
     return (
     return (
       <div className="space-y-6">
       <div className="space-y-6">
         <div className="flex items-center justify-between">
         <div className="flex items-center justify-between">
-          <h3 className="text-lg font-semibold text-white">Top Call Intents</h3>
-          <span className="text-sm text-slate-400">Last 24 hours</span>
+          <h3 className="text-lg font-semibold text-white">{t('analytics.charts.topCallIntents')}</h3>
+          <span className="text-sm text-slate-400">{t('analytics.charts.last24Hours')}</span>
         </div>
         </div>
         <div className="text-center text-slate-400 py-8">
         <div className="text-center text-slate-400 py-8">
-          No call data available yet
+          {t('dashboard.noCallData')}
         </div>
         </div>
       </div>
       </div>
     );
     );
@@ -31,8 +33,8 @@ export function TopCallIntents() {
   return (
   return (
     <div className="space-y-6">
     <div className="space-y-6">
       <div className="flex items-center justify-between">
       <div className="flex items-center justify-between">
-        <h3 className="text-lg font-semibold text-white">Top Call Intents</h3>
-        <span className="text-sm text-slate-400">Last 24 hours</span>
+        <h3 className="text-lg font-semibold text-white">{t('analytics.charts.topCallIntents')}</h3>
+        <span className="text-sm text-slate-400">{t('analytics.charts.last24Hours')}</span>
       </div>
       </div>
 
 
       <div className="space-y-4">
       <div className="space-y-4">

+ 1 - 0
shopcall.ai-main/src/i18n/locales/de.json

@@ -144,6 +144,7 @@
       "customRange": "Benutzerdefinierter Zeitraum"
       "customRange": "Benutzerdefinierter Zeitraum"
     },
     },
     "search": "Anrufe suchen...",
     "search": "Anrufe suchen...",
+    "noCallData": "Noch keine Anrufdaten verfügbar",
     "kpi": {
     "kpi": {
       "totalCalls": "Gesamtanrufe",
       "totalCalls": "Gesamtanrufe",
       "resolvedCalls": "Gelöste Anrufe",
       "resolvedCalls": "Gelöste Anrufe",

+ 1 - 0
shopcall.ai-main/src/i18n/locales/en.json

@@ -144,6 +144,7 @@
       "customRange": "Custom range"
       "customRange": "Custom range"
     },
     },
     "search": "Search calls...",
     "search": "Search calls...",
+    "noCallData": "No call data available yet",
     "kpi": {
     "kpi": {
       "totalCalls": "Total Calls",
       "totalCalls": "Total Calls",
       "resolvedCalls": "Resolved Calls",
       "resolvedCalls": "Resolved Calls",

+ 2 - 1
shopcall.ai-main/src/i18n/locales/hu.json

@@ -144,6 +144,7 @@
       "customRange": "Egyéni időszak"
       "customRange": "Egyéni időszak"
     },
     },
     "search": "Hívások keresése...",
     "search": "Hívások keresése...",
+    "noCallData": "Még nincs hívásadat elérhető",
     "kpi": {
     "kpi": {
       "totalCalls": "Összes hívás",
       "totalCalls": "Összes hívás",
       "resolvedCalls": "Megoldott hívások",
       "resolvedCalls": "Megoldott hívások",
@@ -263,7 +264,7 @@
     "dateRange": "Dátumtartomány",
     "dateRange": "Dátumtartomány",
     "searchPlaceholder": "Keresés telefonszám vagy ügyfél alapján...",
     "searchPlaceholder": "Keresés telefonszám vagy ügyfél alapján...",
     "filters": "Szűrők",
     "filters": "Szűrők",
-    "allCallLogs": "Összes Hívásnap ló",
+    "allCallLogs": "Összes Hívás",
     "loadingCallLogs": "Hívásnapló betöltése...",
     "loadingCallLogs": "Hívásnapló betöltése...",
     "failedToLoad": "Nem sikerült betölteni a hívásnaplót",
     "failedToLoad": "Nem sikerült betölteni a hívásnaplót",
     "table": {
     "table": {