diff --git a/web/src/components/SpawnSession.tsx b/web/src/components/SpawnSession.tsx index 96e1f32c..482b9dc7 100644 --- a/web/src/components/SpawnSession.tsx +++ b/web/src/components/SpawnSession.tsx @@ -5,6 +5,7 @@ import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { usePlatform } from '@/hooks/usePlatform' import { useSpawnSession } from '@/hooks/mutations/useSpawnSession' +import { useTranslation } from '@/lib/use-translation' type SessionType = 'simple' | 'worktree' @@ -23,6 +24,7 @@ export function SpawnSession(props: { onCancel: () => void }) { const { haptic } = usePlatform() + const { t } = useTranslation() const [directory, setDirectory] = useState('') const [sessionType, setSessionType] = useState('simple') const [worktreeName, setWorktreeName] = useState('') @@ -60,7 +62,7 @@ export function SpawnSession(props: {
- Create Session + {t('spawn.title')} {machineTitle} @@ -154,13 +156,13 @@ export function SpawnSession(props: { onClick={props.onCancel} disabled={isPending} > - Cancel + {t('spawn.cancel')}
diff --git a/web/src/lib/locales/en.ts b/web/src/lib/locales/en.ts index be4c8f4f..34253918 100644 --- a/web/src/lib/locales/en.ts +++ b/web/src/lib/locales/en.ts @@ -91,6 +91,7 @@ export default { 'button.paste': 'Paste', // New session form + 'newSession.title': 'Create Session', 'newSession.machine': 'Machine', 'newSession.directory': 'Directory', 'newSession.placeholder': '/path/to/project', diff --git a/web/src/lib/locales/zh-CN.ts b/web/src/lib/locales/zh-CN.ts index 51f99552..9af5990a 100644 --- a/web/src/lib/locales/zh-CN.ts +++ b/web/src/lib/locales/zh-CN.ts @@ -93,6 +93,7 @@ export default { 'button.paste': '粘贴', // New session form + 'newSession.title': '创建会话', 'newSession.machine': '机器', 'newSession.directory': '目录', 'newSession.placeholder': '/path/to/project', diff --git a/web/src/router.tsx b/web/src/router.tsx index 0dd3ad15..ef803000 100644 --- a/web/src/router.tsx +++ b/web/src/router.tsx @@ -332,6 +332,7 @@ function NewSessionPage() { const goBack = useAppGoBack() const queryClient = useQueryClient() const { machines, isLoading: machinesLoading, error: machinesError } = useMachines(api, true) + const { t } = useTranslation() const handleCancel = useCallback(() => { navigate({ to: '/sessions' }) @@ -362,7 +363,7 @@ function NewSessionPage() { )} -
Create Session
+
{t('newSession.title')}
{machinesError ? (