cc-switch-tui 0.1.1

All-in-One Assistant for Claude Code, Codex, Gemini, OpenCode, OpenClaw & Hermes
Documentation
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
use super::is_chinese;
pub fn tui_settings_proxy_restart_hint() -> &'static str {
    if is_chinese() {
        "修改监听地址或端口后,需先停止并重新开启本地代理才能生效"
    } else {
        "Changes to listen address or port require stopping and restarting the local proxy"
    }
}

pub fn tui_settings_proxy_stop_before_edit_hint() -> &'static str {
    if is_chinese() {
        "请先停止本地代理,再修改监听地址或端口"
    } else {
        "Stop the local proxy before editing listen address or port"
    }
}

pub fn tui_toast_proxy_listen_address_invalid() -> &'static str {
    if is_chinese() {
        "地址无效,请输入有效的 IPv4 地址、localhost 或 0.0.0.0"
    } else {
        "Invalid address. Enter a valid IPv4 address, localhost, or 0.0.0.0"
    }
}

pub fn tui_toast_proxy_listen_port_invalid() -> &'static str {
    if is_chinese() {
        "端口无效,请输入 1024-65535 之间的数字"
    } else {
        "Invalid port. Enter a number between 1024 and 65535"
    }
}

pub fn tui_toast_proxy_settings_saved() -> &'static str {
    if is_chinese() {
        "本地代理配置已保存。"
    } else {
        "Local proxy settings saved."
    }
}

pub fn tui_toast_proxy_settings_restart_required() -> &'static str {
    if is_chinese() {
        "本地代理正在运行;新监听地址/端口会在重启代理后生效。"
    } else {
        "The local proxy is running; the new listen address/port will apply after restart."
    }
}

pub fn tui_toast_proxy_settings_stop_before_edit() -> &'static str {
    if is_chinese() {
        "本地代理正在运行。请先停止代理,再修改监听地址或端口。"
    } else {
        "The local proxy is running. Stop it before editing listen address or port."
    }
}

pub fn tui_toast_openclaw_config_dir_saved() -> &'static str {
    if is_chinese() {
        "OpenClaw 配置目录已保存。"
    } else {
        "OpenClaw config directory saved."
    }
}

pub fn tui_toast_openclaw_config_dir_sync_skipped() -> &'static str {
    if is_chinese() {
        "目标 OpenClaw 目录尚未初始化;已保存设置,但暂未同步 live 配置。"
    } else {
        "The target OpenClaw directory is not initialized yet; the setting was saved but live sync was skipped."
    }
}

pub fn tui_toast_openclaw_config_dir_sync_failed(err: &str) -> String {
    if is_chinese() {
        format!("OpenClaw 配置目录已保存,但同步 live 配置失败: {err}")
    } else {
        format!("OpenClaw config directory saved, but live sync failed: {err}")
    }
}

pub fn tui_config_title() -> &'static str {
    if is_chinese() {
        "配置"
    } else {
        "Configuration"
    }
}

// ---------------------------------------------------------------------
// Ratatui TUI - Skills
// ---------------------------------------------------------------------

pub fn tui_skills_install_title() -> &'static str {
    if is_chinese() {
        "安装 Skill"
    } else {
        "Install Skill"
    }
}

pub fn tui_skills_install_prompt() -> &'static str {
    if is_chinese() {
        "输入技能目录,或完整标识(owner/name:directory):"
    } else {
        "Enter a skill directory, or a full key (owner/name:directory):"
    }
}

pub fn tui_skills_uninstall_title() -> &'static str {
    if is_chinese() {
        "卸载 Skill"
    } else {
        "Uninstall Skill"
    }
}

pub fn tui_confirm_uninstall_skill_message(name: &str, directory: &str) -> String {
    if is_chinese() {
        format!("确认卸载 '{name}'({directory})?")
    } else {
        format!("Uninstall '{name}' ({directory})?")
    }
}

pub fn tui_skills_discover_title() -> &'static str {
    if is_chinese() {
        "发现 Skills"
    } else {
        "Discover Skills"
    }
}

