From 5a8fb8ad4ecca323071ee5d246fd78618841f3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Tue, 7 Apr 2026 22:23:48 +0800 Subject: [PATCH] feat: add i18n to ScheduledTasks page Translate the scheduled tasks header, subtitle, desktop notice, and new task button that were missed in the initial i18n pass. --- desktop/src/i18n/locales/en.ts | 6 ++++-- desktop/src/i18n/locales/zh.ts | 4 +++- desktop/src/pages/ScheduledTasks.tsx | 13 +++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/desktop/src/i18n/locales/en.ts b/desktop/src/i18n/locales/en.ts index 1bbede6f..59fe3b26 100644 --- a/desktop/src/i18n/locales/en.ts +++ b/desktop/src/i18n/locales/en.ts @@ -278,8 +278,10 @@ export const en = { 'teams.members': 'members', // ─── Scheduled Tasks Pages ────────────────────────────────────── - 'scheduledPage.title': 'Scheduled Tasks', - 'scheduledPage.subtitle': 'Manage automated operational routines and background maintenance.', + 'scheduledPage.title': 'Scheduled tasks', + 'scheduledPage.subtitle': 'Run tasks on a schedule or whenever you need them. Type {code} in any existing session to create one.', + 'scheduledPage.desktopNotice': 'Scheduled tasks only run while the desktop app is open. Make sure it stays running for tasks to fire on time.', + 'scheduledPage.oldSubtitle': 'Manage automated operational routines and background maintenance.', 'scheduledPage.executionMode': 'Execution Mode', 'scheduledPage.localMode': 'Local Mode', 'scheduledPage.remoteMode': 'Remote Mode', diff --git a/desktop/src/i18n/locales/zh.ts b/desktop/src/i18n/locales/zh.ts index 8e1c7193..4b3e9ecc 100644 --- a/desktop/src/i18n/locales/zh.ts +++ b/desktop/src/i18n/locales/zh.ts @@ -281,7 +281,9 @@ export const zh: Record = { // ─── Scheduled Tasks Pages ────────────────────────────────────── 'scheduledPage.title': '定时任务', - 'scheduledPage.subtitle': '管理自动化运维流程和后台维护任务。', + 'scheduledPage.subtitle': '按计划或在需要时运行任务。在任意会话中输入 {code} 即可创建。', + 'scheduledPage.desktopNotice': '定时任务仅在桌面应用打开时运行。请确保应用持续运行以按时触发任务。', + 'scheduledPage.oldSubtitle': '管理自动化运维流程和后台维护任务。', 'scheduledPage.executionMode': '执行模式', 'scheduledPage.localMode': '本地模式', 'scheduledPage.remoteMode': '远程模式', diff --git a/desktop/src/pages/ScheduledTasks.tsx b/desktop/src/pages/ScheduledTasks.tsx index acbfa2f4..4683b71a 100644 --- a/desktop/src/pages/ScheduledTasks.tsx +++ b/desktop/src/pages/ScheduledTasks.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' import { useTaskStore } from '../stores/taskStore' import { useUIStore } from '../stores/uiStore' +import { useTranslation } from '../i18n' import { Button } from '../components/shared/Button' import { TaskList } from '../components/tasks/TaskList' import { TaskEmptyState } from '../components/tasks/TaskEmptyState' @@ -9,6 +10,7 @@ import { NewTaskModal } from '../components/tasks/NewTaskModal' export function ScheduledTasks() { const { tasks, fetchTasks, isLoading } = useTaskStore() const { activeModal, openModal, closeModal } = useUIStore() + const t = useTranslation() const [initialized, setInitialized] = useState(false) useEffect(() => { @@ -21,19 +23,22 @@ export function ScheduledTasks() { {/* Header */}
-

Scheduled tasks

+

{t('scheduledPage.title')}

- Run tasks on a schedule or whenever you need them. Type /schedule in any existing session to create one. + {(() => { + const parts = t('scheduledPage.subtitle').split('{code}') + return <>{parts[0]}/schedule{parts[1]} + })()}

- +
{/* Desktop-online notice */}
schedule - Scheduled tasks only run while the desktop app is open. Make sure it stays running for tasks to fire on time. + {t('scheduledPage.desktopNotice')}