-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopencode-zh.patch
More file actions
2249 lines (2207 loc) · 177 KB
/
Copy pathopencode-zh.patch
File metadata and controls
2249 lines (2207 loc) · 177 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx
index 29cca13..405ec9c 100644
--- a/packages/opencode/src/cli/cmd/tui/app.tsx
+++ b/packages/opencode/src/cli/cmd/tui/app.tsx
@@ -335,7 +335,7 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
if (!text || text.length === 0) return
await Clipboard.copy(text)
- .then(() => toast.show({ message: "Copied to clipboard", variant: "info" }))
+ .then(() => toast.show({ message: "宸插鍒跺埌鍓创鏉?, variant: "info" }))
.catch(toast.error)
renderer.clearSelection()
@@ -408,7 +408,7 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
if (result.data?.id) {
route.navigate({ type: "session", sessionID: result.data.id })
} else {
- toast.show({ message: "Failed to fork session", variant: "error" })
+ toast.show({ message: "鍒嗗弶浼氳瘽澶辫触", variant: "error" })
}
})
} else {
@@ -428,7 +428,7 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
if (result.data?.id) {
route.navigate({ type: "session", sessionID: result.data.id })
} else {
- toast.show({ message: "Failed to fork session", variant: "error" })
+ toast.show({ message: "鍒嗗弶浼氳瘽澶辫触", variant: "error" })
}
})
})
@@ -449,8 +449,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
[
{
name: "command.palette.show",
- title: "Show command palette",
- category: "System",
+ title: "鏄剧ず鍛戒护闈㈡澘",
+ category: "绯荤粺",
hidden: true,
run: () => {
command.show()
@@ -458,8 +458,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "session.list",
- title: "Switch session",
- category: "Session",
+ title: "鍒囨崲浼氳瘽",
+ category: "浼氳瘽",
suggested: sync.data.session.length > 0,
slashName: "sessions",
slashAliases: ["resume", "continue"],
@@ -469,9 +469,9 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "session.new",
- title: "New session",
+ title: "鏂板缓浼氳瘽",
suggested: route.data.type === "session",
- category: "Session",
+ category: "浼氳瘽",
slashName: "new",
slashAliases: ["clear"],
run: () => {
@@ -485,8 +485,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
? [
{
name: "session.cycle_recent",
- title: "Cycle to previous recent session",
- category: "Session",
+ title: "鍒囨崲鍒颁笂涓€涓渶杩戜細璇?,
+ category: "浼氳瘽",
hidden: true,
run: () => {
local.session.cycleRecent(1)
@@ -494,8 +494,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "session.cycle_recent_reverse",
- title: "Cycle to next recent session",
- category: "Session",
+ title: "鍒囨崲鍒颁笅涓€涓渶杩戜細璇?,
+ category: "浼氳瘽",
hidden: true,
run: () => {
local.session.cycleRecent(-1)
@@ -503,8 +503,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
...Array.from({ length: 9 }, (_, i) => ({
name: `session.quick_switch.${i + 1}`,
- title: `Switch to session in quick slot ${i + 1}`,
- category: "Session",
+ title: `鍒囨崲鍒板揩鎹锋Ы ${i + 1} 鐨勪細璇漙,
+ category: "浼氳瘽",
hidden: true,
run: () => {
local.session.quickSwitch(i + 1)
@@ -514,9 +514,9 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
: []),
{
name: "model.list",
- title: "Switch model",
+ title: "鍒囨崲妯″瀷",
suggested: true,
- category: "Agent",
+ category: "浠g悊",
slashName: "models",
run: () => {
dialog.replace(() => <DialogModel />)
@@ -524,8 +524,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "model.cycle_recent",
- title: "Model cycle",
- category: "Agent",
+ title: "寰幆鍒囨崲妯″瀷",
+ category: "浠g悊",
hidden: true,
run: () => {
local.model.cycle(1)
@@ -533,8 +533,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "model.cycle_recent_reverse",
- title: "Model cycle reverse",
- category: "Agent",
+ title: "鍙嶅悜寰幆鍒囨崲妯″瀷",
+ category: "浠g悊",
hidden: true,
run: () => {
local.model.cycle(-1)
@@ -542,8 +542,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "model.cycle_favorite",
- title: "Favorite cycle",
- category: "Agent",
+ title: "寰幆鍒囨崲鏀惰棌",
+ category: "浠g悊",
hidden: true,
run: () => {
local.model.cycleFavorite(1)
@@ -551,8 +551,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "model.cycle_favorite_reverse",
- title: "Favorite cycle reverse",
- category: "Agent",
+ title: "鍙嶅悜寰幆鍒囨崲鏀惰棌",
+ category: "浠g悊",
hidden: true,
run: () => {
local.model.cycleFavorite(-1)
@@ -560,8 +560,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "agent.list",
- title: "Switch agent",
- category: "Agent",
+ title: "鍒囨崲浠g悊",
+ category: "浠g悊",
slashName: "agents",
run: () => {
dialog.replace(() => <DialogAgent />)
@@ -569,8 +569,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "mcp.list",
- title: "Toggle MCPs",
- category: "Agent",
+ title: "鍒囨崲 MCP",
+ category: "浠g悊",
slashName: "mcps",
run: () => {
dialog.replace(() => <DialogMcp />)
@@ -578,8 +578,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "agent.cycle",
- title: "Agent cycle",
- category: "Agent",
+ title: "寰幆鍒囨崲浠g悊",
+ category: "浠g悊",
hidden: true,
run: () => {
local.agent.move(1)
@@ -587,16 +587,16 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "variant.cycle",
- title: "Variant cycle",
- category: "Agent",
+ title: "寰幆鍒囨崲鍙樹綋",
+ category: "浠g悊",
run: () => {
local.model.variant.cycle()
},
},
{
name: "variant.list",
- title: "Switch model variant",
- category: "Agent",
+ title: "鍒囨崲妯″瀷鍙樹綋",
+ category: "浠g悊",
hidden: local.model.variant.list().length === 0,
slashName: "variants",
run: () => {
@@ -605,8 +605,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "agent.cycle.reverse",
- title: "Agent cycle reverse",
- category: "Agent",
+ title: "鍙嶅悜寰幆鍒囨崲浠g悊",
+ category: "浠g悊",
hidden: true,
run: () => {
local.agent.move(-1)
@@ -614,69 +614,69 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "provider.connect",
- title: "Connect provider",
+ title: "杩炴帴鎻愪緵鍟?,
suggested: !connected(),
slashName: "connect",
run: () => {
dialog.replace(() => <DialogProviderList />)
},
- category: "Provider",
+ category: "鎻愪緵鍟?,
},
...(sync.data.console_state.switchableOrgCount > 1
? [
{
name: "console.org.switch",
- title: "Switch org",
+ title: "鍒囨崲缁勭粐",
suggested: Boolean(sync.data.console_state.activeOrgName),
slashName: "org",
slashAliases: ["orgs", "switch-org"],
run: () => {
dialog.replace(() => <DialogConsoleOrg />)
},
- category: "Provider",
+ category: "鎻愪緵鍟?,
},
]
: []),
{
name: "opencode.status",
- title: "View status",
+ title: "鏌ョ湅鐘舵€?,
slashName: "status",
run: () => {
dialog.replace(() => <DialogStatus />)
},
- category: "System",
+ category: "绯荤粺",
},
{
name: "theme.switch",
- title: "Switch theme",
+ title: "鍒囨崲涓婚",
slashName: "themes",
run: () => {
dialog.replace(() => <DialogThemeList />)
},
- category: "System",
+ category: "绯荤粺",
},
{
name: "theme.switch_mode",
- title: mode() === "dark" ? "Switch to light mode" : "Switch to dark mode",
+ title: mode() === "dark" ? "鍒囨崲鍒颁寒鑹叉ā寮? : "鍒囨崲鍒版殫鑹叉ā寮?,
run: () => {
setMode(mode() === "dark" ? "light" : "dark")
dialog.clear()
},
- category: "System",
+ category: "绯荤粺",
},
{
name: "theme.mode.lock",
- title: locked() ? "Unlock theme mode" : "Lock theme mode",
+ title: locked() ? "瑙i攣涓婚妯″紡" : "閿佸畾涓婚妯″紡",
run: () => {
if (locked()) unlock()
else lock()
dialog.clear()
},
- category: "System",
+ category: "绯荤粺",
},
{
name: "help.show",
- title: "Help",
+ title: "甯姪",
slashName: "help",
run: () => {
dialog.replace(() => <DialogHelp />)
@@ -685,25 +685,25 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "docs.open",
- title: "Open docs",
+ title: "鎵撳紑鏂囨。",
run: () => {
open("https://opencode.ai/docs").catch(() => {})
dialog.clear()
},
- category: "System",
+ category: "绯荤粺",
},
{
name: "app.exit",
- title: "Exit the app",
+ title: "閫€鍑哄簲鐢?,
slashName: "exit",
slashAliases: ["quit", "q"],
run: () => exit(),
- category: "System",
+ category: "绯荤粺",
},
{
name: "app.debug",
- title: "Toggle debug panel",
- category: "System",
+ title: "鍒囨崲璋冭瘯闈㈡澘",
+ category: "绯荤粺",
run: () => {
renderer.toggleDebugOverlay()
dialog.clear()
@@ -711,8 +711,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "app.console",
- title: "Toggle console",
- category: "System",
+ title: "鍒囨崲鎺у埗鍙?,
+ category: "绯荤粺",
run: () => {
renderer.console.toggle()
dialog.clear()
@@ -720,8 +720,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "app.heap_snapshot",
- title: "Write heap snapshot",
- category: "System",
+ title: "鍐欏叆鍫嗗揩鐓?,
+ category: "绯荤粺",
run: async () => {
const files = await props.onSnapshot?.()
toast.show({
@@ -734,8 +734,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "terminal.suspend",
- title: "Suspend terminal",
- category: "System",
+ title: "鎸傝捣缁堢",
+ category: "绯荤粺",
hidden: true,
enabled: process.platform !== "win32",
run: () => {
@@ -749,8 +749,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "terminal.title.toggle",
- title: terminalTitleEnabled() ? "Disable terminal title" : "Enable terminal title",
- category: "System",
+ title: terminalTitleEnabled() ? "绂佺敤缁堢鏍囬" : "鍚敤缁堢鏍囬",
+ category: "绯荤粺",
run: () => {
setTerminalTitleEnabled((prev) => {
const next = !prev
@@ -763,8 +763,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "app.toggle.animations",
- title: kv.get("animations_enabled", true) ? "Disable animations" : "Enable animations",
- category: "System",
+ title: kv.get("animations_enabled", true) ? "绂佺敤鍔ㄧ敾" : "鍚敤鍔ㄧ敾",
+ category: "绯荤粺",
run: () => {
kv.set("animations_enabled", !kv.get("animations_enabled", true))
dialog.clear()
@@ -772,8 +772,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "app.toggle.file_context",
- title: kv.get("file_context_enabled", true) ? "Disable file context" : "Enable file context",
- category: "System",
+ title: kv.get("file_context_enabled", true) ? "绂佺敤鏂囦欢涓婁笅鏂? : "鍚敤鏂囦欢涓婁笅鏂?,
+ category: "绯荤粺",
run: () => {
kv.set("file_context_enabled", !kv.get("file_context_enabled", true))
dialog.clear()
@@ -781,8 +781,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "app.toggle.diffwrap",
- title: kv.get("diff_wrap_mode", "word") === "word" ? "Disable diff wrapping" : "Enable diff wrapping",
- category: "System",
+ title: kv.get("diff_wrap_mode", "word") === "word" ? "绂佺敤宸紓鎹㈣" : "鍚敤宸紓鎹㈣",
+ category: "绯荤粺",
run: () => {
const current = kv.get("diff_wrap_mode", "word")
kv.set("diff_wrap_mode", current === "word" ? "none" : "word")
@@ -791,8 +791,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
},
{
name: "app.toggle.paste_summary",
- title: pasteSummaryEnabled() ? "Disable paste summary" : "Enable paste summary",
- category: "System",
+ title: pasteSummaryEnabled() ? "绂佺敤绮樿创鎽樿" : "鍚敤绮樿创鎽樿",
+ category: "绯荤粺",
run: () => {
setPasteSummaryEnabled((prev) => {
const next = !prev
@@ -805,9 +805,9 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
{
name: "app.toggle.session_directory_filter",
title: kv.get("session_directory_filter_enabled", true)
- ? "Disable session directory filtering"
- : "Enable session directory filtering",
- category: "System",
+ ? "绂佺敤浼氳瘽鐩綍杩囨护"
+ : "鍚敤浼氳瘽鐩綍杩囨护",
+ category: "绯荤粺",
run: async () => {
kv.set("session_directory_filter_enabled", !kv.get("session_directory_filter_enabled", true))
await sync.session.refresh()
@@ -872,7 +872,7 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
route.navigate({ type: "home" })
toast.show({
variant: "info",
- message: "The current session was deleted",
+ message: "褰撳墠浼氳瘽宸茶鍒犻櫎",
})
}
})
@@ -897,8 +897,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
const choice = await DialogConfirm.show(
dialog,
- `Update Available`,
- `A new release v${version} is available. Would you like to update now?`,
+ `鏇存柊鍙敤`,
+ `鏂扮増鏈?v${version} 宸插彂甯冦€傛槸鍚︾珛鍗虫洿鏂帮紵`,
"skip",
)
@@ -911,7 +911,7 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
toast.show({
variant: "info",
- message: `Updating to v${version}...`,
+ message: `姝e湪鏇存柊鍒?v${version}...`,
duration: 30000,
})
@@ -920,8 +920,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
if (result.error || !result.data?.success) {
toast.show({
variant: "error",
- title: "Update Failed",
- message: "Update failed",
+ title: "鏇存柊澶辫触",
+ message: "鏇存柊澶辫触",
duration: 10000,
})
return
@@ -929,8 +929,8 @@ function App(props: { onSnapshot?: () => Promise<string[]> }) {
await DialogAlert.show(
dialog,
- "Update Complete",
- `Successfully updated to OpenCode v${result.data.version}. Please restart the application.`,
+ "鏇存柊瀹屾垚",
+ `宸叉垚鍔熸洿鏂板埌 OpenCode v${result.data.version}銆傝閲嶅惎搴旂敤銆俙,
)
void exit()
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx
index 017e52d..9ea7a41 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx
@@ -19,7 +19,7 @@ export function DialogAgent() {
return (
<DialogSelect
- title="Select agent"
+ title="閫夋嫨浠g悊"
current={local.agent.current()?.name}
options={options()}
onSelect={(option) => {
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-console-org.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-console-org.tsx
index eaf3450..733477c 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-console-org.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-console-org.tsx
@@ -37,7 +37,7 @@ export function DialogConsoleOrg() {
if (listed === undefined) {
return [
{
- title: "Loading orgs...",
+ title: "鍔犺浇缁勭粐...",
value: "loading",
onSelect: () => {},
},
@@ -47,7 +47,7 @@ export function DialogConsoleOrg() {
if (listed.length === 0) {
return [
{
- title: "No orgs found",
+ title: "鏈壘鍒扮粍缁?,
value: "empty",
onSelect: () => {},
},
@@ -91,7 +91,7 @@ export function DialogConsoleOrg() {
await sdk.client.instance.dispose()
toast.show({
- message: `Switched to ${item.orgName}`,
+ message: `宸插垏鎹㈠埌 ${item.orgName}`,
variant: "info",
})
dialog.clear()
@@ -99,5 +99,5 @@ export function DialogConsoleOrg() {
}))
})
- return <DialogSelect<string | OrgOption> title="Switch org" options={options()} current={current()} />
+ return <DialogSelect<string | OrgOption> title="鍒囨崲缁勭粐" options={options()} current={current()} />
}
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-mcp.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-mcp.tsx
index c577d49..e629a01 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-mcp.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-mcp.tsx
@@ -10,12 +10,12 @@ import { useSDK } from "@tui/context/sdk"
function Status(props: { enabled: boolean; loading: boolean }) {
const { theme } = useTheme()
if (props.loading) {
- return <span style={{ fg: theme.textMuted }}>鈰?Loading</span>
+ return <span style={{ fg: theme.textMuted }}>鈰?鍔犺浇涓?/span>
}
if (props.enabled) {
- return <span style={{ fg: theme.success, attributes: TextAttributes.BOLD }}>鉁?Enabled</span>
+ return <span style={{ fg: theme.success, attributes: TextAttributes.BOLD }}>鉁?宸插惎鐢?/span>
}
- return <span style={{ fg: theme.textMuted }}>鈼?Disabled</span>
+ return <span style={{ fg: theme.textMuted }}>鈼?宸茬鐢?/span>
}
export function DialogMcp() {
@@ -47,7 +47,7 @@ export function DialogMcp() {
const actions = createMemo(() => [
{
command: "dialog.mcp.toggle",
- title: "toggle",
+ title: "鍒囨崲",
onTrigger: async (option: DialogSelectOption<string>) => {
// Prevent toggling while an operation is already in progress
if (loading() !== null) return
@@ -74,7 +74,7 @@ export function DialogMcp() {
return (
<DialogSelect
ref={setRef}
- title="MCPs"
+ title="MCP"
options={options()}
actions={actions()}
onSelect={(_option) => {
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
index 09c2d64..558dd75 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
@@ -50,12 +50,12 @@ export function DialogModel(props: { providerID?: string }) {
})
}
- const favoriteOptions = toOptions(favorites, "Favorites")
+ const favoriteOptions = toOptions(favorites, "鏀惰棌")
const recentOptions = toOptions(
recents.filter(
(item) => !favorites.some((fav) => fav.providerID === item.providerID && fav.modelID === item.modelID),
),
- "Recent",
+ "鏈€杩?,
)
const providerOptions = pipe(
@@ -74,11 +74,11 @@ export function DialogModel(props: { providerID?: string }) {
value: { providerID: provider.id, modelID: model },
title: info.name ?? model,
description: favorites.some((item) => item.providerID === provider.id && item.modelID === model)
- ? "(Favorite)"
+ ? "(鏀惰棌)"
: undefined,
category: connected() ? provider.name : undefined,
disabled: provider.id === "opencode" && model.includes("-nano"),
- footer: info.cost?.input === 0 && provider.id === "opencode" ? "Free" : undefined,
+ footer: info.cost?.input === 0 && provider.id === "opencode" ? "鍏嶈垂" : undefined,
onSelect() {
onSelect(provider.id, model)
},
@@ -92,7 +92,7 @@ export function DialogModel(props: { providerID?: string }) {
return true
}),
sortBy(
- (x) => x.footer !== "Free",
+ (x) => x.footer !== "鍏嶈垂",
(x) => x.title,
),
),
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
index 2caa67b..776ad26 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
@@ -55,20 +55,20 @@ export function providerOptions(list: { id: string; name: string }[]): ProviderO
value: provider.id,
providerID: provider.id,
description: {
- opencode: "(Recommended)",
- anthropic: "(API key)",
- openai: "(ChatGPT Plus/Pro or API key)",
- "opencode-go": "Low cost subscription for everyone",
+ opencode: "(鎺ㄨ崘)",
+ anthropic: "(API 瀵嗛挜)",
+ openai: "(ChatGPT Plus/Pro 鎴?API 瀵嗛挜)",
+ "opencode-go": "浜轰汉鍙敤鐨勪綆鎴愭湰璁㈤槄",
}[provider.id],
- category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Providers",
+ category: provider.id in PROVIDER_PRIORITY ? "鐑棬" : "鎻愪緵鍟?,
})),
),
{
type: "custom",
- title: "Other",
+ title: "鍏朵粬",
value: CUSTOM_PROVIDER_OPTION_VALUE,
- description: "Custom provider",
- category: "Providers",
+ description: "鑷畾涔夋彁渚涘晢",
+ category: "鎻愪緵鍟?,
},
]
}
@@ -88,11 +88,11 @@ export function createDialogProviderOptions() {
const onboarded = useConnected()
async function promptCustomProviderID(): Promise<string | undefined> {
- const value = await DialogPrompt.show(dialog, "Other", {
- placeholder: "Provider id",
+ const value = await DialogPrompt.show(dialog, "鍏朵粬", {
+ placeholder: "鎻愪緵鍟?ID",
description: () => (
<text fg={theme.textMuted}>
- This only stores a credential. Configure the provider in opencode.json to use it.
+ 杩欏彧浼氬瓨鍌ㄥ嚟鎹€傝鍦?opencode.json 涓厤缃彁渚涘晢浠ヤ娇鐢ㄥ畠銆? </text>
),
})
@@ -103,8 +103,8 @@ export function createDialogProviderOptions() {
toast.show({
variant: "error",
- message:
- "Provider ids must start with a lowercase letter or number and only use lowercase letters, numbers, hyphens, and underscores",
+ message:
+ "鎻愪緵鍟?ID 蹇呴』浠ュ皬鍐欏瓧姣嶆垨鏁板瓧寮€澶达紝涓斾粎浣跨敤灏忓啓瀛楁瘝銆佹暟瀛椼€佽繛瀛楃鍜屼笅鍒掔嚎",
})
return promptCustomProviderID()
}
@@ -122,7 +122,7 @@ export function createDialogProviderOptions() {
async onSelect() {
const providerID = await promptCustomProviderID()
if (!providerID) return
- return dialog.replace(() => <ApiMethod providerID={providerID} title="API key" custom />)
+ return dialog.replace(() => <ApiMethod providerID={providerID} title="API 瀵嗛挜" custom />)
},
}
}
@@ -153,7 +153,7 @@ export function createDialogProviderOptions() {
dialog.replace(
() => (
<DialogSelect
- title="Select auth method"
+ title="閫夋嫨璁よ瘉鏂瑰紡"
options={methods.map((x, index) => ({
title: x.label,
value: index,
@@ -223,7 +223,7 @@ export function createDialogProviderOptions() {
export function DialogProvider() {
const options = createDialogProviderOptions()
- return <DialogSelect title="Connect a provider" options={options()} />
+ return <DialogSelect title="杩炴帴鎻愪緵鍟? options={options()} />
}
interface AutoMethodProps {
@@ -243,13 +243,13 @@ function AutoMethod(props: AutoMethodProps) {
bindings: [
{
key: "c",
- desc: "Copy provider code",
+ desc: "澶嶅埗鎻愪緵鍟嗕唬鐮?,
group: "Dialog",
cmd: () => {
const code =
props.authorization.instructions.match(/[A-Z0-9]{4}-[A-Z0-9]{4,5}/)?.[0] ?? props.authorization.url
Clipboard.copy(code)
- .then(() => toast.show({ message: "Copied to clipboard", variant: "info" }))
+ .then(() => toast.show({ message: "宸插鍒跺埌鍓创鏉?, variant: "info" }))
.catch(toast.error)
},
},
@@ -284,9 +284,9 @@ function AutoMethod(props: AutoMethodProps) {
<Link href={props.authorization.url} fg={theme.primary} />
<text fg={theme.textMuted}>{props.authorization.instructions}</text>
</box>
- <text fg={theme.textMuted}>Waiting for authorization...</text>
+ <text fg={theme.textMuted}>绛夊緟鎺堟潈...</text>
<text fg={theme.text}>
- c <span style={{ fg: theme.textMuted }}>copy</span>
+ c <span style={{ fg: theme.textMuted }}>澶嶅埗</span>
</text>
</box>
)
@@ -308,7 +308,7 @@ function CodeMethod(props: CodeMethodProps) {
return (
<DialogPrompt
title={props.title}
- placeholder="Authorization code"
+ placeholder="鎺堟潈鐮?
onConfirm={async (value) => {
const { error } = await sdk.client.provider.oauth.callback({
providerID: props.providerID,
@@ -328,7 +328,7 @@ function CodeMethod(props: CodeMethodProps) {
<text fg={theme.textMuted}>{props.authorization.instructions}</text>
<Link href={props.authorization.url} fg={theme.primary} />
<Show when={error()}>
- <text fg={theme.error}>Invalid code</text>
+ <text fg={theme.error}>鏃犳晥鐨勪唬鐮?/text>
</Show>
</box>
)}
@@ -352,28 +352,26 @@ function ApiMethod(props: ApiMethodProps) {
return (
<DialogPrompt
title={props.title}
- placeholder="API key"
+ placeholder="API 瀵嗛挜"
description={
{
opencode: (
<box gap={1}>
<text fg={theme.textMuted}>
- OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API
- key.
+ OpenCode Zen 璁╂偍閫氳繃涓€涓?API 瀵嗛挜浠ユ渶浼樻儬鐨勪环鏍艰闂墍鏈夋渶浣崇紪鐮佹ā鍨嬨€? </text>
<text fg={theme.text}>
- Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> to get a key
+ 鍓嶅線 <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> 鑾峰彇瀵嗛挜
</text>
</box>
),
"opencode-go": (
<box gap={1}>
<text fg={theme.textMuted}>
- OpenCode Go is a $10 per month subscription that provides reliable access to popular open coding models
- with generous usage limits.
+ OpenCode Go 鏄瘡鏈?10 缇庡厓鐨勮闃呮湇鍔★紝鎻愪緵瀵规祦琛屽紑婧愮紪鐮佹ā鍨嬬殑鍙潬璁块棶锛屼娇鐢ㄩ搴︽叿鎱ㄣ€? </text>
<text fg={theme.text}>
- Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> and enable OpenCode Go
+ 鍓嶅線 <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> 鍚敤 OpenCode Go
</text>
</box>
),
@@ -394,7 +392,7 @@ function ApiMethod(props: ApiMethodProps) {
if (props.custom && !sync.data.provider_next.all.some((provider) => provider.id === props.providerID)) {
toast.show({
variant: "info",
- message: `Saved credential for ${props.providerID}. Configure it in opencode.json to use it.`,
+ message: `宸蹭繚瀛?${props.providerID} 鐨勫嚟鎹€傝鍦?opencode.json 涓厤缃互浣跨敤瀹冦€俙,
})
dialog.clear()
return
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-retry-action.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-retry-action.tsx
index 6e4db2a..8be6300 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-retry-action.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-retry-action.tsx
@@ -48,25 +48,25 @@ export function DialogRetryAction(props: DialogRetryActionProps) {
bindings: [
{
key: "left",
- desc: "Previous retry option",
+ desc: "涓婁竴涓噸璇曢€夐」",
group: "Dialog",
cmd: () => setSelected((value) => (value === "action" ? "dismiss" : "action")),
},
{
key: "right",
- desc: "Next retry option",
+ desc: "涓嬩竴涓噸璇曢€夐」",
group: "Dialog",
cmd: () => setSelected((value) => (value === "action" ? "dismiss" : "action")),
},
{
key: "tab",
- desc: "Next retry option",
+ desc: "涓嬩竴涓噸璇曢€夐」",
group: "Dialog",
cmd: () => setSelected((value) => (value === "action" ? "dismiss" : "action")),
},
{
key: "return",
- desc: "Confirm retry option",
+ desc: "纭閲嶈瘯閫夐」",
group: "Dialog",
cmd: () => {
if (selected() === "action") runAction(props, dialog)
@@ -123,7 +123,7 @@ export function DialogRetryAction(props: DialogRetryActionProps) {
bg={selected() === "dismiss" ? undefined : textBg()}
attributes={selected() === "dismiss" ? TextAttributes.BOLD : undefined}
>
- don't show again
+ 涓嶅啀鏄剧ず
</text>
</box>
<box
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-session-delete-failed.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-session-delete-failed.tsx
index f3617a5..e2d65a0 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-session-delete-failed.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-session-delete-failed.tsx
@@ -21,14 +21,14 @@ export function DialogSessionDeleteFailed(props: {
const options = [
{
id: "delete" as const,
- title: "Delete workspace",
- description: "Delete the workspace and all sessions attached to it.",
+ title: "鍒犻櫎宸ヤ綔鍖?,
+ description: "鍒犻櫎宸ヤ綔鍖哄強鍏舵墍鏈夊叧鑱旂殑浼氳瘽銆?,
run: props.onDelete,
},
{
id: "restore" as const,
- title: "Restore to new workspace",
- description: "Try to restore this session into a new workspace.",
+ title: "鎭㈠鍒版柊宸ヤ綔鍖?,
+ description: "灏濊瘯灏嗘浼氳瘽鎭㈠鍒版柊鐨勫伐浣滃尯銆?,
run: props.onRestore,
},
]
@@ -42,11 +42,11 @@ export function DialogSessionDeleteFailed(props: {
useBindings(() => ({
bindings: [
- { key: "return", desc: "Confirm recovery option", group: "Dialog", cmd: () => void confirm() },
- { key: "left", desc: "Delete broken session", group: "Dialog", cmd: () => setStore("active", "delete") },
- { key: "up", desc: "Delete broken session", group: "Dialog", cmd: () => setStore("active", "delete") },
- { key: "right", desc: "Restore broken session", group: "Dialog", cmd: () => setStore("active", "restore") },
- { key: "down", desc: "Restore broken session", group: "Dialog", cmd: () => setStore("active", "restore") },
+ { key: "return", desc: "纭鎭㈠閫夐」", group: "Dialog", cmd: () => void confirm() },
+ { key: "left", desc: "鍒犻櫎鎹熷潖鐨勪細璇?, group: "Dialog", cmd: () => setStore("active", "delete") },
+ { key: "up", desc: "鍒犻櫎鎹熷潖鐨勪細璇?, group: "Dialog", cmd: () => setStore("active", "delete") },
+ { key: "right", desc: "鎭㈠鎹熷潖鐨勪細璇?, group: "Dialog", cmd: () => setStore("active", "restore") },
+ { key: "down", desc: "鎭㈠鎹熷潖鐨勪細璇?, group: "Dialog", cmd: () => setStore("active", "restore") },
],
}))
@@ -54,17 +54,17 @@ export function DialogSessionDeleteFailed(props: {
<box paddingLeft={2} paddingRight={2} gap={1}>
<box flexDirection="row" justifyContent="space-between">
<text attributes={TextAttributes.BOLD} fg={theme.text}>
- Failed to Delete Session
+ 鍒犻櫎浼氳瘽澶辫触
</text>
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
esc
</text>
</box>
<text fg={theme.textMuted} wrapMode="word">
- {`The session "${props.session}" could not be deleted because the workspace "${props.workspace}" is not available.`}
+ {`浼氳瘽 "${props.session}" 鏃犳硶鍒犻櫎锛屽洜涓哄伐浣滃尯 "${props.workspace}" 涓嶅彲鐢ㄣ€俙}
</text>
<text fg={theme.textMuted} wrapMode="word">
- Choose how you want to recover this broken workspace session.
+ 璇烽€夋嫨濡備綍鎭㈠姝ゆ崯鍧忕殑宸ヤ綔鍖轰細璇濄€? </text>
<box flexDirection="column" paddingBottom={1} gap={1}>
<For each={options}>
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
index 1dd3310..c07b8c8 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
@@ -188,7 +188,7 @@ export function DialogSessionList() {
? () => <text fg={theme.accent}>{slot}</text>
: undefined
return {
- title: isDeleting ? `Press ${deleteHint()} again to confirm` : x.title,
+ title: isDeleting ? `鍐嶆鎸?${deleteHint()} 纭` : x.title,
bg: isDeleting ? theme.error : undefined,
value: x.id,
category,
@@ -203,13 +203,13 @@ export function DialogSessionList() {
const x = sessionMap.get(id)
if (!x) return undefined
const label = new Date(x.time.updated).toDateString()
- return buildOption(id, label === today ? "Today" : label)
+ return buildOption(id, label === today ? "浠婂ぉ" : label)
})
.filter((x) => x !== undefined)
return [
- ...pinned.map((id) => buildOption(id, "Pinned")).filter((x) => x !== undefined),
- ...recent.map((id) => buildOption(id, "Recent")).filter((x) => x !== undefined),
+ ...pinned.map((id) => buildOption(id, "宸茬疆椤?)).filter((x) => x !== undefined),
+ ...recent.map((id) => buildOption(id, "鏈€杩?)).filter((x) => x !== undefined),
...remaining,
]
})
@@ -220,7 +220,7 @@ export function DialogSessionList() {
return (
<DialogSelect
- title="Sessions"
+ title="浼氳瘽"
options={options()}
skipFilter={true}
current={currentSessionID()}
@@ -240,19 +240,19 @@ export function DialogSessionList() {
? [
{
command: "session.pin.toggle",
- title: "pin/unpin",
+ title: "缃《/鍙栨秷缃《",
onTrigger: (option: { value: string }) => {
local.session.togglePin(option.value)
},
},
{
command: "session.toggle.recent",
- title: "toggle recent",
+ title: "鍒囨崲鏈€杩?,
onTrigger: (option: { value: string }) => {
if (local.session.isPinned(option.value)) {
toast.show({
variant: "info",
- message: "Unpin the session first to toggle it in Recent",
+ message: "璇峰厛鍙栨秷缃《浼氳瘽锛岀劧鍚庢墠鑳藉湪鏈€杩戜腑鍒囨崲",
duration: 3000,
})
return
@@ -264,7 +264,7 @@ export function DialogSessionList() {
: []),
{
command: "session.delete",
- title: "delete",
+ title: "鍒犻櫎",
onTrigger: async (option) => {
if (toDelete() === option.value) {
const session = sessions().find((item) => item.id === option.value)
@@ -280,7 +280,7 @@ export function DialogSessionList() {
} else {
toast.show({
variant: "error",
- title: "Failed to delete session",
+ title: "鍒犻櫎浼氳瘽澶辫触",
message: errorMessage(result.error),
})
}
@@ -312,7 +312,7 @@ export function DialogSessionList() {
},
{
command: "session.rename",
- title: "rename",
+ title: "閲嶅懡鍚?,
onTrigger: async (option) => {
dialog.replace(() => <DialogSessionRename session={option.value} />)
},
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-session-rename.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-session-rename.tsx
index a079941..0336c6d 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-session-rename.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-session-rename.tsx
@@ -16,7 +16,7 @@ export function DialogSessionRename(props: DialogSessionRenameProps) {
return (
<DialogPrompt
- title="Rename Session"
+ title="閲嶅懡鍚嶄細璇?
value={session()?.title}
onConfirm={(value) => {
void sdk.client.session.update({
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-skill.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-skill.tsx
index 4bcd3c7..1d182f8 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-skill.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-skill.tsx
@@ -24,7 +24,7 @@ export function DialogSkill(props: DialogSkillProps) {
title: skill.name.padEnd(maxWidth),