pub fn tui_skills_discover_prompt() -> &'static str {
    if is_chinese() {
        "输入关键词(留空显示全部):"
    } else {
        "Enter a keyword (leave empty to show all):"
    }
}

pub fn tui_skills_discover_query_empty() -> &'static str {
    if is_chinese() {
        "全部"
    } else {
        "all"
    }
}

pub fn tui_skills_discover_hint() -> &'static str {
    if is_chinese() {
        "按 f 搜索仓库里的技能,按 r 管理技能仓库。"
    } else {
        "Press f to search skills from enabled repositories, or r to manage repositories."
    }
}

pub fn tui_skills_repos_title() -> &'static str {
    if is_chinese() {
        "Skill 仓库"
    } else {
        "Skill Repositories"
    }
}

pub fn tui_skills_repos_hint() -> &'static str {
    if is_chinese() {
        "技能发现会从这里已启用的仓库加载列表。"
    } else {
        "Skill discovery loads results from the repositories enabled here."
    }
}

pub fn tui_skills_repos_empty() -> &'static str {
    if is_chinese() {
        "未配置任何 Skill 仓库。按 a 添加。"
    } else {
        "No skill repositories configured. Press a to add."
    }
}

pub fn tui_skills_repos_add_title() -> &'static str {
    if is_chinese() {
        "添加仓库"
    } else {
        "Add Repository"
    }
}

pub fn tui_skills_repos_add_prompt() -> &'static str {
    if is_chinese() {
        "输入 GitHub 仓库(owner/name,可选 @branch)或完整 URL:"
    } else {
        "Enter a GitHub repository (owner/name, optional @branch) or a full URL:"
    }
}

pub fn tui_skills_repos_remove_title() -> &'static str {
    if is_chinese() {
        "移除仓库"
    } else {
        "Remove Repository"
    }
}

pub fn tui_confirm_remove_repo_message(owner: &str, name: &str) -> String {
    let repo = format!("{owner}/{name}");
    if is_chinese() {
        format!("确认移除仓库 '{repo}'?")
    } else {
        format!("Remove repository '{repo}'?")
    }
}

pub fn tui_skills_unmanaged_title() -> &'static str {
    tui_skills_import_title()
}

pub fn tui_skills_import_title() -> &'static str {
    if is_chinese() {
        "导入已有技能"
    } else {
        "Import Existing Skills"
    }
}

pub fn tui_skills_unmanaged_hint() -> &'static str {
    tui_skills_import_description()
}

pub fn tui_skills_import_description() -> &'static str {
    if is_chinese() {
        "选择要导入到 CC Switch 统一管理的技能。"
    } else {
        "Select skills to import into CC Switch unified management."
    }
}

pub fn tui_skills_unmanaged_empty() -> &'static str {
    if is_chinese() {
        "未发现可导入的技能。"
    } else {
        "No skills to import found."
    }
}

pub fn tui_skills_detail_title() -> &'static str {
    if is_chinese() {
        "Skill 详情"
    } else {
        "Skill Detail"
    }
}

pub fn tui_skill_not_found() -> &'static str {
    if is_chinese() {
        "未找到该 Skill。"
    } else {
        "Skill not found."
    }
}

pub fn tui_skills_sync_method_label() -> &'static str {
    if is_chinese() {
        "同步方式"
    } else {
        "Sync"
    }
}

pub fn tui_skills_sync_method_title() -> &'static str {
    if is_chinese() {
        "选择同步方式"
    } else {
        "Select Sync Method"
    }
}

pub fn tui_skills_sync_method_name(method: crate::services::skill::SyncMethod) -> &'static str {
    match method {
        crate::services::skill::SyncMethod::Auto => {
            if is_chinese() {
                "自动(优先使用链接,失败时复制)"
            } else {
                "Automatic (prefer links, fall back to copy)"
            }
        }
        crate::services::skill::SyncMethod::Symlink => {
            if is_chinese() {
                "仅链接"
            } else {
                "Links only"
            }
        }
        crate::services::skill::SyncMethod::Copy => {
            if is_chinese() {
                "仅复制"
            } else {
                "Copy only"
            }
        }
    }
}

