@@ -43,93 +43,97 @@ function readTaskOrchestrationDraftMetrics(taskOrchestration) {
4343 } ;
4444}
4545
46- function createTaskDraftChecklist ( metrics ) {
46+ function translateTaskText ( t , key , fallback , params = null ) {
47+ return typeof t === 'function' ? t ( key , params ) : fallback ;
48+ }
49+
50+ function createTaskDraftChecklist ( metrics , t = null ) {
4751 const workflowReady = metrics . engine !== 'workflow' || metrics . workflowCount > 0 ;
4852 const scopeReady = metrics . hasNotes || ! metrics . allowWrite ;
4953 const previewReady = metrics . hasPlan && metrics . planIssues . length === 0 ;
5054 return [
5155 {
5256 key : 'target' ,
53- label : ' 目标',
57+ label : translateTaskText ( t , 'orchestration.readiness.target.label' , ' 目标') ,
5458 done : metrics . hasTarget ,
55- detail : metrics . hasTarget ? ' 已写目标' : ' 还没写目标'
59+ detail : metrics . hasTarget ? translateTaskText ( t , 'orchestration.readiness.target.done' , ' 已写目标') : translateTaskText ( t , 'orchestration.readiness.target.missing' , ' 还没写目标')
5660 } ,
5761 {
5862 key : 'engine' ,
59- label : metrics . engine === 'workflow' ? 'Workflow' : ' 执行策略',
63+ label : metrics . engine === 'workflow' ? 'Workflow' : translateTaskText ( t , 'orchestration.readiness.engine.label' , ' 执行策略') ,
6064 done : workflowReady ,
6165 detail : metrics . engine === 'workflow'
62- ? ( metrics . workflowCount > 0 ? `已选 ${ metrics . workflowCount } 个 Workflow` : ' 还没选 Workflow ID')
63- : ' 使用 Codex 规划节点'
66+ ? ( metrics . workflowCount > 0 ? translateTaskText ( t , 'orchestration.readiness.workflow.done' , `已选 ${ metrics . workflowCount } 个 Workflow` , { count : metrics . workflowCount } ) : translateTaskText ( t , 'orchestration.readiness.workflow.missing' , ' 还没选 Workflow ID') )
67+ : translateTaskText ( t , 'orchestration.readiness.engine.codex' , ' 使用 Codex 规划节点')
6468 } ,
6569 {
6670 key : 'scope' ,
67- label : ' 边界',
71+ label : translateTaskText ( t , 'orchestration.readiness.scope.label' , ' 边界') ,
6872 done : scopeReady ,
6973 detail : metrics . hasNotes
70- ? ' 已补充说明'
71- : ( metrics . allowWrite ? ' 建议补说明后再写入' : ' 当前是只读,可直接试')
74+ ? translateTaskText ( t , 'orchestration.readiness.scope.done' , ' 已补充说明')
75+ : ( metrics . allowWrite ? translateTaskText ( t , 'orchestration.readiness.scope.writeHint' , ' 建议补说明后再写入') : translateTaskText ( t , 'orchestration.readiness.scope.readonlyHint' , ' 当前是只读,可直接试') )
7276 } ,
7377 {
7478 key : 'preview' ,
75- label : ' 预览',
79+ label : translateTaskText ( t , 'orchestration.readiness.preview.label' , ' 预览') ,
7680 done : previewReady ,
7781 detail : ! metrics . hasPlan
78- ? ' 还没生成计划'
79- : ( metrics . planIssues . length > 0 ? `有 ${ metrics . planIssues . length } 个阻塞项` : `计划可用,${ metrics . planNodeCount } 个节点` )
82+ ? translateTaskText ( t , 'orchestration.readiness.preview.missing' , ' 还没生成计划')
83+ : ( metrics . planIssues . length > 0 ? translateTaskText ( t , 'orchestration.readiness.preview.blocked' , `有 ${ metrics . planIssues . length } 个阻塞项` , { count : metrics . planIssues . length } ) : translateTaskText ( t , 'orchestration.readiness.preview.ready' , `计划可用,${ metrics . planNodeCount } 个节点` , { count : metrics . planNodeCount } ) )
8084 }
8185 ] ;
8286}
8387
84- function createTaskDraftReadiness ( metrics ) {
88+ function createTaskDraftReadiness ( metrics , t = null ) {
8589 if ( ! metrics . hasTarget ) {
8690 return {
8791 tone : 'neutral' ,
88- title : ' 先写目标',
89- summary : ' 先把想完成的结果写清楚,再让编排器拆节点。'
92+ title : translateTaskText ( t , 'orchestration.readiness.empty.title' , ' 先写目标') ,
93+ summary : translateTaskText ( t , 'orchestration.readiness.empty.summary' , ' 先把想完成的结果写清楚,再让编排器拆节点。')
9094 } ;
9195 }
9296 if ( metrics . engine === 'workflow' && metrics . workflowCount === 0 ) {
9397 return {
9498 tone : 'warn' ,
95- title : ' 缺少 Workflow',
96- summary : ' 你已经选了 Workflow 模式,但还没指定可复用流程。'
99+ title : translateTaskText ( t , 'orchestration.readiness.workflow.title' , ' 缺少 Workflow') ,
100+ summary : translateTaskText ( t , 'orchestration.readiness.workflow.summary' , ' 你已经选了 Workflow 模式,但还没指定可复用流程。')
97101 } ;
98102 }
99103 if ( ! metrics . hasPlan ) {
100104 return {
101105 tone : 'warn' ,
102- title : ' 建议先预览',
103- summary : ' 草稿已成形,先生成一次计划,确认节点和依赖再执行。'
106+ title : translateTaskText ( t , 'orchestration.readiness.preview.title' , ' 建议先预览') ,
107+ summary : translateTaskText ( t , 'orchestration.readiness.preview.summary' , ' 草稿已成形,先生成一次计划,确认节点和依赖再执行。')
104108 } ;
105109 }
106110 if ( metrics . planIssues . length > 0 ) {
107111 return {
108112 tone : 'error' ,
109- title : ' 预览有阻塞',
110- summary : `当前计划里还有 ${ metrics . planIssues . length } 个阻塞项,先处理它们。`
113+ title : translateTaskText ( t , 'orchestration.readiness.blocked.title' , ' 预览有阻塞') ,
114+ summary : translateTaskText ( t , 'orchestration.readiness.blocked.summary' , `当前计划里还有 ${ metrics . planIssues . length } 个阻塞项,先处理它们。` , { count : metrics . planIssues . length } )
111115 } ;
112116 }
113117 if ( metrics . planWarnings . length > 0 ) {
114118 return {
115119 tone : 'warn' ,
116- title : ' 可以执行,但有提醒',
117- summary : `计划已生成,但还有 ${ metrics . planWarnings . length } 条提醒值得先看一眼。`
120+ title : translateTaskText ( t , 'orchestration.readiness.warn.title' , ' 可以执行,但有提醒') ,
121+ summary : translateTaskText ( t , 'orchestration.readiness.warn.summary' , `计划已生成,但还有 ${ metrics . planWarnings . length } 条提醒值得先看一眼。` , { count : metrics . planWarnings . length } )
118122 } ;
119123 }
120124 if ( metrics . dryRun ) {
121125 return {
122126 tone : 'success' ,
123- title : ' 适合先预演',
124- summary : ' 现在可以安全地跑一次仅预演,先看结果再决定是否真实执行。'
127+ title : translateTaskText ( t , 'orchestration.readiness.dryRun.title' , ' 适合先预演') ,
128+ summary : translateTaskText ( t , 'orchestration.readiness.dryRun.summary' , ' 现在可以安全地跑一次仅预演,先看结果再决定是否真实执行。')
125129 } ;
126130 }
127131 return {
128132 tone : 'success' ,
129- title : ' 可以执行',
133+ title : translateTaskText ( t , 'orchestration.readiness.ready.title' , ' 可以执行') ,
130134 summary : metrics . followUpCount > 0
131- ? `主目标和收尾动作都已具备,可以直接执行或入队。`
132- : ' 主目标已经够清楚了,可以直接执行或入队。'
135+ ? translateTaskText ( t , 'orchestration.readiness.ready.withFollowUps' , `主目标和收尾动作都已具备,可以直接执行或入队。` )
136+ : translateTaskText ( t , 'orchestration.readiness.ready.summary' , ' 主目标已经够清楚了,可以直接执行或入队。')
133137 } ;
134138}
135139
@@ -144,6 +148,7 @@ export function createMainTabsComputed() {
144148 if ( this . mainTab === 'market' ) return this . t ( 'kicker.market' ) ;
145149 if ( this . mainTab === 'plugins' ) return this . t ( 'kicker.plugins' ) ;
146150 if ( this . mainTab === 'docs' ) return this . t ( 'kicker.docs' ) ;
151+ if ( this . mainTab === 'trash' ) return this . t ( 'kicker.trash' ) ;
147152 return this . t ( 'kicker.settings' ) ;
148153 } ,
149154 mainTabTitle ( ) {
@@ -155,6 +160,7 @@ export function createMainTabsComputed() {
155160 if ( this . mainTab === 'market' ) return this . t ( 'title.market' ) ;
156161 if ( this . mainTab === 'plugins' ) return this . t ( 'title.plugins' ) ;
157162 if ( this . mainTab === 'docs' ) return this . t ( 'title.docs' ) ;
163+ if ( this . mainTab === 'trash' ) return this . t ( 'settings.trash.title' ) ;
158164 return this . t ( 'title.settings' ) ;
159165 } ,
160166 mainTabSubtitle ( ) {
@@ -166,6 +172,7 @@ export function createMainTabsComputed() {
166172 if ( this . mainTab === 'market' ) return this . t ( 'subtitle.market' ) ;
167173 if ( this . mainTab === 'plugins' ) return this . t ( 'subtitle.plugins' ) ;
168174 if ( this . mainTab === 'docs' ) return this . t ( 'subtitle.docs' ) ;
175+ if ( this . mainTab === 'trash' ) return this . t ( 'settings.trash.meta' ) ;
169176 return this . t ( 'subtitle.settings' ) ;
170177 } ,
171178 taskOrchestrationSelectedRun ( ) {
@@ -196,10 +203,10 @@ export function createMainTabsComputed() {
196203 return readTaskOrchestrationDraftMetrics ( this . taskOrchestration ) ;
197204 } ,
198205 taskOrchestrationDraftChecklist ( ) {
199- return createTaskDraftChecklist ( this . taskOrchestrationDraftMetrics ) ;
206+ return createTaskDraftChecklist ( this . taskOrchestrationDraftMetrics , this . t && this . t . bind ( this ) ) ;
200207 } ,
201208 taskOrchestrationDraftReadiness ( ) {
202- return createTaskDraftReadiness ( this . taskOrchestrationDraftMetrics ) ;
209+ return createTaskDraftReadiness ( this . taskOrchestrationDraftMetrics , this . t && this . t . bind ( this ) ) ;
203210 }
204211 } ;
205212}
0 commit comments