diff --git a/ui/litellm-dashboard/src/components/AIHub/SkillHubDashboard.tsx b/ui/litellm-dashboard/src/components/AIHub/SkillHubDashboard.tsx index 16a2b65e521..f4b50fe3e51 100644 --- a/ui/litellm-dashboard/src/components/AIHub/SkillHubDashboard.tsx +++ b/ui/litellm-dashboard/src/components/AIHub/SkillHubDashboard.tsx @@ -4,7 +4,8 @@ import { SearchOutlined } from "@ant-design/icons"; import { Input, Select } from "antd"; import { Plugin } from "@/components/claude_code_plugins/types"; import { ModelDataTable } from "@/components/model_dashboard/table"; -import { skillHubColumns } from "@/components/skill_hub_table_columns"; +import { useTranslation } from "react-i18next"; +import { getSkillHubColumns } from "@/components/skill_hub_table_columns"; import SkillDetail from "@/components/claude_code_plugins/skill_detail"; interface SkillHubDashboardProps { @@ -24,6 +25,7 @@ const SkillHubDashboard: React.FC = ({ publicPage = false, onPublishSuccess, }) => { + const { t } = useTranslation(); const [search, setSearch] = useState(""); const [domainFilter, setDomainFilter] = useState(undefined); const [selectedSkill, setSelectedSkill] = useState(null); @@ -115,7 +117,7 @@ const SkillHubDashboard: React.FC = ({ setSelectedSkill(skill), copyToClipboard, publicPage)} + columns={getSkillHubColumns(t, (skill) => setSelectedSkill(skill), copyToClipboard, publicPage)} data={filteredSkills} isLoading={false} defaultSorting={[{ id: "name", desc: false }]} diff --git a/ui/litellm-dashboard/src/components/query_param_input.tsx b/ui/litellm-dashboard/src/components/query_param_input.tsx index 344d77f3af5..266105e026a 100644 --- a/ui/litellm-dashboard/src/components/query_param_input.tsx +++ b/ui/litellm-dashboard/src/components/query_param_input.tsx @@ -2,6 +2,7 @@ import React, { useState } from "react"; import { Button, Space } from "antd"; import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons"; import { TextInput } from "@tremor/react"; +import { useTranslation } from "react-i18next"; interface QueryParamInputProps { value?: Record; @@ -9,6 +10,7 @@ interface QueryParamInputProps { } const QueryParamInput: React.FC = ({ value = {}, onChange }) => { + const { t } = useTranslation(); const [pairs, setPairs] = useState<[string, string][]>(Object.entries(value)); const handleAdd = () => { @@ -33,12 +35,12 @@ const QueryParamInput: React.FC = ({ value = {}, onChange {pairs.map(([key, val], index) => ( handleChange(index, e.target.value, val)} /> handleChange(index, key, e.target.value)} /> @@ -48,7 +50,7 @@ const QueryParamInput: React.FC = ({ value = {}, onChange ))} ); diff --git a/ui/litellm-dashboard/src/components/route_preview.tsx b/ui/litellm-dashboard/src/components/route_preview.tsx index c515687d096..1b463c508fd 100644 --- a/ui/litellm-dashboard/src/components/route_preview.tsx +++ b/ui/litellm-dashboard/src/components/route_preview.tsx @@ -1,6 +1,7 @@ import React from "react"; import { Card, Typography } from "antd"; import { RightOutlined, InfoCircleOutlined } from "@ant-design/icons"; +import { Trans, useTranslation } from "react-i18next"; const { Title, Text } = Typography; import { getProxyBaseUrl } from "./networking"; @@ -12,6 +13,7 @@ interface RoutePreviewProps { } const RoutePreview: React.FC = ({ pathValue, targetValue, includeSubpath }) => { + const { t } = useTranslation(); const proxyBaseUrl = getProxyBaseUrl(); const getLiteLLMProxyUrl = () => { @@ -26,20 +28,20 @@ const RoutePreview: React.FC = ({ pathValue, targetValue, inc return ( - Route Preview + {t("routePreview.title")} - How your requests will be routed + {t("routePreview.subtitle")}
{/* Basic routing */}
-
Basic routing:
+
{t("routePreview.basicRouting")}
{/* Your endpoint */}
-
Your endpoint
+
{t("routePreview.yourEndpoint")}
{getLiteLLMProxyUrl()}
@@ -50,7 +52,7 @@ const RoutePreview: React.FC = ({ pathValue, targetValue, inc {/* Forwards to */}
-
Forwards to
+
{t("routePreview.forwardsTo")}
{targetValue}
@@ -60,11 +62,11 @@ const RoutePreview: React.FC = ({ pathValue, targetValue, inc <> {/* With subpaths */}
-
With subpaths:
+
{t("routePreview.withSubpaths")}
{/* Your endpoint + subpath */}
-
Your endpoint + subpath
+
{t("routePreview.yourEndpointSubpath")}
{pathValue && `${proxyBaseUrl}${pathValue}`} /v1/text-to-image/base/model @@ -78,7 +80,7 @@ const RoutePreview: React.FC = ({ pathValue, targetValue, inc {/* Forwards to with subpath */}
-
Forwards to
+
{t("routePreview.forwardsTo")}
{targetValue} /v1/text-to-image/base/model @@ -87,9 +89,7 @@ const RoutePreview: React.FC = ({ pathValue, targetValue, inc
{/* Note */} -
- Any path after {pathValue} will be appended to the target URL -
+
{t("routePreview.subpathNote", { pathValue })}
)} @@ -99,10 +99,13 @@ const RoutePreview: React.FC = ({ pathValue, targetValue, inc
- Not seeing the routing you wanted? Try enabling - Include Subpaths - - above - this allows subroutes like{" "} - /api/v1/models to be - forwarded automatically. + , + code: , + }} + />
diff --git a/ui/litellm-dashboard/src/components/settings.tsx b/ui/litellm-dashboard/src/components/settings.tsx index ed45d95222d..0af2fd3ac6e 100644 --- a/ui/litellm-dashboard/src/components/settings.tsx +++ b/ui/litellm-dashboard/src/components/settings.tsx @@ -19,6 +19,7 @@ import { TextInput, } from "@tremor/react"; import React, { useEffect, useState } from "react"; +import { Trans, useTranslation } from "react-i18next"; import { Button as Button2, Form, Input, Modal, Select, Typography } from "antd"; import EmailSettings from "./email_settings"; @@ -62,6 +63,8 @@ interface DynamicParamsFieldsProps { } const DynamicParamsFields: React.FC = ({ params, callbackConfigs, selectedCallback }) => { + const { t } = useTranslation(); + if (!params || params.length === 0) { return null; } @@ -86,7 +89,7 @@ const DynamicParamsFields: React.FC = ({ params, callb ? [ { required: true, - message: `Please enter the ${fieldLabel.toLowerCase()}`, + message: t("settings.dynamicParamRequired", { fieldLabel: fieldLabel.toLowerCase() }), }, ] : undefined @@ -95,14 +98,14 @@ const DynamicParamsFields: React.FC = ({ params, callb {paramType === "password" ? ( ) : paramType === "number" ? ( = ({ params, callb ) : ( )} @@ -136,14 +139,16 @@ const CallbackSelector: React.FC = ({ onCallbackChange, disabled = false, }) => { + const { t } = useTranslation(); + return (