pub fn tui_skills_installed_summary(installed: usize, enabled: usize, app: &str) -> String {
    if is_chinese() {
        format!("已安装: {installed}   当前应用({app})已启用: {enabled}")
    } else {
        format!("Installed: {installed}   Enabled for {app}: {enabled}")
    }
}

pub fn tui_skills_installed_counts(
    claude: usize,
    codex: usize,
    gemini: usize,
    opencode: usize,
) -> String {
    if is_chinese() {
        format!(
            "已安装 · Claude: {claude} · Codex: {codex} · Gemini: {gemini} · OpenCode: {opencode}"
        )
    } else {
        format!(
            "Installed · Claude: {claude} · Codex: {codex} · Gemini: {gemini} · OpenCode: {opencode}"
        )
    }
}

pub fn tui_mcp_server_counts(
    claude: usize,
    codex: usize,
    gemini: usize,
    opencode: usize,
    hermes: usize,
) -> String {
    if is_chinese() {
        format!(
            "已安装 · Claude: {claude} · Codex: {codex} · Gemini: {gemini} · OpenCode: {opencode} · Hermes: {hermes}"
        )
    } else {
        format!(
            "Installed · Claude: {claude} · Codex: {codex} · Gemini: {gemini} · OpenCode: {opencode} · Hermes: {hermes}"
        )
    }
}

pub fn tui_mcp_action_import_existing() -> &'static str {
    if is_chinese() {
        "导入已有"
    } else {
        "Import Existing"
    }
}

pub fn tui_skills_action_import_existing() -> &'static str {
    if is_chinese() {
        "导入已有"
    } else {
        "Import Existing"
    }
}

pub fn tui_skills_empty_title() -> &'static str {
    if is_chinese() {
        "暂无已安装的技能"
    } else {
        "No installed skills"
    }
}

pub fn tui_skills_empty_subtitle() -> &'static str {
    if is_chinese() {
        "从仓库发现并安装技能,或导入已有技能。"
    } else {
        "Discover and install skills from repositories, or import existing skills."
    }
}

pub fn tui_skills_empty_hint() -> &'static str {
    if is_chinese() {
        "暂无已安装技能。按 f 发现新技能,或按 i 导入已有技能。"
    } else {
        "No installed skills. Press f to discover skills, or i to import existing skills."
    }
}

pub fn tui_config_item_export() -> &'static str {
    if is_chinese() {
        "导出配置"
    } else {
        "Export Config"
    }
}

pub fn tui_config_item_import() -> &'static str {
    if is_chinese() {
        "导入配置"
    } else {
        "Import Config"
    }
}

pub fn tui_config_item_backup() -> &'static str {
    if is_chinese() {
        "备份配置"
    } else {
        "Backup Config"
    }
}

pub fn tui_config_item_restore() -> &'static str {
    if is_chinese() {
        "恢复配置"
    } else {
        "Restore Config"
    }
}

pub fn tui_config_item_validate() -> &'static str {
    if is_chinese() {
        "验证配置"
    } else {
        "Validate Config"
    }
}

pub fn tui_config_item_common_snippet() -> &'static str {
    if is_chinese() {
        "通用配置片段"
    } else {
        "Common Config Snippet"
    }
}

pub fn tui_config_item_proxy() -> &'static str {
    if is_chinese() {
        "本地代理"
    } else {
        "Local Proxy"
    }
}

pub fn tui_config_item_webdav_sync() -> &'static str {
    if is_chinese() {
        "WebDAV 同步"
    } else {
        "WebDAV Sync"
    }
}

pub fn tui_config_item_webdav_settings() -> &'static str {
    if is_chinese() {
        "WebDAV 同步设置(JSON)"
    } else {
        "WebDAV Sync Settings (JSON)"
    }
}

pub fn tui_config_item_webdav_check_connection() -> &'static str {
    if is_chinese() {
        "WebDAV 检查连接"
    } else {
        "WebDAV Check Connection"
    }
}

