feat(i18n): Translate analytics to French

This commit is contained in:
Michael committed 2026-01-20 14:27:17 +01:00
1 parent 4c06e5951d
commit f8db96084b
4 files changed
+23 -20

No files matched your search

@@ -43,14 +43,14 @@ export function AnalyticsDashboard() {
queryClient.invalidateQueries({ queryKey: [`/api/analytics/pages/${selectedPageId}/history`] }); queryClient.invalidateQueries({ queryKey: [`/api/analytics/pages/${selectedPageId}/history`] });
queryClient.invalidateQueries({ queryKey: ['/api/pages'] }); queryClient.invalidateQueries({ queryKey: ['/api/pages'] });
toast({ toast({
title: "Analytics refreshed", title: "Analyses actualisées",
description: "Latest data has been fetched from Facebook.", description: "Les dernières données ont été récupérées depuis Facebook.",
}); });
}, },
onError: () => { onError: () => {
toast({ toast({
title: "Refresh failed", title: "Échec de l'actualisation",
description: "Could not fetch latest data.", description: "Impossible de récupérer les dernières données.",
variant: "destructive" variant: "destructive"
}); });
} }
@@ -74,8 +74,8 @@ export function AnalyticsDashboard() {
return Math.round(((current - prev) / prev) * 100); return Math.round(((current - prev) / prev) * 100);
}; };
if (isLoadingPages) return <div>Loading pages...</div>; if (isLoadingPages) return <div>Chargement des pages...</div>;
if (!pages.length) return <div>No pages connected. Please connect a Facebook page in Settings.</div>; if (!pages.length) return <div>Aucune page connectée. Veuillez connecter une page Facebook dans les Paramètres.</div>;
return ( return (
<div className="space-y-8"> <div className="space-y-8">
@@ -83,7 +83,7 @@ export function AnalyticsDashboard() {
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">
<Select value={selectedPageId || ''} onValueChange={setSelectedPageId}> <Select value={selectedPageId || ''} onValueChange={setSelectedPageId}>
<SelectTrigger className="w-[250px]"> <SelectTrigger className="w-[250px]">
<SelectValue placeholder="Select Page" /> <SelectValue placeholder="Sélectionner une page" />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
{pages.map((page: any) => ( {pages.map((page: any) => (
@@ -96,7 +96,7 @@ export function AnalyticsDashboard() {
{selectedPage && ( {selectedPage && (
<span className={`px-2 py-1 rounded text-xs ${selectedPage.tokenStatus === 'valid' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'}`}> <span className={`px-2 py-1 rounded text-xs ${selectedPage.tokenStatus === 'valid' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'}`}>
Token: {selectedPage.tokenStatus || 'Unknown'} Token : {selectedPage.tokenStatus || 'Inconnu'}
</span> </span>
)} )}
</div> </div>
@@ -107,7 +107,7 @@ export function AnalyticsDashboard() {
disabled={refreshMutation.isPending || !selectedPageId} disabled={refreshMutation.isPending || !selectedPageId}
> >
<RefreshCw className={`mr-2 h-4 w-4 ${refreshMutation.isPending ? 'animate-spin' : ''}`} /> <RefreshCw className={`mr-2 h-4 w-4 ${refreshMutation.isPending ? 'animate-spin' : ''}`} />
Refresh Data Actualiser les données
</Button> </Button>
</div> </div>
@@ -115,25 +115,25 @@ export function AnalyticsDashboard() {
<> <>
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4"> <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
<MetricsCard <MetricsCard
title="Total Followers" title="Abonnés Totaux"
value={latest?.followersCount?.toLocaleString() || 0} value={latest?.followersCount?.toLocaleString() || 0}
icon={<Users className="h-4 w-4 text-muted-foreground" />} icon={<Users className="h-4 w-4 text-muted-foreground" />}
trend={latest && previous ? getTrend(latest.followersCount, previous.followersCount) : undefined} trend={latest && previous ? getTrend(latest.followersCount, previous.followersCount) : undefined}
description="from last update" description="depuis la dernière mise à jour"
/> />
<MetricsCard <MetricsCard
title="Page Reach" title="Portée de la Page"
value={latest?.pageReach?.toLocaleString() || 0} value={latest?.pageReach?.toLocaleString() || 0}
icon={<BarChart3 className="h-4 w-4 text-muted-foreground" />} icon={<BarChart3 className="h-4 w-4 text-muted-foreground" />}
trend={latest && previous ? getTrend(latest.pageReach, previous.pageReach) : undefined} trend={latest && previous ? getTrend(latest.pageReach, previous.pageReach) : undefined}
description="from last update" description="depuis la dernière mise à jour"
/> />
{/* Add more metrics if available */} {/* Add more metrics if available */}
</div> </div>
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Growth & Reach History</CardTitle> <CardTitle>Historique de Croissance & Portée</CardTitle>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div className="h-[300px]"> <div className="h-[300px]">
@@ -144,8 +144,8 @@ export function AnalyticsDashboard() {
<YAxis yAxisId="left" /> <YAxis yAxisId="left" />
<YAxis yAxisId="right" orientation="right" /> <YAxis yAxisId="right" orientation="right" />
<Tooltip /> <Tooltip />
<Line yAxisId="left" type="monotone" dataKey="followers" stroke="#8884d8" name="Followers" /> <Line yAxisId="left" type="monotone" dataKey="followers" stroke="#8884d8" name="Abonnés" />
<Line yAxisId="right" type="monotone" dataKey="reach" stroke="#82ca9d" name="Reach" /> <Line yAxisId="right" type="monotone" dataKey="reach" stroke="#82ca9d" name="Portée" />
</LineChart> </LineChart>
</ResponsiveContainer> </ResponsiveContainer>
</div> </div>
+2 -2
View File
@@ -27,8 +27,8 @@ export default function AnalyticsPage() {
<div className="p-4 sm:p-6 lg:p-8 space-y-6 sm:space-y-8 max-w-[1600px] mx-auto"> <div className="p-4 sm:p-6 lg:p-8 space-y-6 sm:space-y-8 max-w-[1600px] mx-auto">
<div className="mb-8"> <div className="mb-8">
<h1 className="text-3xl font-bold tracking-tight mb-2">Social Analytics</h1> <h1 className="text-3xl font-bold tracking-tight mb-2">Analystique Sociale</h1>
<p className="text-muted-foreground">Monitor your Facebook & Instagram performance.</p> <p className="text-muted-foreground">Suivez vos performances Facebook & Instagram.</p>
</div> </div>
<AnalyticsDashboard /> <AnalyticsDashboard />
</div> </div>
+2 -2
View File
@@ -27,8 +27,8 @@ export default function AnalyticsPageMobile() {
<div className="p-4 space-y-6"> <div className="p-4 space-y-6">
<div className="mb-4"> <div className="mb-4">
<h1 className="text-2xl font-bold tracking-tight mb-2">Social Analytics</h1> <h1 className="text-2xl font-bold tracking-tight mb-2">Analystique Sociale</h1>
<p className="text-sm text-muted-foreground">Monitor your performance.</p> <p className="text-sm text-muted-foreground">Suivez vos performances.</p>
</div> </div>
<AnalyticsDashboard /> <AnalyticsDashboard />
</div> </div>
+3
View File
@@ -35,7 +35,10 @@ Planning and Architecture Definition.
### Phase 4: Verification ### Phase 4: Verification
### Phase 4: Verification
- [x] [TEST] Verify implementation builds correctly (`npm run build`) - [x] [TEST] Verify implementation builds correctly (`npm run build`)
- [x] [FIX] **Deployment**: Implemented automated safe DB migration on startup
- [ ] [TEST] Simulate Token Refresh Job - [ ] [TEST] Simulate Token Refresh Job
- [ ] [MANUAL] Validate Analytics Data accuracy through UI - [ ] [MANUAL] Validate Analytics Data accuracy through UI