diff --git a/attached_assets/image_1755247383413.png b/attached_assets/image_1755247383413.png new file mode 100644 index 0000000..dc1035f Binary files /dev/null and b/attached_assets/image_1755247383413.png differ diff --git a/client/src/components/DateWidget.tsx b/client/src/components/DateWidget.tsx new file mode 100644 index 0000000..2d44f04 --- /dev/null +++ b/client/src/components/DateWidget.tsx @@ -0,0 +1,34 @@ +import { Card, CardContent } from "@/components/ui/card"; +import { Calendar } from "lucide-react"; + +const formatDate = (date: Date): string => { + return date.toLocaleDateString('fr-FR', { + weekday: 'long', + year: 'numeric', + month: 'long', + day: 'numeric' + }); +}; + + + +export default function DateWidget() { + const now = new Date(); + + return ( + + +
+
+ +
+
+ + {formatDate(now)} + +
+
+
+
+ ); +} \ No newline at end of file diff --git a/client/src/components/Layout.tsx b/client/src/components/Layout.tsx index 1d60d87..bf3b9ec 100644 --- a/client/src/components/Layout.tsx +++ b/client/src/components/Layout.tsx @@ -7,6 +7,7 @@ import { useAuthUnified } from "@/hooks/useAuthUnified"; import { useIsMobile } from "@/hooks/use-mobile"; import Sidebar from "./Sidebar"; import WeatherWidget from "./WeatherWidget"; +import DateWidget from "./DateWidget"; import type { Group } from "@shared/schema"; interface StoreContextType { @@ -92,8 +93,11 @@ export default function Layout({ children }: LayoutProps) { )} - {/* Weather widget */} - + {/* Weather and Date widgets */} +
+ + +
{/* Store selector for admin - responsive */} diff --git a/client/src/components/WeatherWidget.tsx b/client/src/components/WeatherWidget.tsx index 78ac4a6..0920590 100644 --- a/client/src/components/WeatherWidget.tsx +++ b/client/src/components/WeatherWidget.tsx @@ -140,8 +140,11 @@ export default function WeatherWidget() { <>
-
- {Math.round(previousTemp)}° +
+ +
+ {Math.round(previousTemp)}° +
Année dernière diff --git a/cookies.txt b/cookies.txt index a0cd3af..badf3f7 100644 --- a/cookies.txt +++ b/cookies.txt @@ -2,4 +2,4 @@ # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -#HttpOnly_localhost FALSE / FALSE 1755333603 connect.sid s%3AQqa7VC9Kmev2sSuyP6rb67zs4VszjTJP.RwnrDHc4pdPJyIwe93Hg9PTGpAF73AsiSmjdDq4MC4c +#HttpOnly_localhost FALSE / FALSE 1755333988 connect.sid s%3AISLqM3nMPwDqTr6rJYeqzJe6pp6ETpGJ.UEpHxk3T4DOjAZ6VGJsJ%2FHoasP2kzqayut1IaOzPG9E diff --git a/server/weatherService.ts b/server/weatherService.ts index bb4b865..a692724 100644 --- a/server/weatherService.ts +++ b/server/weatherService.ts @@ -70,7 +70,41 @@ export class WeatherService { } /** - * Convertit les données de l'API en format WeatherData + * Traduit les conditions météo en français + */ + private translateConditionToFrench(condition: string): string { + const conditionLower = condition.toLowerCase(); + + // Traductions anglais -> français + if (conditionLower.includes('clear')) return 'Dégagé'; + if (conditionLower.includes('sunny')) return 'Ensoleillé'; + if (conditionLower.includes('fair')) return 'Beau temps'; + if (conditionLower.includes('partly cloudy')) return 'Partiellement nuageux'; + if (conditionLower.includes('cloudy')) return 'Nuageux'; + if (conditionLower.includes('overcast')) return 'Couvert'; + if (conditionLower.includes('rain')) { + if (conditionLower.includes('heavy')) return 'Pluie forte'; + if (conditionLower.includes('light')) return 'Pluie légère'; + return 'Pluie'; + } + if (conditionLower.includes('shower')) return 'Averses'; + if (conditionLower.includes('drizzle')) return 'Bruine'; + if (conditionLower.includes('thunderstorm') || conditionLower.includes('thunder')) return 'Orage'; + if (conditionLower.includes('snow')) { + if (conditionLower.includes('heavy')) return 'Neige forte'; + if (conditionLower.includes('light')) return 'Neige légère'; + return 'Neige'; + } + if (conditionLower.includes('fog')) return 'Brouillard'; + if (conditionLower.includes('mist')) return 'Brume'; + if (conditionLower.includes('wind')) return 'Venteux'; + + // Si déjà en français, retourner tel quel + return condition; + } + + /** + * Convertit les données de l'API en format WeatherData avec traduction française forcée */ convertApiDataToWeatherData(apiData: WeatherApiResponse, location: string, isCurrentYear: boolean): InsertWeatherData | null { if (!apiData.days || apiData.days.length === 0) { @@ -86,7 +120,7 @@ export class WeatherService { tempMax: todayData.tempmax.toString(), tempMin: todayData.tempmin.toString(), icon: todayData.icon, - conditions: todayData.conditions, + conditions: this.translateConditionToFrench(todayData.conditions), // Traduction forcée isCurrentYear // Pas de createdAt/updatedAt - gérés par la base de données };