From 0806f479d6b28083a49dc975b471cbbae1a50771 Mon Sep 17 00:00:00 2001 From: TheWhiteDog9487 Date: Thu, 13 Aug 2026 11:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ language.cs | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d99d711..eb0d139 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ - CachyOS - Rocky Linux - AlmaLinux +- Fedora ## 测试通过的系统 ### **x86_64:** @@ -19,6 +20,7 @@ | Arch Linux | 滚动发行 | | Rocky Linux | 10.2 | | AlmaLinux | 10.2 | +| Fedora | 44
40 | ### **aarch64:** | 系统名称 | 版本 | diff --git a/language.cs b/language.cs index a072900..3a8c71e 100644 --- a/language.cs +++ b/language.cs @@ -137,7 +137,7 @@ switch (CurrentSystem){ File.Move("/etc/default/locale", "/etc/default/locale.bak", true); } File.CreateSymbolicLink("/etc/default/locale", "/etc/locale.conf"); } break; } - case SupportedLinuxDistributions.RockyLinux or SupportedLinuxDistributions.AlmaLinux: { + case SupportedLinuxDistributions.RockyLinux or SupportedLinuxDistributions.AlmaLinux or SupportedLinuxDistributions.Fedora: { CheckUser("即将开始安装中文语言包"); Console.WriteLine("开始更新语言配置"); Console.WriteLine("正在安装中文语言包"); @@ -149,12 +149,19 @@ switch (CurrentSystem){ Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(); Console.WriteLine("警告:检测到您正在WSL内使用AlmaLinux"); - Console.WriteLine("目前已知AlmaLinux在WSL镜像可能存在一些问题"); + Console.WriteLine("目前已知AlmaLinux的WSL镜像可能存在一些问题"); Console.WriteLine("如果您遇到了诸如 dnf nano 等软件的显示仍然为英文的问题"); Console.WriteLine("请尝试使用dnf重新安装或升级出现问题的软件包,或者直接完整更新系统内所有软件包,这应当可以解决问题"); Console.WriteLine(); Console.ResetColor(); } - break; } } + break; } + default: { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"您当前使用的操作系统 {OsDescription} ,匹配名称 {CurrentSystem} 受到支持,但是lag2cn没有为其配置执行逻辑"); + Console.WriteLine("这是一个程序Bug,请前往Github仓库开启一个issue,并提供当前输出日志"); + Console.ResetColor(); + throw new InvalidOperationException("遗漏的switch匹配"); } } + Console.WriteLine("配置完成,更改将在您下一次登录Shell时生效,按任意键退出"); Console.ReadKey(true); @@ -165,4 +172,5 @@ enum SupportedLinuxDistributions { ArchLinux, CachyOS, RockyLinux, - AlmaLinux } \ No newline at end of file + AlmaLinux, + Fedora } \ No newline at end of file