@@ -45,13 +45,13 @@ function getThreadAuthor(thread: CommentsThread) {
4545 ( comment ) => typeof comment . data ?. author === "string" ,
4646 ) ?. data ?. author ;
4747
48- return threadAuthor ?? commentAuthor ?? "Reviewer " ;
48+ return threadAuthor ?? commentAuthor ?? "审阅者 " ;
4949}
5050
5151function getThreadQuote ( thread : CommentsThread ) {
5252 return typeof thread . data ?. quote === "string"
5353 ? thread . data . quote
54- : "No quote stored " ;
54+ : "暂无摘录 " ;
5555}
5656
5757function useCommentsThreads (
@@ -103,10 +103,10 @@ export function CommentsSection() {
103103 createInMemoryCommentsProvider ( commentsDemoThreads ) ,
104104 ) ;
105105 const [ newThreadDraft , setNewThreadDraft ] = useState (
106- "This is a great anchor point. Can we make the user outcome even more explicit? " ,
106+ "这句话已经很接近核心价值了,能不能把用户收益再说得更明确一点? " ,
107107 ) ;
108108 const [ replyDraft , setReplyDraft ] = useState (
109- "Let's keep this as-is for the demo, but call out the overlap behavior. " ,
109+ "这个示例里先保留当前写法,但要把重叠锚点的行为说清楚。 " ,
110110 ) ;
111111 const editor = useEditor ( {
112112 extensions : [
@@ -190,12 +190,12 @@ export function CommentsSection() {
190190 content : draft ,
191191 data : {
192192 author : "Mika" ,
193- label : selectedText . slice ( 0 , 42 ) || "New thread " ,
193+ label : selectedText . slice ( 0 , 42 ) || "新讨论串 " ,
194194 quote : selectedText ,
195195 } ,
196196 commentData : {
197197 author : "Mika" ,
198- role : "Design Review " ,
198+ role : "设计评审 " ,
199199 } ,
200200 } ) ) {
201201 return ;
@@ -216,7 +216,7 @@ export function CommentsSection() {
216216 content : draft ,
217217 data : {
218218 author : "Noah" ,
219- role : "Product " ,
219+ role : "产品 " ,
220220 } ,
221221 } ) ) {
222222 return ;
@@ -229,10 +229,10 @@ export function CommentsSection() {
229229 resetCommentsProvider ( provider ) ;
230230 editor . commands . setContent ( commentsDemoContent ) ;
231231 setNewThreadDraft (
232- "This is a great anchor point. Can we make the user outcome even more explicit? " ,
232+ "这句话已经很接近核心价值了,能不能把用户收益再说得更明确一点? " ,
233233 ) ;
234234 setReplyDraft (
235- "Let's keep this as-is for the demo, but call out the overlap behavior. " ,
235+ "这个示例里先保留当前写法,但要把重叠锚点的行为说清楚。 " ,
236236 ) ;
237237
238238 queueMicrotask ( ( ) => {
@@ -267,22 +267,22 @@ export function CommentsSection() {
267267 < div className = "ui-shell comments-editor-card border border-[var(--panel-border)]" >
268268 < div className = "comments-card__header" >
269269 < div >
270- < div className = "panel-eyebrow" > Comments </ div >
271- < h2 > Inline review threads with overlapping anchors </ h2 >
270+ < div className = "panel-eyebrow" > 评论 </ div >
271+ < h2 > 支持重叠锚点的行内审阅讨论 </ h2 >
272272 < p >
273- 选中文本创建 thread ,侧栏直接回复、resolve 或归档。文档里的高亮和右侧线程面板保持双向联动 。
273+ 选中文本创建讨论串 ,侧栏直接回复、标记解决或归档。文档里的高亮与右侧讨论面板保持双向联动 。
274274 </ p >
275275 </ div >
276276 < div className = "comments-stat-strip" >
277- < span > { activeThreads . filter ( ( thread ) => ! thread . resolved ) . length } open </ span >
278- < span > { activeThreads . filter ( ( thread ) => thread . resolved ) . length } resolved </ span >
277+ < span > { activeThreads . filter ( ( thread ) => ! thread . resolved ) . length } 个未解决 </ span >
278+ < span > { activeThreads . filter ( ( thread ) => thread . resolved ) . length } 个已解决 </ span >
279279 < button
280280 className = "comments-ghost-button"
281281 onClick = { resetDemo }
282282 type = "button"
283283 >
284284 < RotateCcw size = { 15 } strokeWidth = { 2 } />
285- < span > Reset demo </ span >
285+ < span > 重置演示 </ span >
286286 </ button >
287287 </ div >
288288 </ div >
@@ -294,7 +294,7 @@ export function CommentsSection() {
294294 { " " }
295295 { editorMeta . hasSelection
296296 ? `“${ editorMeta . selectedText . trim ( ) } ”`
297- : "先在正文里选一段文字,再创建 thread " }
297+ : "先在正文里选一段文字,再创建讨论串 " }
298298 </ span >
299299 </ div >
300300
@@ -308,21 +308,21 @@ export function CommentsSection() {
308308 < section className = "ui-shell comments-panel border border-[var(--panel-border)]" >
309309 < div className = "comments-panel__header" >
310310 < div >
311- < div className = "panel-eyebrow" > Selection Composer </ div >
312- < h3 > Start a new thread </ h3 >
311+ < div className = "panel-eyebrow" > 选区发起 </ div >
312+ < h3 > 新建讨论串 </ h3 >
313313 </ div >
314314 </ div >
315315
316316 < div className = "comments-selection-quote" >
317317 { editorMeta . hasSelection
318318 ? `“${ editorMeta . selectedText . trim ( ) } ”`
319- : "Select text in the editor to create a new discussion thread. " }
319+ : "在编辑器中选中文本后,就可以为这段内容发起新讨论。 " }
320320 </ div >
321321
322322 < textarea
323323 className = "comments-textarea"
324324 onChange = { ( event ) => setNewThreadDraft ( event . target . value ) }
325- placeholder = "Write the opening note for this selection ..."
325+ placeholder = "为这段选区写下第一条评论 ..."
326326 rows = { 4 }
327327 value = { newThreadDraft }
328328 />
@@ -334,18 +334,18 @@ export function CommentsSection() {
334334 type = "button"
335335 >
336336 < MessageSquarePlus size = { 16 } strokeWidth = { 2 } />
337- < span > Create thread </ span >
337+ < span > 创建讨论串 </ span >
338338 </ button >
339339 </ section >
340340
341341 < section className = "ui-shell comments-panel border border-[var(--panel-border)]" >
342342 < div className = "comments-panel__header" >
343343 < div >
344- < div className = "panel-eyebrow" > Thread List </ div >
345- < h3 > Live discussion map </ h3 >
344+ < div className = "panel-eyebrow" > 讨论列表 </ div >
345+ < h3 > 实时讨论概览 </ h3 >
346346 </ div >
347347 < span className = "comments-panel__meta" >
348- { activeThreads . length } active
348+ { activeThreads . length } 个进行中
349349 </ span >
350350 </ div >
351351
@@ -369,33 +369,33 @@ export function CommentsSection() {
369369 thread . resolved ? " is-resolved" : " is-open"
370370 } `}
371371 >
372- { thread . resolved ? "Resolved " : "Open " }
372+ { thread . resolved ? "已解决 " : "未解决 " }
373373 </ span >
374374 </ div >
375375 < p > { getThreadQuote ( thread ) } </ p >
376376 < div className = "comments-thread-card__meta" >
377377 < span > { getThreadAuthor ( thread ) } </ span >
378- < span > { thread . comments . length } comments </ span >
378+ < span > { thread . comments . length } 条评论 </ span >
379379 </ div >
380380 </ button >
381381 ) ) }
382382
383383 { ! activeThreads . length && (
384384 < div className = "comments-empty-state" >
385- No active threads yet.
385+ 还没有进行中的讨论。
386386 </ div >
387387 ) }
388388 </ div >
389389
390390 { archivedThreads . length > 0 && (
391391 < div className = "comments-archived-list" >
392392 < div className = "comments-archived-list__title" >
393- Archived
393+ 已归档
394394 </ div >
395395 { archivedThreads . map ( ( thread ) => (
396396 < div key = { thread . id } className = "comments-archived-item" >
397397 < strong > { thread . data ?. label ?? thread . id } </ strong >
398- < span > { thread . comments . length } comments </ span >
398+ < span > { thread . comments . length } 条评论 </ span >
399399 </ div >
400400 ) ) }
401401 </ div >
@@ -405,13 +405,12 @@ export function CommentsSection() {
405405 < section className = "ui-shell comments-panel border border-[var(--panel-border)]" >
406406 < div className = "comments-panel__header" >
407407 < div >
408- < div className = "panel-eyebrow" > Selected Thread </ div >
409- < h3 > { selectedThread ?. data ?. label ?? "Inspect discussion state " } </ h3 >
408+ < div className = "panel-eyebrow" > 当前讨论 </ div >
409+ < h3 > { selectedThread ?. data ?. label ?? "查看讨论详情 " } </ h3 >
410410 </ div >
411411 { selectedThread && (
412412 < span className = "comments-panel__meta" >
413- { selectedThreadOccurrences } anchor
414- { selectedThreadOccurrences === 1 ? "" : "s" }
413+ { selectedThreadOccurrences } 个锚点
415414 </ span >
416415 ) }
417416 </ div >
@@ -423,7 +422,7 @@ export function CommentsSection() {
423422 selectedThread . resolved ? " is-resolved" : " is-open"
424423 } `}
425424 >
426- { selectedThread . resolved ? "Resolved " : "Open " }
425+ { selectedThread . resolved ? "已解决 " : "未解决 " }
427426 </ span >
428427 < span > { formatTimestamp ( selectedThread . updatedAt ) } </ span >
429428 </ div >
@@ -451,7 +450,7 @@ export function CommentsSection() {
451450 < textarea
452451 className = "comments-textarea"
453452 onChange = { ( event ) => setReplyDraft ( event . target . value ) }
454- placeholder = "Reply to the selected thread ..."
453+ placeholder = "回复当前讨论 ..."
455454 rows = { 3 }
456455 value = { replyDraft }
457456 />
@@ -464,7 +463,7 @@ export function CommentsSection() {
464463 type = "button"
465464 >
466465 < MessageCircleReply size = { 16 } strokeWidth = { 2 } />
467- < span > Reply </ span >
466+ < span > 回复 </ span >
468467 </ button >
469468
470469 < button
@@ -482,7 +481,7 @@ export function CommentsSection() {
482481 < CheckCheck size = { 16 } strokeWidth = { 2 } />
483482 ) }
484483 < span >
485- { selectedThread . resolved ? "Reopen " : "Resolve " }
484+ { selectedThread . resolved ? "重新打开 " : "标记已解决 " }
486485 </ span >
487486 </ button >
488487
@@ -492,13 +491,13 @@ export function CommentsSection() {
492491 type = "button"
493492 >
494493 < Archive size = { 16 } strokeWidth = { 2 } />
495- < span > Archive </ span >
494+ < span > 归档 </ span >
496495 </ button >
497496 </ div >
498497 </ div >
499498 ) : (
500499 < div className = "comments-empty-state comments-empty-state--detail" >
501- Click a highlighted range or choose a thread from the list to inspect its discussion.
500+ 点击正文中的高亮范围,或从列表里选择一个讨论,即可查看详细内容。
502501 </ div >
503502 ) }
504503 </ section >
0 commit comments