pub fn tui_config_item_webdav_upload() -> &'static str {
    if is_chinese() {
        "WebDAV 上传到远端"
    } else {
        "WebDAV Upload to Remote"
    }
}

pub fn tui_config_item_webdav_download() -> &'static str {
    if is_chinese() {
        "WebDAV 下载到本地"
    } else {
        "WebDAV Download to Local"
    }
}

pub fn tui_config_item_webdav_reset() -> &'static str {
    if is_chinese() {
        "重置 WebDAV 配置"
    } else {
        "Reset WebDAV Settings"
    }
}

pub fn tui_config_item_webdav_jianguoyun_quick_setup() -> &'static str {
    if is_chinese() {
        "坚果云一键配置"
    } else {
        "Jianguoyun Quick Setup"
    }
}

pub fn tui_webdav_settings_editor_title() -> &'static str {
    if is_chinese() {
        "编辑 WebDAV 同步设置(JSON)"
    } else {
        "Edit WebDAV Sync Settings (JSON)"
    }
}

pub fn tui_config_webdav_title() -> &'static str {
    if is_chinese() {
        "WebDAV 同步"
    } else {
        "WebDAV Sync"
    }
}

pub fn tui_webdav_jianguoyun_setup_title() -> &'static str {
    if is_chinese() {
        "坚果云一键配置"
    } else {
        "Jianguoyun Quick Setup"
    }
}

pub fn tui_webdav_jianguoyun_username_prompt() -> &'static str {
    if is_chinese() {
        "请输入坚果云账号(通常是邮箱):"
    } else {
        "Enter your Jianguoyun account (usually email):"
    }
}

pub fn tui_webdav_jianguoyun_app_password_prompt() -> &'static str {
    if is_chinese() {
        "请输入坚果云第三方应用密码:"
    } else {
        "Enter your Jianguoyun app password:"
    }
}

pub fn tui_webdav_loading_title_check_connection() -> &'static str {
    if is_chinese() {
        "WebDAV 检查连接"
    } else {
        "WebDAV Check Connection"
    }
}

pub fn tui_webdav_loading_title_upload() -> &'static str {
    if is_chinese() {
        "WebDAV 上传"
    } else {
        "WebDAV Upload"
    }
}

pub fn tui_webdav_loading_title_download() -> &'static str {
    if is_chinese() {
        "WebDAV 下载"
    } else {
        "WebDAV Download"
    }
}

pub fn tui_webdav_loading_title_quick_setup() -> &'static str {
    if is_chinese() {
        "坚果云一键配置"
    } else {
        "Jianguoyun Quick Setup"
    }
}

pub fn tui_webdav_loading_message() -> &'static str {
    if is_chinese() {
        "正在处理 WebDAV 请求,请稍候…"
    } else {
        "Processing WebDAV request, please wait..."
    }
}

pub fn tui_config_item_reset() -> &'static str {
    if is_chinese() {
        "重置配置"
    } else {
        "Reset Config"
    }
}

pub fn tui_config_item_show_full() -> &'static str {
    if is_chinese() {
        "查看完整配置"
    } else {
        "Show Full Config"
    }
}

pub fn tui_config_item_show_path() -> &'static str {
    if is_chinese() {
        "显示配置路径"
    } else {
        "Show Config Path"
    }
}

pub fn tui_hint_esc_close() -> &'static str {
    if is_chinese() {
        "Esc = 关闭"
    } else {
        "Esc = Close"
    }
}

pub fn tui_hint_enter_submit_esc_cancel() -> &'static str {
    if is_chinese() {
        "Enter = 提交, Esc = 取消"
    } else {
        "Enter = Submit, Esc = Cancel"
    }
}

pub fn tui_hint_enter_restore_esc_cancel() -> &'static str {
    if is_chinese() {
        "Enter = 恢复, Esc = 取消"
    } else {
        "Enter = restore, Esc = cancel"
    }
}

pub fn tui_backup_picker_title() -> &'static str {
    if is_chinese() {
        "选择备份(Enter 恢复)"
    } else {
        "Select Backup (Enter to restore)"
    }
}

