diff --git a/surfsense_web/app/dashboard/[search_space_id]/settings/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/settings/page.tsx index fde676dff..26cb882e2 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/settings/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/settings/page.tsx @@ -13,6 +13,7 @@ import { } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; import { useParams, useRouter } from "next/navigation"; +import { useTranslations } from "next-intl"; import { useCallback, useEffect, useState } from "react"; import { LLMRoleManager } from "@/components/settings/llm-role-manager"; import { ModelConfigManager } from "@/components/settings/model-config-manager"; @@ -23,28 +24,28 @@ import { cn } from "@/lib/utils"; interface SettingsNavItem { id: string; - label: string; - description: string; + labelKey: string; + descriptionKey: string; icon: LucideIcon; } const settingsNavItems: SettingsNavItem[] = [ { id: "models", - label: "Agent Configs", - description: "LLM models with prompts & citations", + labelKey: "nav_agent_configs", + descriptionKey: "nav_agent_configs_desc", icon: Bot, }, { id: "roles", - label: "Role Assignments", - description: "Assign configs to agent roles", + labelKey: "nav_role_assignments", + descriptionKey: "nav_role_assignments_desc", icon: Brain, }, { id: "prompts", - label: "System Instructions", - description: "SearchSpace-wide AI instructions", + labelKey: "nav_system_instructions", + descriptionKey: "nav_system_instructions_desc", icon: MessageSquare, }, ]; @@ -62,6 +63,8 @@ function SettingsSidebar({ isOpen: boolean; onClose: () => void; }) { + const t = useTranslations("searchSpaceSettings"); + const handleNavClick = (sectionId: string) => { onSectionChange(sectionId); onClose(); // Close sidebar on mobile after selection @@ -94,22 +97,28 @@ function SettingsSidebar({ isOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0" )} > - {/* Header with back button */} -
- - {/* Mobile close button */} - + {/* Header with title */} +
+
+ + {/* Mobile close button */} + +
+ {/* Settings Title */} +
+

{t("title")}

+
{/* Navigation Items */} @@ -159,9 +168,9 @@ function SettingsSidebar({ isActive ? "text-foreground" : "text-muted-foreground" )} > - {item.label} + {t(item.labelKey)}

-

{item.description}

+

{t(item.descriptionKey)}

- {/* Footer */} -
-

Search Space Settings

-
); @@ -194,6 +199,7 @@ function SettingsContent({ searchSpaceId: number; onMenuClick: () => void; }) { + const t = useTranslations("searchSpaceSettings"); const activeItem = settingsNavItems.find((item) => item.id === activeSection); const Icon = activeItem?.icon || Settings; @@ -236,7 +242,7 @@ function SettingsContent({

- {activeItem?.label} + {activeItem ? t(activeItem.labelKey) : ""}

diff --git a/surfsense_web/app/dashboard/user/settings/page.tsx b/surfsense_web/app/dashboard/user/settings/page.tsx index ca89f9ba3..d09428a52 100644 --- a/surfsense_web/app/dashboard/user/settings/page.tsx +++ b/surfsense_web/app/dashboard/user/settings/page.tsx @@ -75,20 +75,27 @@ function UserSettingsSidebar({ isOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0" )} > -
- - + {/* Header with title */} +
+
+ + +
+ {/* Settings Title */} +
+

{t("title")}

+
-
-

{t("footer")}

-
); diff --git a/surfsense_web/messages/en.json b/surfsense_web/messages/en.json index 57f03a0fb..5ee25489d 100644 --- a/surfsense_web/messages/en.json +++ b/surfsense_web/messages/en.json @@ -105,7 +105,6 @@ "title": "User Settings", "description": "Manage your account settings and API access", "back_to_app": "Back to app", - "footer": "User Settings", "api_key_nav_label": "API Key", "api_key_nav_description": "Manage your API access token", "api_key_title": "API Key", @@ -684,6 +683,16 @@ "server_error": "Server error", "network_error": "Network error" }, + "searchSpaceSettings": { + "title": "Search Space Settings", + "back_to_app": "Back to app", + "nav_agent_configs": "Agent Configs", + "nav_agent_configs_desc": "LLM models with prompts & citations", + "nav_role_assignments": "Role Assignments", + "nav_role_assignments_desc": "Assign configs to agent roles", + "nav_system_instructions": "System Instructions", + "nav_system_instructions_desc": "SearchSpace-wide AI instructions" + }, "homepage": { "hero_title_part1": "The AI Workspace", "hero_title_part2": "Built for Teams", diff --git a/surfsense_web/messages/zh.json b/surfsense_web/messages/zh.json index 89cb7813a..8c1f53699 100644 --- a/surfsense_web/messages/zh.json +++ b/surfsense_web/messages/zh.json @@ -105,7 +105,6 @@ "title": "用户设置", "description": "管理您的账户设置和API访问", "back_to_app": "返回应用", - "footer": "用户设置", "api_key_nav_label": "API密钥", "api_key_nav_description": "管理您的API访问令牌", "api_key_title": "API密钥", @@ -678,6 +677,16 @@ "server_error": "服务器错误", "network_error": "网络错误" }, + "searchSpaceSettings": { + "title": "搜索空间设置", + "back_to_app": "返回应用", + "nav_agent_configs": "代理配置", + "nav_agent_configs_desc": "LLM 模型配置提示词和引用", + "nav_role_assignments": "角色分配", + "nav_role_assignments_desc": "为代理角色分配配置", + "nav_system_instructions": "系统指令", + "nav_system_instructions_desc": "搜索空间级别的 AI 指令" + }, "homepage": { "hero_title_part1": "AI 工作空间", "hero_title_part2": "为团队而生",