From 0f15cf53b4c9d41e2052ca254c609e9e84df0fc3 Mon Sep 17 00:00:00 2001 From: Philippe Miossec Date: Sat, 1 Mar 2025 10:30:18 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat:=20translate=20"Read=20more"?= =?UTF-8?q?=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/WikiCard.tsx | 4 +++- frontend/src/languages.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/WikiCard.tsx b/frontend/src/components/WikiCard.tsx index 264d0c9..5db033e 100644 --- a/frontend/src/components/WikiCard.tsx +++ b/frontend/src/components/WikiCard.tsx @@ -1,6 +1,7 @@ import { Share2, Heart } from 'lucide-react'; import { useState } from 'react'; import { useLikedArticles } from '../contexts/LikedArticlesContext'; +import { useLocalization } from '../hooks/useLocalization'; export interface WikiArticle { title: string; @@ -22,6 +23,7 @@ interface WikiCardProps { export function WikiCard({ article }: WikiCardProps) { const [imageLoaded, setImageLoaded] = useState(false); const { toggleLike, isLiked } = useLikedArticles(); + const { currentLanguage } = useLocalization(); // Add debugging log console.log('Article data:', { @@ -113,7 +115,7 @@ export function WikiCard({ article }: WikiCardProps) { rel="noopener noreferrer" className="inline-block text-white hover:text-gray-200 drop-shadow-lg" > - Read more → + {currentLanguage.readMore ?? "Read more"} → diff --git a/frontend/src/languages.ts b/frontend/src/languages.ts index 4590205..afd7a7b 100644 --- a/frontend/src/languages.ts +++ b/frontend/src/languages.ts @@ -75,6 +75,7 @@ export const LANGUAGES = [ flag: "https://hatscripts.github.io/circle-flags/flags/fr.svg", api: "https://fr.wikipedia.org/w/api.php?", article: "https://fr.wikipedia.org/wiki/", + readMore: "En savoir plus", }, { id: "el",