pub fn tui_speedtest_running(url: &str) -> String {
    if is_chinese() {
        format!("正在测速: {}", url)
    } else {
        format!("Running: {}", url)
    }
}

pub fn tui_speedtest_title_with_url(url: &str) -> String {
    if is_chinese() {
        format!("测速: {}", url)
    } else {
        format!("Speedtest: {}", url)
    }
}

pub fn tui_stream_check_running(provider_name: &str) -> String {
    if is_chinese() {
        format!("正在检查: {}", provider_name)
    } else {
        format!("Checking: {}", provider_name)
    }
}

pub fn tui_stream_check_title_with_provider(provider_name: &str) -> String {
    if is_chinese() {
        format!("健康检查: {}", provider_name)
    } else {
        format!("Stream Check: {}", provider_name)
    }
}

pub fn tui_toast_provider_already_in_use() -> &'static str {
    if is_chinese() {
        "已在使用该供应商。"
    } else {
        "Already using this provider."
    }
}

pub fn tui_toast_provider_cannot_delete_current() -> &'static str {
    if is_chinese() {
        "不能删除当前供应商。"
    } else {
        "Cannot delete current provider."
    }
}

pub fn tui_confirm_delete_provider_title() -> &'static str {
    if is_chinese() {
        "删除供应商"
    } else {
        "Delete Provider"
    }
}

pub fn tui_confirm_delete_provider_message(name: &str, id: &str) -> String {
    if is_chinese() {
        format!("确定删除供应商 '{}' ({})?", name, id)
    } else {
        format!("Delete provider '{}' ({})?", name, id)
    }
}

pub fn tui_mcp_add_title() -> &'static str {
    if is_chinese() {
        "新增 MCP 服务器"
    } else {
        "Add MCP Server"
    }
}

pub fn tui_mcp_edit_title(name: &str) -> String {
    if is_chinese() {
        format!("编辑 MCP 服务器: {}", name)
    } else {
        format!("Edit MCP Server: {}", name)
    }
}

pub fn tui_mcp_apps_title(name: &str) -> String {
    if is_chinese() {
        format!("选择 MCP 应用: {}", name)
    } else {
        format!("Select MCP Apps: {}", name)
    }
}

pub fn tui_mcp_env_title() -> &'static str {
    if is_chinese() {
        "MCP 环境变量"
    } else {
        "MCP Env"
    }
}

pub fn tui_mcp_env_add_entry_title() -> &'static str {
    if is_chinese() {
        "新增环境变量"
    } else {
        "Add Env Entry"
    }
}

pub fn tui_mcp_env_edit_entry_title() -> &'static str {
    if is_chinese() {
        "编辑环境变量"
    } else {
        "Edit Env Entry"
    }
}

pub fn tui_mcp_env_empty_state() -> &'static str {
    if is_chinese() {
        "暂无环境变量,按 a 新增。"
    } else {
        "No env entries yet. Press a to add one."
    }
}

pub fn tui_skill_apps_title(name: &str) -> String {
    if is_chinese() {
        format!("选择 Skill 应用: {}", name)
    } else {
        format!("Select Skill Apps: {}", name)
    }
}

pub fn tui_toast_provider_no_api_url() -> &'static str {
    if is_chinese() {
        "该供应商未配置 API URL。"
    } else {
        "No API URL configured for this provider."
    }
}

pub fn tui_confirm_delete_mcp_title() -> &'static str {
    if is_chinese() {
        "删除 MCP 服务器"
    } else {
        "Delete MCP Server"
    }
}

pub fn tui_confirm_delete_mcp_message(name: &str, id: &str) -> String {
    if is_chinese() {
        format!("确定删除 MCP 服务器 '{}' ({})?", name, id)
    } else {
        format!("Delete MCP server '{}' ({})?", name, id)
    }
}

pub fn tui_prompt_title(name: &str) -> String {
    if is_chinese() {
        format!("提示词: {}", name)
    } else {
        format!("Prompt: {}", name)
    }
}

pub fn tui_prompt_rename_title() -> &'static str {
    if is_chinese() {
        "重命名提示词"
    } else {
        "Rename Prompt"
    }
}

