From 371e9b41f81669e88fc4cb0fa3ace30252be4a83 Mon Sep 17 00:00:00 2001 From: ZhaiSoul <842607283@qq.com> Date: Wed, 16 Apr 2025 05:06:40 +0000 Subject: [PATCH] fix: fix mobile bottom bar reindexing embeddings i18n wrong --- web/src/components/navigation/Bottombar.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/src/components/navigation/Bottombar.tsx b/web/src/components/navigation/Bottombar.tsx index 84d9fc4fc..0c344363b 100644 --- a/web/src/components/navigation/Bottombar.tsx +++ b/web/src/components/navigation/Bottombar.tsx @@ -16,6 +16,7 @@ import { Link } from "react-router-dom"; import { cn } from "@/lib/utils"; import { isIOS, isMobile } from "react-device-detect"; import { isPWA } from "@/utils/isPWA"; +import { useTranslation } from "react-i18next"; function Bottombar() { const navItems = useNavigation("secondary"); @@ -43,6 +44,7 @@ type StatusAlertNavProps = { className?: string; }; function StatusAlertNav({ className }: StatusAlertNavProps) { + const { t } = useTranslation(["views/system"]); const { data: initialStats } = useSWR("stats", { revalidateOnFocus: false, }); @@ -82,14 +84,19 @@ function StatusAlertNav({ className }: StatusAlertNavProps) { clearMessages("embeddings-reindex"); addMessage( "embeddings-reindex", - `Reindexing embeddings (${Math.floor((reindexState.processed_objects / reindexState.total_objects) * 100)}% complete)`, + t("stats.reindexingEmbeddings", { + processed: Math.floor( + (reindexState.processed_objects / reindexState.total_objects) * + 100, + ), + }), ); } if (reindexState.status === "completed") { clearMessages("embeddings-reindex"); } } - }, [reindexState, addMessage, clearMessages]); + }, [reindexState, addMessage, clearMessages, t]); if (!messages || Object.keys(messages).length === 0) { return;