diff --git a/ui/litellm-dashboard/src/components/SearchTools/CreateSearchTools.tsx b/ui/litellm-dashboard/src/components/SearchTools/CreateSearchTools.tsx index cf355961d11..030ecb07c44 100644 --- a/ui/litellm-dashboard/src/components/SearchTools/CreateSearchTools.tsx +++ b/ui/litellm-dashboard/src/components/SearchTools/CreateSearchTools.tsx @@ -5,6 +5,7 @@ import { Button, TextInput } from "@tremor/react"; import { Form, Input, Modal, Select, Tooltip, Typography } from "antd"; import Image from "next/image"; import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; import NotificationsManager from "../molecules/notifications_manager"; import { createSearchTool, fetchAvailableSearchProviders } from "../networking"; import SearchConnectionTest from "./SearchConnectionTest"; @@ -60,6 +61,7 @@ const CreateSearchTool: React.FC = ({ isModalVisible, setModalVisible, }) => { + const { t } = useTranslation(); const [form] = Form.useForm(); const [isLoading, setIsLoading] = useState(false); const [formValues, setFormValues] = useState>({}); @@ -104,14 +106,14 @@ const CreateSearchTool: React.FC = ({ if (accessToken != null) { const response = await createSearchTool(accessToken, payload); - NotificationsManager.success("Search tool created successfully"); + NotificationsManager.success(t("searchTools.createSearchTools.createSuccess")); form.resetFields(); setFormValues({}); setModalVisible(false); onCreateSuccess(response); } } catch (error) { - NotificationsManager.error("Error creating search tool: " + error); + NotificationsManager.error(t("searchTools.createSearchTools.createError", { error })); } finally { setIsLoading(false); } @@ -134,7 +136,7 @@ const CreateSearchTool: React.FC = ({ // Show the modal with the fresh test setIsTestModalVisible(true); } catch (error) { - NotificationsManager.error("Please fill in Search Provider and API Key before testing"); + NotificationsManager.error(t("searchTools.createSearchTools.testFillRequired")); } }; @@ -154,7 +156,7 @@ const CreateSearchTool: React.FC = ({ title={
🔍 -

Add New Search Tool

+

{t("searchTools.createSearchTools.modalTitle")}

} open={isModalVisible} @@ -179,23 +181,23 @@ const CreateSearchTool: React.FC = ({ - Search Tool Name - + {t("searchTools.createSearchTools.searchToolNameLabel")} + } name="search_tool_name" rules={[ - { required: true, message: "Please enter a search tool name" }, + { required: true, message: t("searchTools.createSearchTools.searchToolNameRequired") }, { pattern: /^[a-zA-Z0-9_-]+$/, - message: "Name can only contain letters, numbers, hyphens, and underscores", + message: t("searchTools.createSearchTools.searchToolNamePattern"), }, ]} > @@ -203,17 +205,17 @@ const CreateSearchTool: React.FC = ({ - Search Provider - + {t("searchTools.createSearchTools.searchProviderLabel")} + } name="search_provider" - rules={[{ required: true, message: "Please select a search provider" }]} + rules={[{ required: true, message: t("searchTools.createSearchTools.searchProviderRequired") }]} >