pub fn tui_prompt_create_title() -> &'static str {
    if is_chinese() {
        "创建提示词"
    } else {
        "Create Prompt"
    }
}

pub fn tui_prompt_create_prompt() -> &'static str {
    if is_chinese() {
        "输入提示词名称:"
    } else {
        "Enter a prompt name:"
    }
}

pub fn tui_prompt_rename_prompt() -> &'static str {
    if is_chinese() {
        "输入新的提示词名称:"
    } else {
        "Enter a new prompt name:"
    }
}

pub fn tui_toast_prompt_no_active_to_deactivate() -> &'static str {
    if is_chinese() {
        "没有可停用的活动提示词。"
    } else {
        "No active prompt to deactivate."
    }
}

pub fn tui_toast_prompt_cannot_delete_active() -> &'static str {
    if is_chinese() {
        "不能删除正在启用的提示词。"
    } else {
        "Cannot delete the active prompt."
    }
}

pub fn tui_confirm_delete_prompt_title() -> &'static str {
    if is_chinese() {
        "删除提示词"
    } else {
        "Delete Prompt"
    }
}

pub fn tui_confirm_delete_prompt_message(name: &str, id: &str) -> String {
    if is_chinese() {
        format!("确定删除提示词 '{}' ({})?", name, id)
    } else {
        format!("Delete prompt '{}' ({})?", name, id)
    }
}

pub fn tui_toast_prompt_edit_finished() -> &'static str {
    if is_chinese() {
        "提示词编辑完成"
    } else {
        "Prompt edit finished"
    }
}

pub fn tui_toast_prompt_name_empty() -> &'static str {
    if is_chinese() {
        "提示词名称不能为空。"
    } else {
        "Prompt name cannot be empty."
    }
}

pub fn tui_toast_prompt_not_found(id: &str) -> String {
    if is_chinese() {
        format!("未找到提示词:{}", id)
    } else {
        format!("Prompt not found: {}", id)
    }
}

pub fn tui_config_paths_title() -> &'static str {
    if is_chinese() {
        "配置路径"
    } else {
        "Configuration Paths"
    }
}

pub fn tui_config_paths_config_file(path: &str) -> String {
    if is_chinese() {
        format!("配置文件: {}", path)
    } else {
        format!("Config file: {}", path)
    }
}

pub fn tui_config_paths_config_dir(path: &str) -> String {
    if is_chinese() {
        format!("配置目录:  {}", path)
    } else {
        format!("Config dir:  {}", path)
    }
}

pub fn tui_error_failed_to_read_config(e: &str) -> String {
    if is_chinese() {
        format!("读取配置失败: {e}")
    } else {
        format!("Failed to read config: {e}")
    }
}

pub fn tui_config_export_title() -> &'static str {
    if is_chinese() {
        "导出配置"
    } else {
        "Export Configuration"
    }
}

pub fn tui_config_export_prompt() -> &'static str {
    if is_chinese() {
        "导出路径:"
    } else {
        "Export path:"
    }
}

pub fn tui_config_import_title() -> &'static str {
    if is_chinese() {
        "导入配置"
    } else {
        "Import Configuration"
    }
}

pub fn tui_config_import_prompt() -> &'static str {
    if is_chinese() {
        "从路径导入:"
    } else {
        "Import from path:"
    }
}

pub fn tui_config_backup_title() -> &'static str {
    if is_chinese() {
        "备份配置"
    } else {
        "Backup Configuration"
    }
}

pub fn tui_config_backup_prompt() -> &'static str {
    if is_chinese() {
        "可选名称(留空使用默认值):"
    } else {
        "Optional name (empty for default):"
    }
}

pub fn tui_toast_no_backups_found() -> &'static str {
    if is_chinese() {
        "未找到备份。"
    } else {
        "No backups found."
    }
}

pub fn tui_error_failed_to_read(e: &str) -> String {
    if is_chinese() {
        format!("读取失败: {e}")
    } else {
        format!("Failed to read: {e}")
    }
}