diff --git a/ui/litellm-dashboard/src/components/prompts/variable_textarea.tsx b/ui/litellm-dashboard/src/components/prompts/variable_textarea.tsx index e952ee71dbd..97f2e5ca026 100644 --- a/ui/litellm-dashboard/src/components/prompts/variable_textarea.tsx +++ b/ui/litellm-dashboard/src/components/prompts/variable_textarea.tsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; import { Input, Popover, Tag } from "antd"; import { EditOutlined } from "@ant-design/icons"; +import { useTranslation } from "react-i18next"; const { TextArea } = Input; @@ -13,6 +14,7 @@ interface VariableTextAreaProps { } const VariableTextArea: React.FC = ({ value, onChange, placeholder, rows = 4, className }) => { + const { t } = useTranslation(); const [editingVariable, setEditingVariable] = useState<{ oldName: string; start: number; @@ -86,19 +88,19 @@ const VariableTextArea: React.FC = ({ value, onChange, pl {/* Variable Management - Clear and Functional */} {variables.length > 0 && (
- Detected variables: + {t("promptsPage.variableTextarea.detectedVariables")} {variables.map((variable, index) => ( -
Edit variable name
+
{t("promptsPage.variableTextarea.editVariableName")}
setNewVariableName(e.target.value)} onPressEnter={handleVariableEdit} - placeholder="Variable name" + placeholder={t("promptsPage.variableTextarea.variableNamePlaceholder")} autoFocus />
@@ -106,7 +108,7 @@ const VariableTextArea: React.FC = ({ value, onChange, pl onClick={handleVariableEdit} className="text-xs px-2 py-1 bg-blue-500 text-white rounded hover:bg-blue-600" > - Save + {t("common.save")}
diff --git a/ui/litellm-dashboard/src/locales/en.json b/ui/litellm-dashboard/src/locales/en.json index 574362c6d96..e89c4e1605c 100644 --- a/ui/litellm-dashboard/src/locales/en.json +++ b/ui/litellm-dashboard/src/locales/en.json @@ -4648,6 +4648,11 @@ "invalidJsonError": "Invalid JSON format. Please check your syntax.", "placeholder": "Paste your tool JSON here...", "addButton": "Add" + }, + "variableTextarea": { + "detectedVariables": "Detected variables:", + "editVariableName": "Edit variable name", + "variableNamePlaceholder": "Variable name" } } } diff --git a/ui/litellm-dashboard/src/locales/zh-CN.json b/ui/litellm-dashboard/src/locales/zh-CN.json index a7fc7124ac7..0639f338ae0 100644 --- a/ui/litellm-dashboard/src/locales/zh-CN.json +++ b/ui/litellm-dashboard/src/locales/zh-CN.json @@ -4648,6 +4648,11 @@ "invalidJsonError": "JSON 格式无效,请检查语法。", "placeholder": "在此粘贴工具 JSON...", "addButton": "添加" + }, + "variableTextarea": { + "detectedVariables": "检测到的变量:", + "editVariableName": "编辑变量名", + "variableNamePlaceholder": "变量名" } } }