From 831a0e5eb4f38575d2ec641920bdd752289f0fb6 Mon Sep 17 00:00:00 2001 From: ClovenBugle Date: Fri, 22 May 2026 01:19:14 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=A1=B5=E4=B8=BB?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 53 ++++++++++++++ .../App/Localization/Languages/zh-CN.xaml | 53 ++++++++++++++ .../PageHomepage/PageHomepageNewsView.xaml | 10 ++- .../PageHomepage/PageHomepageNewsView.xaml.cs | 17 +++-- .../Pages/PageLaunch/PageLaunchLeft.xaml | 26 +++---- .../Pages/PageLaunch/PageLaunchLeft.xaml.cs | 73 ++++++++++++------- .../Pages/PageLaunch/PageLaunchRight.xaml | 4 +- .../Pages/PageLaunch/PageLaunchRight.xaml.cs | 22 +++--- 8 files changed, 195 insertions(+), 63 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index 8fdd85076..005012009 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -735,4 +735,57 @@ Submitter: {0} ({1}) Type: {0} Details + + + Selection + Properties + Loading + Launch + Download + Loading version list, please wait + Loading, please wait + No available game instance + The current instance is being installed and cannot be launched! + The current instance is being installed and cannot be configured! + + + Launching + Game launched + Exporting launch script + Completed + Current step + Download support + Login method + Microsoft login + Progress + Download speed + Trivia + This is a test hint text, it should be long enough to have two lines. + + + Offline + Microsoft login + Third-party + + + Community Edition Notice + You are using PCL Community Edition! This version is independently developed and maintained, and differs from the official version in its development path and user experience. If you downloaded the Community Edition by accident, we strongly recommend downloading the official PCL version for long-term use, as this distribution may not be user-friendly for newcomers. Additionally, please submit Community Edition issues to the Community Edition repository, and do not report Community Edition issues to the official repository! + To permanently hide this notice, enter the correct PCL CE development organization name. + Enter PCL CE development organization name + Not quite right... + Launch Log + + + Loading homepage... + Failed to load homepage + The homepage content is malformed. Check the following error information: {0} + Retry + The homepage is loading too slowly (took {0} seconds). Please report this issue to the homepage author, or temporarily stop using this homepage. + + + The Echo Cave preset has been removed as it only had a shell. Please go to Settings and select another homepage preset. + + + View details + Loading... \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index b25b477fe..1018b1fb6 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -729,4 +729,57 @@ 提交者:{0}({1}) 类型:{0} 查看详情 + + + 实例选择 + 实例设置 + 正在加载 + 启动游戏 + 下载游戏 + 正在加载版本列表,请稍候 + 正在加载中,请稍候 + 未找到可用的游戏实例 + 当前实例正在安装,无法启动! + 当前实例正在安装,暂无法进行实例设置! + + + 正在启动游戏 + 已启动游戏 + 正在导出启动脚本 + 已完成 + 当前步骤 + 下载支持 + 验证方式 + 正版验证 + 启动进度 + 下载速度 + 你知道吗 + 这是一段测试用的小提示文本,它应该足够长以让它有两行。 + + + 离线验证 + 正版验证 + 第三方验证 + + + 社区版提示 + 你正在使用 PCL 社区版!此版本为独立开发和维护,与官方版本维护路线不同,体验有所出入。 如果你是意外下载到了社区版,我们十分建议您下载 PCL 官方版长期使用,此发行版本对新手用户体验可能不友好。 此外,社区版的问题请向社区版的仓库提交 Issue,不要向官方仓库反馈社区版的问题哦! + 若要永久隐藏此提示,请输入正确的 PCL CE 开发组织名称。 + 输入 PCL CE 开发组织名称 + 不太对哦…… + 启动日志 + + + 正在加载主页…… + 加载主页界面失败 + 主页内容编写有误,请根据下列错误信息进行检查: {0} + 重试 + 主页加载过于缓慢(花费了 {0} 秒),请向主页作者反馈此问题,或暂时停止使用该主页 + + + 回声洞 因为只有空壳因此已被移除,请前往设置选择其他预设主页 + + + 查看详情 + 加载中…… \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml b/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml index 71d4b85e9..2cdbb38e4 100644 --- a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml +++ b/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml @@ -100,11 +100,13 @@ Margin="0,5,5,0" HorizontalAlignment="Right" Foreground="{DynamicResource ColorBrushGray2}" - Text="查看详情"> + Text="{DynamicResource Launch.Homepage.News.ViewDetail}"> - + @@ -124,7 +126,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}"> - + \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml.cs b/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml.cs index f5c718673..427fb0c6e 100644 --- a/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageHomepage/PageHomepageNewsView.xaml.cs @@ -1,13 +1,14 @@ -using PCL.Core.ViewModel.Homepage; +using PCL.Core.App.Localization; +using PCL.Core.ViewModel.Homepage; -namespace PCL +namespace PCL; + +public partial class PageHomepageNewsView : MyPageRight { - public partial class PageHomepageNewsView : MyPageRight + public PageHomepageNewsView() { - public PageHomepageNewsView() - { - InitializeComponent(); - this.DataContext = new NewsViewModel(); - } + InitializeComponent(); + Load.Text = Lang.Text("Launch.Homepage.News.Loading"); + DataContext = new NewsViewModel(); } } \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml index 29aa012d1..f5e6222d7 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml @@ -24,11 +24,11 @@ - + Margin="0,10,10,0" TextPadding="36" Text="{DynamicResource Launch.Home.InstanceSettings}" /> @@ -37,10 +37,10 @@ - - @@ -67,7 +67,7 @@ Opacity="0.15" Softness="0.15" /> - @@ -109,20 +109,20 @@ - - - - - - - - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs index 3b518a6b3..b10ebeb08 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs @@ -20,6 +20,16 @@ public partial class PageLaunchLeft private bool IsHeightAnimating; public interface ILoginPage { void Reload(); } + private enum LaunchButtonAction + { + Loading, + Launch, + Download, + Disabled + } + + private LaunchButtonAction _launchButtonAction; + // 加载当前实例 private bool IsLoad; @@ -204,19 +214,24 @@ public void LaunchButtonClick() } // 实际的启动 - if (BtnLaunch.Text == "启动游戏") + switch (_launchButtonAction) { - if (File.Exists(ModMinecraft.McInstanceSelected.PathInstance + ".pclignore")) + case LaunchButtonAction.Launch: { - ModMain.Hint("当前实例正在安装,无法启动!", ModMain.HintType.Critical); - return; - } + if (File.Exists(ModMinecraft.McInstanceSelected.PathInstance + ".pclignore")) + { + ModMain.Hint(Lang.Text("Launch.Home.Instance.InstallingCannotLaunch"), ModMain.HintType.Critical); + return; + } - ModLaunch.McLaunchStart(); - } - else if (BtnLaunch.Text == "下载游戏") - { - ModMain.FrmMain.PageChange(FormMain.PageType.Download, FormMain.PageSubType.DownloadInstall); + ModLaunch.McLaunchStart(); + break; + } + case LaunchButtonAction.Download: + { + ModMain.FrmMain.PageChange(FormMain.PageType.Download, FormMain.PageSubType.DownloadInstall); + break; + } } } @@ -254,38 +269,42 @@ public void RefreshButtonsUI() { case 0: { + _launchButtonAction = LaunchButtonAction.Loading; ModBase.Log("[Minecraft] 启动按钮:正在加载 Minecraft 实例"); - ModMain.FrmLaunchLeft.BtnLaunch.Text = "正在加载"; + ModMain.FrmLaunchLeft.BtnLaunch.Text = Lang.Text("Launch.Home.Button.Loading"); ModMain.FrmLaunchLeft.BtnLaunch.IsEnabled = false; - ModMain.FrmLaunchLeft.LabVersion.Text = "正在加载中,请稍候"; + ModMain.FrmLaunchLeft.LabVersion.Text = Lang.Text("Launch.Home.Instance.Loading"); ModMain.FrmLaunchLeft.BtnInstance.IsEnabled = false; ModMain.FrmLaunchLeft.BtnMore.Visibility = Visibility.Collapsed; break; } case 1: { + _launchButtonAction = LaunchButtonAction.Disabled; ModBase.Log("[Minecraft] 启动按钮:无 Minecraft 实例,下载已禁用"); - ModMain.FrmLaunchLeft.BtnLaunch.Text = "启动游戏"; + ModMain.FrmLaunchLeft.BtnLaunch.Text = Lang.Text("Launch.Home.Button.Launch"); ModMain.FrmLaunchLeft.BtnLaunch.IsEnabled = false; - ModMain.FrmLaunchLeft.LabVersion.Text = "未找到可用的游戏实例"; + ModMain.FrmLaunchLeft.LabVersion.Text = Lang.Text("Launch.Home.Instance.NotFound"); ModMain.FrmLaunchLeft.BtnInstance.IsEnabled = true; ModMain.FrmLaunchLeft.BtnMore.Visibility = Visibility.Collapsed; break; } case 2: { + _launchButtonAction = LaunchButtonAction.Download; ModBase.Log("[Minecraft] 启动按钮:无 Minecraft 实例,要求下载"); - ModMain.FrmLaunchLeft.BtnLaunch.Text = "下载游戏"; + ModMain.FrmLaunchLeft.BtnLaunch.Text = Lang.Text("Launch.Home.Button.Download"); ModMain.FrmLaunchLeft.BtnLaunch.IsEnabled = true; - ModMain.FrmLaunchLeft.LabVersion.Text = "未找到可用的游戏实例"; + ModMain.FrmLaunchLeft.LabVersion.Text = Lang.Text("Launch.Home.Instance.NotFound"); ModMain.FrmLaunchLeft.BtnInstance.IsEnabled = true; ModMain.FrmLaunchLeft.BtnMore.Visibility = Visibility.Collapsed; break; } case 3: { + _launchButtonAction = LaunchButtonAction.Launch; ModBase.Log("[Minecraft] 启动按钮:Minecraft 实例:" + ModMinecraft.McInstanceSelected.PathInstance); - ModMain.FrmLaunchLeft.BtnLaunch.Text = "启动游戏"; + ModMain.FrmLaunchLeft.BtnLaunch.Text = Lang.Text("Launch.Home.Button.Launch"); ModMain.FrmLaunchLeft.BtnInstance.IsEnabled = true; if (ModProfile.SelectedProfile is not null) BtnLaunch.IsEnabled = true; @@ -338,7 +357,7 @@ private void BtnMore_Click(object sender, MouseButtonEventArgs e) PageInstanceLeft.Instance = ModMinecraft.McInstanceSelected; if (File.Exists(ModMinecraft.McInstanceSelected.PathInstance + ".pclignore")) { - ModMain.Hint("当前实例正在安装,暂无法进行实例设置!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Home.Instance.InstallingCannotSetup"), ModMain.HintType.Critical); return; } @@ -371,7 +390,7 @@ public void LaunchingRefresh() } if (exitTry) break; - LabLaunchingStage.Text = "已完成"; + LabLaunchingStage.Text = Lang.Text("Launch.Status.Completed"); } catch (Exception ex) { @@ -391,8 +410,8 @@ public void LaunchingRefresh() if (IsLaunched) ShowProgress = 1d; // 如果已经完成了,就不卖关子了 // 文本 - LabLaunchingTitle.Text = IsLaunched ? "已启动游戏" : - ModLaunch.CurrentLaunchOptions.SaveBatch is null ? "正在启动游戏" : "正在导出启动脚本"; + LabLaunchingTitle.Text = IsLaunched ? Lang.Text("Launch.Status.Title.Launched") : + ModLaunch.CurrentLaunchOptions.SaveBatch is null ? Lang.Text("Launch.Status.Title.Launching") : Lang.Text("Launch.Status.Title.ExportingScript"); LabLaunchingProgress.Text = Lang.Number(ShowProgress, "P2"); var HasLaunchDownloader = false; try @@ -526,17 +545,17 @@ public void PageChangeToLaunching() { case ModLaunch.McLoginType.Legacy: { - LabLaunchingMethod.Text = "离线验证"; + LabLaunchingMethod.Text = Lang.Text("Launch.Account.Type.Offline"); break; } case ModLaunch.McLoginType.Ms: { - LabLaunchingMethod.Text = "正版验证"; + LabLaunchingMethod.Text = Lang.Text("Launch.Account.Type.Microsoft"); break; } case ModLaunch.McLoginType.Auth: { - LabLaunchingMethod.Text = "第三方验证" + (!string.IsNullOrEmpty(ModProfile.SelectedProfile.ServerName) + LabLaunchingMethod.Text = Lang.Text("Launch.Account.Type.ThirdParty") + (!string.IsNullOrEmpty(ModProfile.SelectedProfile.ServerName) ? " / " + ModProfile.SelectedProfile.ServerName : ""); break; @@ -546,7 +565,9 @@ public void PageChangeToLaunching() // 初始化页面 LabLaunchingName.Text = ModMinecraft.McInstanceSelected.Name; LabLaunchingStage.Text = Lang.Text("Common.Action.Initialize"); - LabLaunchingTitle.Text = ModLaunch.CurrentLaunchOptions?.SaveBatch is null ? "正在启动游戏" : "正在导出启动脚本"; + LabLaunchingTitle.Text = ModLaunch.CurrentLaunchOptions?.SaveBatch is null + ? Lang.Text("Launch.Status.Title.Launching") + : Lang.Text("Launch.Status.Title.ExportingScript"); LabLaunchingProgress.Text = Lang.Number(0d, "P2"); LabLaunchingProgress.Opacity = 1d; LabLaunchingDownload.Visibility = Visibility.Visible; @@ -764,7 +785,7 @@ public void RefreshPage(bool Anim, ModLaunch.McLoginType TargetLoginType = defau else { Type = PageType.Profile; - if (!(BtnLaunch.Text == "下载游戏")) + if (_launchButtonAction != LaunchButtonAction.Download) BtnLaunch.IsEnabled = false; } diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml index 594498836..f24375440 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml @@ -5,7 +5,7 @@ - + - + diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.cs index 97aa55322..b07158c35 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.cs @@ -28,15 +28,14 @@ private void Init() PanHint.Visibility = States.Hint.CEMessage ? Visibility.Visible : Visibility.Collapsed; - LabHint1.Text = - $"你正在使用 PCL 社区版!此版本为独立开发和维护,与官方版本维护路线不同,体验有所出入。{"\r\n"}{"\r\n"}如果你是意外下载到了社区版,我们十分建议您下载 PCL 官方版长期使用,此发行版本对新手用户体验可能不友好。{"\r\n"}此外,社区版的问题请向社区版的仓库提交 Issue,不要向官方仓库反馈社区版的问题哦!{"\r\n"}"; - LabHint2.Text = "若要永久隐藏此提示,请输入正确的 PCL CE 开发组织名称。"; + LabHint1.Text = Lang.Text("Launch.Right.CommunityHint.Message"); + LabHint2.Text = Lang.Text("Launch.Right.CommunityHint.HidePrompt"); } // 暂时关闭快照版提示 private void BtnHintClose_Click(object sender, EventArgs e) { - var input = ModMain.MyMsgBoxInput("输入 PCL CE 开发组织名称"); + var input = ModMain.MyMsgBoxInput(Lang.Text("Launch.Right.CommunityHint.InputTitle")); if (string.IsNullOrWhiteSpace(input)) return; input = new string(input.Where(x => char.IsAsciiLetter(x)).ToArray()).ToLower(); @@ -47,7 +46,7 @@ private void BtnHintClose_Click(object sender, EventArgs e) } else { - ModMain.Hint("不太对哦……"); + ModMain.Hint(Lang.Text("Launch.Right.CommunityHint.WrongInput")); } } @@ -104,7 +103,7 @@ private void RefreshReal() LogWrapper.Info("[Page] 主页预设:你知道吗"); var hintText = GetRandomHint(); content = $@" - + LoadContent("")); // 先清空页面 States.UI.SavedHomepageVersion = ""; OnlineLoader.Start(url); // 下载完成后将会再次触发更新 @@ -431,7 +430,10 @@ private void LoadContent(string Content) if (ModMain.MyMsgBox( ex is UnauthorizedAccessException ? ex.Message - : $"主页内容编写有误,请根据下列错误信息进行检查:\r\n{ex}", "加载主页界面失败", "重试", Lang.Text("Common.Action.Cancel")) == + : Lang.Text("Launch.Homepage.LoadFailed.Message", ex), + Lang.Text("Launch.Homepage.LoadFailed.Title"), + Lang.Text("Launch.Homepage.LoadFailed.Retry"), + Lang.Text("Common.Action.Cancel")) == 1) goto Refresh; // 防止 SyncLock 死锁 } else @@ -445,7 +447,7 @@ ex is UnauthorizedAccessException var LoadCostTime = (DateTime.Now - LoadStartTime).Milliseconds; ModBase.Log($"[Page] 实例化:加载主页 UI 完成,耗时 {LoadCostTime}ms"); if (LoadCostTime > 3000) - ModMain.Hint($"主页加载过于缓慢(花费了 {Lang.Number(Math.Round(LoadCostTime / 1000d, 1), "N1")} 秒),请向主页作者反馈此问题,或暂时停止使用该主页"); + ModMain.Hint(Lang.Text("Launch.Homepage.SlowWarning", Lang.Number(Math.Round(LoadCostTime / 1000d, 1), "N1"))); } return; From b1b6f04915fe3f367d3cd51072c1836d59c6f932 Mon Sep 17 00:00:00 2001 From: ClovenBugle Date: Fri, 22 May 2026 02:20:25 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E3=80=81=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2=EF=BC=9AMicrosoft?= =?UTF-8?q?=20=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97=E3=80=81Microsoft=20?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E3=80=81=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5=E3=80=81=E7=A6=BB=E7=BA=BF=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E3=80=81=E6=A1=A3=E6=A1=88=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E3=80=81=E6=A1=A3=E6=A1=88=E7=9A=AE=E8=82=A4=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 142 +++++++++++++++++- .../App/Localization/Languages/zh-CN.xaml | 136 +++++++++++++++++ .../Modules/Minecraft/ModProfile.cs | 86 +++++------ .../Pages/PageLaunch/MyMsgLogin.xaml | 41 +++-- .../Pages/PageLaunch/MyMsgLogin.xaml.cs | 22 +-- .../Pages/PageLaunch/PageLoginAuth.xaml | 22 +-- .../Pages/PageLaunch/PageLoginAuth.xaml.cs | 81 +++++----- .../Pages/PageLaunch/PageLoginMs.xaml | 17 ++- .../Pages/PageLaunch/PageLoginMs.xaml.cs | 15 +- .../Pages/PageLaunch/PageLoginOffline.xaml | 31 ++-- .../Pages/PageLaunch/PageLoginOffline.xaml.cs | 10 +- .../Pages/PageLaunch/PageLoginProfile.xaml | 14 +- .../Pages/PageLaunch/PageLoginProfile.xaml.cs | 12 +- .../PageLaunch/PageLoginProfileSkin.xaml | 27 ++-- .../PageLaunch/PageLoginProfileSkin.xaml.cs | 7 +- 15 files changed, 485 insertions(+), 178 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index 005012009..ecb9180ff 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -764,16 +764,16 @@ Offline - Microsoft login + Microsoft Third-party - Community Edition Notice + Community Edition notice You are using PCL Community Edition! This version is independently developed and maintained, and differs from the official version in its development path and user experience. If you downloaded the Community Edition by accident, we strongly recommend downloading the official PCL version for long-term use, as this distribution may not be user-friendly for newcomers. Additionally, please submit Community Edition issues to the Community Edition repository, and do not report Community Edition issues to the official repository! To permanently hide this notice, enter the correct PCL CE development organization name. Enter PCL CE development organization name Not quite right... - Launch Log + Launch log Loading homepage... @@ -788,4 +788,140 @@ View details Loading... + + + Test Title Text + Reopen webpage + Copy code + Login to Minecraft + The login page will open automatically. Enter the authorization code {0} (will be automatically copied). If you have network issues and the page fails to load, please use a VPN and try again. You can also open {1} on another device and enter the authorization code above. + The login page will open automatically, and the authorization code will be auto-filled. If you have network issues and the page fails to load, please use a VPN and try again. If the code is not auto-filled, paste this authorization code {0} (will be automatically copied) into the page. You can also open {1} on another device and enter the authorization code. + Successfully logged in through the webpage! + Microsoft verification polling failed + + + Verify + » Purchase + » Website + « Back + Login + Login cancelled! + Microsoft login verification failed. Try disabling [Verify SSL certificate for Microsoft login] in [Settings → Miscellaneous], then try again. Raw error message: + Microsoft login failed + Unknown error! + + + Auth server: {0} + Switch profile + Log out + Server + Email + Password + Register account + Forgot password + Back + Login + Auth server, username and password cannot be empty! + Invalid auth server address + Login cancelled! + Preset - LittleSkin + Third-party login failed + + + ID + 3 - 16 characters, only letters, numbers and underscores + UUID standard + Standard + [Recommended] The generated UUID is consistent with other software such as HMCL, BakaXL and Bukkit + Legacy + Use legacy PCL UUID generation rules If upgrading from an older PCL version and some single-player save data is missing, try this option + For advanced users. If you don't know what this is, do not select this option + Must be a 32-character hex string without hyphens + Back + Create + Invalid player ID + Your player ID does not meet the standard (3 - 16 characters, only letters, numbers and underscores), which may cause some game versions to fail to launch or encounter errors. It is strongly recommended to use a standard player ID! If you insist, you can still continue to create the profile. + UUID does not meet requirements: {0} + Profile created successfully! + + + Select a profile to launch the game + Create and select a profile to launch the game + Create profile + Import / Export + Change UUID + Copy UUID + Change auth server name + Delete profile + Modify auth server name + Enter the new auth server name + Confirm profile deletion + You are about to delete this profile. This action cannot be undone. Are you sure you want to continue? + + + Create profile - Select auth type + + + Enter new player ID + Player ID can only be changed once every 30 days. Please consider carefully! + 3 - 16 characters, only letters, numbers and underscores + The player name to set is empty + Confirm change + Note: Player ID can only be changed once every 30 days. Please consider carefully! + ID change failed + This ID is already in use. Please choose a different one. + This ID contains invalid characters other than letters, numbers and underscores. + Player ID changed successfully. Current ID: {0} + After changing your ID for the first time, you must wait 30 days before changing it again. You can check the exact date on the official website. + + + Create profile - Select UUID type + Standard UUID (recommended) + Legacy PCL UUID (if single-player save data is missing, try this option) + Change UUID for profile {0} + 32 characters, no hyphens + UUID should only contain letters and numbers! + Profile saved! + Profile deleted successfully! + + + Profile migration + PCL CE supports two-way profile synchronization with HMCL. Select an operation: + Since the current profile list is empty, only importing from HMCL is supported. + Import + Export + Importing from HMCL... + HMCL configuration file not found. + You must complete Microsoft login at least once before importing these profiles! + No new profiles to import. + Successfully imported {0} profile(s)! + Exporting to HMCL... + Successfully synced {0} profile(s). + Import error. Please check the file format. + Export failed. + Profiles have been automatically migrated from legacy configuration files, total {0} profile(s) migrated + + + Player name cannot be empty! + Player name cannot contain double quotes! + Since 1.20.3, player names can have at most 16 characters! + Unknown auth type + + + Skins and capes + Change skin + Save skin + Refresh skin + Change cape + Edit profile + Edit password + Edit username + Switch accounts + This profile does not support changing the password! + This profile does not support changing the skin! + This profile does not support changing the cape! + + + Back + Continue \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index 1018b1fb6..e301a77ea 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -782,4 +782,140 @@ 查看详情 加载中…… + + + 测试标题文本 + 重新打开网页 + 复制代码 + 登录 Minecraft + 登录网页将自动开启,请在网页中输入授权码 {0}(将自动复制)。 如果网络环境不佳,网页可能一直加载不出来,届时请使用 VPN 并重试。 你也可以用其他设备打开 {1} 并输入上述授权码。 + 登录网页将自动开启,授权码将自动填充。 如果网络环境不佳,网页可能一直加载不出来,届时请使用 VPN 并重试。 如果没有自动填充,请在页面内粘贴此授权码 {0}(将自动复制) 你也可以用其他设备打开 {1} 并输入授权码。 + 网页登录成功! + 正版验证轮询失败 + + + 开始正版验证 + » 购买正版 + » 前往官网 + « 返回 + 登录 + 已取消登录! + 正版登录验证失败,请考虑在 [设置 → 其他] 中关闭 [在正版登录时验证 SSL 证书],然后再试。 原始错误信息: + 正版登录尝试失败 + 未知错误! + + + 验证服务器: {0} + 更换角色 + 退出登录 + 服务器 + 邮箱 + 密码 + 注册账号 + 找回密码 + 返回 + 登录 + 验证服务器、用户名与密码均不能为空! + 输入的验证服务器地址无效 + 已取消登录! + 预设 - LittleSkin + 第三方登录尝试失败 + + + 玩家 ID + 3 - 16 位,只可以包含英文字母、数字与下划线 + UUID 标准 + 行业规范 + [推荐] 生成的 UUID 与 HMCL、BakaXL 和 Bukkit 等其他软件一致 + 旧版 + 使用旧版 PCL 的 UUID 生成规则 若从旧版 PCL 升级,且单人存档的部分信息丢失,可尝试此项 + 适用于高级用户,如果你不知道这是什么,请不要选择此项 + 应为 32 位 16 进制字符串,不含连字符 + 返回 + 创建 + 玩家 ID 不符合规范 + 你输入的玩家 ID 不符合标准(3 - 16 位,只可以包含英文字母、数字与下划线),可能导致部分版本的游戏无法启动或发生错误。 强烈建议使用规范的玩家 ID! 如果你坚持,仍然可以继续创建档案。 + UUID 不符合要求:{0} + 档案新建成功! + + + 选择一个档案以启动游戏 + 新建并选择一个档案以启动游戏 + 新建档案 + 导入 / 导出 + 更改 UUID + 复制 UUID + 更改验证服务器名称 + 删除档案 + 修改验证服务器名称 + 请输入新的验证服务器名称 + 删除档案确认 + 你正在选择删除此档案,该操作无法撤销。 确定继续? + + + 新建档案 - 选择验证类型 + + + 输入新的玩家 ID + 玩家 ID 只能每 30 天更改一次名称,请谨慎考虑! + 3 - 16 个字符,只可以包含大小写字母、数字、下划线 + 欲设置的玩家名称为空 + 确认修改 + 注意:玩家 ID 只能每 30 天更改一次,请务必谨慎考虑! + ID 修改失败 + 此 ID 已被使用,请换一个 ID。 + 此 ID 包含了除大小写字母、数字、下划线以外的不合法字符。 + 玩家 ID 修改成功,当前 ID 为:{0} + 首次更改 ID 后,必须等待 30 天后才能再次修改 ID,你可以前往官网查询具体时间。 + + + 新建档案 - 选择 UUID 类型 + 行业规范 UUID(推荐) + 官方版 PCL UUID(若单人存档的部分信息丢失,可尝试此项) + 更改档案 {0} 的 UUID + 32 位,不含连字符 + UUID 只应该包括英文字母和数字! + 档案信息已保存! + 档案删除成功! + + + 档案迁移 + PCL CE 支持与 HMCL 相互同步全局档案列表。 请选择操作: + 由于当前档案列表为空,仅支持从 HMCL 导入档案。 + 导入 + 导出 + 正在从 HMCL 导入... + 未找到 HMCL 的配置文件。 + 你必须先进行一次正版验证才能导入这些档案! + 没有新档案可供导入。 + 成功导入 {0} 个档案! + 正在导出至 HMCL... + 已成功同步 {0} 个档案。 + 导入出错,请检查文件格式。 + 导出失败。 + 已自动从旧版配置文件迁移档案,共迁移了 {0} 个档案 + + + 玩家名不能为空! + 玩家名不能包含英文引号! + 自 1.20.3 起,玩家名至多只能包含 16 个字符! + 未知的验证方式 + + + 皮肤与披风 + 修改皮肤 + 保存皮肤 + 刷新头像 + 修改披风 + 修改信息 + 修改密码 + 修改玩家名 + 选择档案 + 当前档案不支持修改密码! + 当前档案不支持修改皮肤! + 当前档案不支持修改披风! + + + 返回 + 继续 \ No newline at end of file diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs index 2eb36a9ab..24d50946c 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs @@ -143,7 +143,7 @@ public static void MigrateOldProfile() } if (!(profileCount == 0)) - ModMain.Hint($"已自动从旧版配置文件迁移档案,共迁移了 {profileCount} 个档案"); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.AutoMigrate", profileCount)); ProfileLog("档案迁移结束"); } @@ -458,7 +458,7 @@ public static void CreateProfile() #endif - selectedAuthTypeNum = ModMain.MyMsgBoxSelect(authTypeList, "新建档案 - 选择验证类型", "继续", Lang.Text("Common.Action.Cancel")); + selectedAuthTypeNum = ModMain.MyMsgBoxSelect(authTypeList, Lang.Text("Launch.Account.Profile.Create.SelectAuthType.Title"), Lang.Text("Common.Action.Continue"), Lang.Text("Common.Action.Cancel")); }); if (selectedAuthTypeNum is null) return; @@ -477,21 +477,21 @@ public static void CreateProfile() [ new MyListItem { - Title = "正版验证", + Title = Lang.Text("Launch.Account.Type.Microsoft"), Type = MyListItem.CheckType.RadioBox, Logo = Icon.IconButtonAuth }, new MyListItem { - Title = "第三方验证", + Title = Lang.Text("Launch.Account.Type.ThirdParty"), Type = MyListItem.CheckType.RadioBox, Logo = Icon.IconButtonThirdparty }, new MyListItem { - Title = "离线验证", + Title = Lang.Text("Launch.Account.Type.Offline"), Type = MyListItem.CheckType.RadioBox, Logo = Icon.IconButtonOffline } @@ -500,7 +500,7 @@ public static void CreateProfile() [ new MyListItem { - Title = "正版验证", + Title = Lang.Text("Launch.Account.Type.Microsoft"), Type = MyListItem.CheckType.RadioBox, Logo = Icon.IconButtonAuth } @@ -516,19 +516,19 @@ public static void EditProfileId() if (SelectedProfile.Type == ModLaunch.McLoginType.Ms) { string newUsername = null; - ModBase.RunInUiWait(() => newUsername = ModMain.MyMsgBoxInput("输入新的玩家 ID", "玩家 ID 只能每 30 天更改一次名称,请谨慎考虑!", + ModBase.RunInUiWait(() => newUsername = ModMain.MyMsgBoxInput(Lang.Text("Launch.Account.Profile.EditPlayerId.Title"), Lang.Text("Launch.Account.Profile.EditPlayerId.MicrosoftWarning"), SelectedProfile.Username, [new StringLengthValidator(3, 16), new RegexValidator("([A-z]|[0-9]|_)+")], - "3 - 16 个字符,只可以包含大小写字母、数字、下划线", Lang.Text("Common.Action.Confirm"))); + Lang.Text("Launch.Account.Profile.EditPlayerId.Hint"), Lang.Text("Common.Action.Confirm"))); if (string.IsNullOrEmpty(newUsername)) return; if (string.IsNullOrWhiteSpace(newUsername)) { - ModMain.Hint("欲设置的玩家名称为空"); + ModMain.Hint(Lang.Text("Launch.Account.Profile.EditPlayerId.Empty")); return; } - if (ModMain.MyMsgBox("注意:玩家 ID 只能每 30 天更改一次,请务必谨慎考虑!", "确认修改", "继续修改", Lang.Text("Common.Action.Cancel"), IsWarn: true) == 2) + if (ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.EditPlayerId.Confirm.Message"), Lang.Text("Launch.Account.Profile.EditPlayerId.Confirm.Title"), Lang.Text("Common.Action.Continue"), Lang.Text("Common.Action.Cancel"), IsWarn: true) == 2) return; // 更新档案信息 // 刷新页面信息 @@ -545,13 +545,13 @@ public static void EditProfileId() })); if ((string)checkResult["status"] == "DUPLICATE") { - ModMain.MyMsgBox("此 ID 已被使用,请换一个 ID。", "ID 修改失败", Lang.Text("Common.Action.Confirm"), IsWarn: true); + ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.EditPlayerId.Duplicate"), Lang.Text("Launch.Account.Profile.EditPlayerId.Failed.Title"), Lang.Text("Common.Action.Confirm"), IsWarn: true); return; } if ((string)checkResult["status"] == "NOT_ALLOWED") { - ModMain.MyMsgBox("此 ID 包含了除大小写字母、数字、下划线以外的不合法字符。", "ID 修改失败", Lang.Text("Common.Action.Confirm"), IsWarn: true); + ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.EditPlayerId.NotAllowed"), Lang.Text("Launch.Account.Profile.EditPlayerId.Failed.Title"), Lang.Text("Common.Action.Confirm"), IsWarn: true); return; } @@ -565,7 +565,7 @@ public static void EditProfileId() { { "Authorization", "Bearer " + SelectedProfile.AccessToken } } }); var resultJson = (JObject)ModBase.GetJson(result); - ModMain.Hint($"玩家 ID 修改成功,当前 ID 为:{resultJson["name"]}", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.Profile.EditPlayerId.Success", resultJson["name"]), ModMain.HintType.Finish); ProfileList.Remove(SelectedProfile); SelectedProfile.Username = (string)resultJson["name"]; ProfileList.Add(SelectedProfile); @@ -577,7 +577,7 @@ public static void EditProfileId() { var exSummary = ex.ToString(); if (exSummary.Contains("403")) - ModMain.MyMsgBox("首次更改 ID 后,必须等待 30 天后才能再次修改 ID,你可以前往官网查询具体时间。", "ID 修改失败", "我知道了"); + ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.EditPlayerId.Cooldown"), Lang.Text("Launch.Account.Profile.EditPlayerId.Failed.Title"), Lang.Text("Common.Action.Confirm")); else ModBase.Log(ex, "修改档案 ID 失败", ModBase.LogLevel.Msgbox); } @@ -594,10 +594,10 @@ public static void EditProfileId() else { string newUsername = null; - ModBase.RunInUiWait(() => newUsername = ModMain.MyMsgBoxInput("输入新的玩家 ID", + ModBase.RunInUiWait(() => newUsername = ModMain.MyMsgBoxInput(Lang.Text("Launch.Account.Profile.EditPlayerId.Title"), DefaultInput: SelectedProfile.Username, ValidateRules: [new StringLengthValidator(3, 16), new RegexValidator("([A-z]|[0-9]|_)+")], - HintText: "3 - 16 个字符,只可以包含大小写字母、数字、下划线", Button1: Lang.Text("Common.Action.Confirm"), Button2: Lang.Text("Common.Action.Cancel"))); + HintText: Lang.Text("Launch.Account.Profile.EditPlayerId.Hint"), Button1: Lang.Text("Common.Action.Confirm"), Button2: Lang.Text("Common.Action.Cancel"))); if (string.IsNullOrEmpty(newUsername)) return; EditOfflineUuid(SelectedProfile, GetOfflineUuid(newUsername)); @@ -624,10 +624,10 @@ public static void EditOfflineUuid(McProfile profile, string uuid = null) { var uuidTypeList = new List { - new MyRadioBox { Text = "行业规范 UUID(推荐)" }, new MyRadioBox { Text = "官方版 PCL UUID(若单人存档的部分信息丢失,可尝试此项)" }, + new MyRadioBox { Text = Lang.Text("Launch.Account.Profile.Uuid.Standard") }, new MyRadioBox { Text = Lang.Text("Launch.Account.Profile.Uuid.Legacy") }, new MyRadioBox { Text = Lang.Text("Common.Option.Customize") } }; - uuidTypeInput = ModMain.MyMsgBoxSelect(uuidTypeList, "新建档案 - 选择 UUID 类型", "继续", Lang.Text("Common.Action.Cancel")); + uuidTypeInput = ModMain.MyMsgBoxSelect(uuidTypeList, Lang.Text("Launch.Account.Profile.Uuid.SelectType.Title"), Lang.Text("Common.Action.Continue"), Lang.Text("Common.Action.Cancel")); }); if (uuidTypeInput is null) return; @@ -637,11 +637,11 @@ public static void EditOfflineUuid(McProfile profile, string uuid = null) else if (uuidType == 1) newUuid = GetOfflineUuid(profile.Username, isLegacy: true); else - newUuid = ModMain.MyMsgBoxInput($"更改档案 {profile.Username} 的 UUID", DefaultInput: profile.Uuid, - HintText: "32 位,不含连字符", + newUuid = ModMain.MyMsgBoxInput(Lang.Text("Launch.Account.Profile.Uuid.ChangeTitle", profile.Username), DefaultInput: profile.Uuid, + HintText: Lang.Text("Launch.Account.Profile.Uuid.Hint"), ValidateRules: - [new StringLengthValidator(32, 32), new RegexValidator("([A-z]|[0-9]){32}", "UUID 只应该包括英文字母和数字!")], - Button1: "继续", Button2: Lang.Text("Common.Action.Cancel")); + [new StringLengthValidator(32, 32), new RegexValidator("([A-z]|[0-9]){32}", Lang.Text("Launch.Account.Profile.Uuid.InvalidChars"))], + Button1: Lang.Text("Common.Action.Continue"), Button2: Lang.Text("Common.Action.Cancel")); if (string.IsNullOrEmpty(newUuid)) return; Write: ; @@ -649,7 +649,7 @@ public static void EditOfflineUuid(McProfile profile, string uuid = null) ProfileList[profileIndex].Uuid = newUuid; SelectedProfile = ProfileList[profileIndex]; SaveProfile(); - ModMain.Hint("档案信息已保存!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Saved"), ModMain.HintType.Finish); } /// @@ -660,7 +660,7 @@ public static void EditAuthServerName(McProfile profile, string serverName) var profileIndex = ProfileList.IndexOf(profile); ProfileList[profileIndex].ServerName = serverName; SaveProfile(); - ModMain.Hint("档案信息已保存!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Saved"), ModMain.HintType.Finish); } /// @@ -672,7 +672,7 @@ public static void RemoveProfile(McProfile profile) ProfileList.Remove(profile); LastUsedProfile = default; SaveProfile(); - ModMain.Hint("档案删除成功!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Deleted"), ModMain.HintType.Finish); } #endregion @@ -692,12 +692,12 @@ public static void MigrateProfile() { if (hasProfiles) { - opType = ModMain.MyMsgBox($"PCL CE 支持与 HMCL 相互同步全局档案列表。{"\r\n"}请选择操作:", "档案迁移", "导入", "导出", + opType = ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.Migration.Message"), Lang.Text("Launch.Account.Profile.Migration.Title"), Lang.Text("Launch.Account.Profile.Migration.Import"), Lang.Text("Launch.Account.Profile.Migration.Export"), Lang.Text("Common.Action.Cancel"), ForceWait: true); } else { - opType = ModMain.MyMsgBox("由于当前档案列表为空,仅支持从 HMCL 导入档案。", "档案迁移", "导入", Lang.Text("Common.Action.Cancel"), ForceWait: true); + opType = ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.Migration.ImportOnlyMessage"), Lang.Text("Launch.Account.Profile.Migration.Title"), Lang.Text("Launch.Account.Profile.Migration.Import"), Lang.Text("Common.Action.Cancel"), ForceWait: true); if (opType == 2) opType = 3; } }); @@ -716,7 +716,7 @@ public static void MigrateProfile() private static void PerformImport(string path) { - ModMain.Hint("正在从 HMCL 导入..."); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.Importing")); // 使用 System.Text.Json 解析 @@ -730,7 +730,7 @@ private static void PerformImport(string path) { if (!File.Exists(path)) { - ModMain.Hint("未找到 HMCL 的配置文件。", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.HmclConfigNotFound"), ModMain.HintType.Critical); return; } @@ -758,7 +758,7 @@ private static void PerformImport(string path) if (!hasMsProfile) { - ModMain.Hint("你必须先进行一次正版验证才能导入这些档案!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.MsRequired"), ModMain.HintType.Critical); return; } @@ -766,11 +766,11 @@ private static void PerformImport(string path) SaveProfile(); if (importCount == 0) { - ModMain.Hint("没有新档案可供导入。"); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.NoNewProfiles")); } else { - ModMain.Hint($"成功导入 {importCount} 个档案!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.ImportSuccess", importCount), ModMain.HintType.Finish); ModBase.RunInUi(() => ModMain.FrmLoginProfile.RefreshProfileList()); } } @@ -778,14 +778,14 @@ private static void PerformImport(string path) catch (Exception ex) { ProfileLog("导入失败: " + ex.Message); - ModMain.Hint("导入出错,请检查文件格式。", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.ImportFailed"), ModMain.HintType.Critical); } }, "Profile Import"); } private static void PerformExport(string path) { - ModMain.Hint("正在导出至 HMCL..."); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.Exporting")); try { // 1. 读取并解析现有列表,准备合并 @@ -816,12 +816,12 @@ private static void PerformExport(string path) Directory.CreateDirectory(Path.GetDirectoryName(path)); File.WriteAllText(path, jsonString); - ModMain.Hint($"已成功同步 {ProfileList.Count} 个档案。", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.ExportSuccess", ProfileList.Count), ModMain.HintType.Finish); } catch (Exception ex) { ProfileLog("导出失败: " + ex.Message); - ModMain.Hint("导出失败。", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Migration.ExportFailed"), ModMain.HintType.Critical); } } @@ -981,17 +981,17 @@ public static object GetProfileInfo(McProfile profile) string info = null; if (profile.Type == ModLaunch.McLoginType.Auth) { - info += "第三方验证"; + info += Lang.Text("Launch.Account.Type.ThirdParty"); if (!string.IsNullOrWhiteSpace(profile.ServerName)) info += $" / {profile.ServerName}"; } else if (profile.Type == ModLaunch.McLoginType.Ms) { - info += "正版验证"; + info += Lang.Text("Launch.Account.Type.Microsoft"); } else { - info += "离线验证"; + info += Lang.Text("Launch.Account.Type.Offline"); } if (!string.IsNullOrWhiteSpace(profile.Desc)) @@ -1068,11 +1068,11 @@ public static object IsProfileValid() case ModLaunch.McLoginType.Legacy: { if (string.IsNullOrEmpty(SelectedProfile.Username.Trim())) - return "玩家名不能为空!"; + return Lang.Text("Launch.Account.Profile.Validation.EmptyUsername"); if (SelectedProfile.Username.Contains("\"")) - return "玩家名不能包含英文引号!"; + return Lang.Text("Launch.Account.Profile.Validation.QuoteInUsername"); if (ModMinecraft.McInstanceSelected is not null && ModMinecraft.McInstanceSelected.Info.Drop >= 203 && - SelectedProfile.Username.Trim().Length > 16) return "自 1.20.3 起,玩家名至多只能包含 16 个字符!"; + SelectedProfile.Username.Trim().Length > 16) return Lang.Text("Launch.Account.Profile.Validation.UsernameTooLong"); return ""; } case ModLaunch.McLoginType.Ms: @@ -1085,7 +1085,7 @@ public static object IsProfileValid() } } - return "未知的验证方式"; + return Lang.Text("Launch.Account.Profile.Validation.UnknownAuthType"); } #endregion diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml index f67b273f5..f785c6484 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml @@ -1,9 +1,10 @@ + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:PCL" + xmlns:controls="clr-namespace:PCL.Core.UI.Controls;assembly=PCL.Core" + RenderTransformOrigin="0,0.5" UseLayoutRounding="True" SnapsToDevicePixels="True" MinWidth="400" + HorizontalAlignment="Center" VerticalAlignment="Center" Margin="25"> @@ -26,21 +27,35 @@ - - + - - + - - + diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs index 66f54aad6..034edf3b9 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs @@ -2,6 +2,7 @@ using System.Windows.Controls; using System.Windows.Input; using Newtonsoft.Json.Linq; +using PCL.Core.App.Localization; using PCL.Core.UI.Controls; using PCL.Network; @@ -45,27 +46,16 @@ private void Init() if (Data["verification_uri_complete"] is not null) { Website = (string)Data["verification_uri_complete"]; - LabCaption.Text = $""" - 登录网页将自动开启,授权码将自动填充。 - - 如果网络环境不佳,网页可能一直加载不出来,届时请使用 VPN 并重试。 - 如果没有自动填充,请在页面内粘贴此授权码 {UserCode} (将自动复制) - 你也可以用其他设备打开 {Website} 并输入授权码。 - """; + LabCaption.Text = Lang.Text("Launch.Account.LoginDialog.MicrosoftInstructions.WithAutoFill", UserCode, Website); } else { Website = (string)Data["verification_uri"]; - LabCaption.Text = $""" - 登录网页将自动开启,请在网页中输入授权码 {UserCode}(将自动复制)。 - - 如果网络环境不佳,网页可能一直加载不出来,届时请使用 VPN 并重试。 - 你也可以用其他设备打开 {Website} 并输入上述授权码。 - """; + LabCaption.Text = Lang.Text("Launch.Account.LoginDialog.MicrosoftInstructions", UserCode, Website); } // 设置 UI - LabTitle.Text = "登录 Minecraft"; + LabTitle.Text = Lang.Text("Launch.Account.LoginDialog.MinecraftLogin"); CustomEventService.SetEventData(Btn1, Website); CustomEventService.SetEventData(Btn2, UserCode); // 启动工作线程 @@ -100,7 +90,7 @@ private void WorkThread() // 获取结果 var ResultJson = (JObject)ModBase.GetJson(Result); ModProfile.ProfileLog($"令牌过期时间:{ResultJson["expires_in"]} 秒"); - ModMain.Hint("网页登录成功!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.LoginDialog.Success"), ModMain.HintType.Finish); Finished(new[] { ResultJson["access_token"].ToString(), ResultJson["refresh_token"].ToString() }); return; } @@ -119,7 +109,7 @@ private void WorkThread() } else { - Finished(new Exception("正版验证轮询失败", ex)); + Finished(new Exception(Lang.Text("Launch.Account.LoginDialog.PollingFailed"), ex)); return; } } diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml index 73808287c..20ece2e8c 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml @@ -21,15 +21,18 @@ - - - - + - + - - + + Text="{DynamicResource Launch.Account.Auth.Back}" HorizontalAlignment="Center" /> + Text="{DynamicResource Launch.Account.Auth.Login}" HorizontalAlignment="Center" /> \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml.cs index 9c445bef6..20f092564 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginAuth.xaml.cs @@ -1,14 +1,13 @@ -using System.Net.Http; using System.Windows; using System.Windows.Controls; using Newtonsoft.Json.Linq; using PCL.Core.App; using PCL.Core.App.Localization; +using PCL.Core.IO.Net.Http; using PCL.Core.Minecraft.Yggdrasil; using PCL.Core.Utils; using PCL.Core.Utils.Exts; using PCL.Core.Utils.Validate; -using PCL.Core.IO.Net.Http; namespace PCL; @@ -18,7 +17,12 @@ public partial class PageLoginAuth // 预设服务器 private static readonly Dictionary PredefinedAuthServers = new() - { { "预设 - LittleSkin", "https://littleskin.cn/api/yggdrasil" }, { Lang.Text("Common.Option.Customize"), "" } }; + { + { Lang.Text("Launch.Account.Auth.Preset.LittleSkin"), "https://littleskin.cn/api/yggdrasil" }, + { Lang.Text("Common.Option.Customize"), "" } + }; + + private bool _isRegisterMode = true; public PageLoginAuth() { @@ -38,11 +42,8 @@ private void Reload() serverItems.Clear(); foreach (var serverName in PredefinedAuthServers.Keys) serverItems.Add(new MyComboBoxItem { Content = serverName }); - if (DraggedAuthServer is not null) - { - TextServer.Text = DraggedAuthServer; - DraggedAuthServer = null; - } + TextServer.Text = DraggedAuthServer; + DraggedAuthServer = null; } private void BtnBack_Click(object sender, EventArgs e) @@ -58,13 +59,13 @@ private void BtnLogin_Click(object sender, EventArgs e) if (string.IsNullOrWhiteSpace(TextServer.Text) || string.IsNullOrWhiteSpace(TextName.Text) || string.IsNullOrWhiteSpace(TextPass.Password)) { - ModMain.Hint("验证服务器、用户名与密码均不能为空!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Account.Auth.EmptyFields"), ModMain.HintType.Critical); return; } if (!TextServer.Text.IsMatch(RegexPatterns.HttpUri)) { - ModMain.Hint("输入的验证服务器地址无效", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Account.Auth.InvalidServer"), ModMain.HintType.Critical); return; } @@ -88,14 +89,25 @@ private void BtnLogin_Click(object sender, EventArgs e) await Task.Delay(50); } - if (ModLaunch.McLoginAuthLoader.State == ModBase.LoadState.Finished) - ModMain.FrmLaunchLeft.RefreshPage(true); - else if (ModLaunch.McLoginAuthLoader.State == ModBase.LoadState.Aborted) - ModMain.Hint("已取消登录!"); - else if (ModLaunch.McLoginAuthLoader.Error is null) - throw new Exception("未知错误!"); - else - throw new Exception(ModLaunch.McLoginAuthLoader.Error.Message, ModLaunch.McLoginAuthLoader.Error); + switch (ModLaunch.McLoginAuthLoader.State) + { + case ModBase.LoadState.Finished: + ModMain.FrmLaunchLeft.RefreshPage(true); + break; + case ModBase.LoadState.Aborted: + ModMain.Hint(Lang.Text("Launch.Account.Auth.Cancelled")); + break; + case ModBase.LoadState.Waiting: + case ModBase.LoadState.Loading: + case ModBase.LoadState.Failed: + default: + { + if (ModLaunch.McLoginAuthLoader.Error is null) + throw new Exception(Lang.Text("Launch.Account.Microsoft.Error.Unknown")); + throw new Exception(ModLaunch.McLoginAuthLoader.Error.Message, + ModLaunch.McLoginAuthLoader.Error); + } + } } catch (Exception ex) { @@ -108,7 +120,7 @@ private void BtnLogin_Click(object sender, EventArgs e) } else { - ModBase.Log(ex, "第三方登录尝试失败", ModBase.LogLevel.Msgbox); + ModBase.Log(ex, Lang.Text("Launch.Account.Auth.LoginFailed"), ModBase.LogLevel.Msgbox); } } finally @@ -116,7 +128,7 @@ private void BtnLogin_Click(object sender, EventArgs e) ModProfile.IsCreatingProfile = false; BtnLogin.IsEnabled = true; BtnBack.IsEnabled = true; - BtnLogin.Text = "登录"; + BtnLogin.Text = Lang.Text("Launch.Account.Auth.Login"); } })); } @@ -138,11 +150,9 @@ private void GetServerName() try { serverUri = await ApiLocation.TryRequestAsync(serverUriInput); - using (var resp = await HttpRequest.Create(serverUri).SendAsync()) - { - string responseText = await resp.AsStringAsync(); - serverName = await Task.Run(() => JObject.Parse(responseText)["meta"]["serverName"].ToString()); - } + using var resp = await HttpRequest.Create(serverUri).SendAsync(); + var responseText = await resp.AsStringAsync(); + serverName = await Task.Run(() => JObject.Parse(responseText)["meta"]["serverName"].ToString()); } catch (Exception ex) { @@ -156,7 +166,7 @@ private void GetServerName() } else { - TextServerName.Text = "验证服务器: " + serverName; + TextServerName.Text = Lang.Text("Launch.Account.Auth.ServerLabel", serverName); TextServerName.Visibility = Visibility.Visible; } }); @@ -165,19 +175,17 @@ private void GetServerName() // 链接处理 private void ComboName_TextChanged(object sender, TextChangedEventArgs e) { - BtnLink.Content = string.IsNullOrEmpty(TextName.Text) ? "注册账号" : "找回密码"; + _isRegisterMode = string.IsNullOrEmpty(TextName.Text); + BtnLink.Content = _isRegisterMode + ? Lang.Text("Launch.Account.Auth.Register") + : Lang.Text("Launch.Account.Auth.ForgotPassword"); } private void Btn_Click(object sender, EventArgs e) { - if (string.Equals(BtnLink.Content?.ToString(), "注册账号", StringComparison.OrdinalIgnoreCase)) - { - ModBase.OpenWebsite(Config.InstanceAuth.AuthRegisterAddress.ToString()); - } - else - { - ModBase.OpenWebsite(Config.InstanceAuth.AuthRegisterAddress.ToString().Replace("/auth/register", "/auth/forgot")); - } + ModBase.OpenWebsite(_isRegisterMode + ? Config.InstanceAuth.AuthRegisterAddress.ToString() + : Config.InstanceAuth.AuthRegisterAddress.ToString().Replace("/auth/register", "/auth/forgot")); } // 切换注册按钮可见性 @@ -191,8 +199,7 @@ private void ReloadRegisterButton() private void TextServer_TextChanged(object sender, TextChangedEventArgs e) { - string server = null; - PredefinedAuthServers.TryGetValue(TextServer.Text, out server); + PredefinedAuthServers.TryGetValue(TextServer.Text, out var server); if (server is not null) TextServer.Text = server; } } \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml index 2e1243c14..adf80f143 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml @@ -21,7 +21,7 @@ Data="M660.338 528.065c63.61-46.825 105.131-121.964 105.131-206.83 0-141.7-115.29-256.987-256.997-256.987-141.706 0-256.998 115.288-256.998 256.987 0 85.901 42.52 161.887 107.456 208.562-152.1 59.92-260.185 207.961-260.185 381.077 0 21.276 17.253 38.53 38.53 38.53 21.278 0 38.53-17.254 38.53-38.53 0-183.426 149.232-332.671 332.667-332.671 1.589 0 3.113-0.207 4.694-0.244 0.8 0.056 1.553 0.244 2.362 0.244 183.434 0 332.664 149.245 332.664 332.671 0 21.276 17.255 38.53 38.533 38.53 21.277 0 38.53-17.254 38.53-38.53 0-174.885-110.354-324.13-264.917-382.809z m-331.803-206.83c0-99.22 80.72-179.927 179.935-179.927s179.937 80.708 179.937 179.927c0 99.203-80.721 179.91-179.937 179.91s-179.935-80.708-179.935-179.91z" Fill="{DynamicResource ColorBrush2}" Opacity="0.7" Width="40" Stretch="Uniform" Grid.ColumnSpan="2" Margin="4,0,0,0" /> - @@ -29,12 +29,17 @@ - - + + - \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml.cs index 2abaa30f3..1926948d5 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginMs.xaml.cs @@ -42,13 +42,13 @@ private void BtnLogin_Click(object sender, EventArgs e) else if (ModLaunch.McLoginMsLoader.State == ModBase.LoadState.Aborted) throw new ThreadInterruptedException(); else if (ModLaunch.McLoginMsLoader.Error is null) - throw new Exception("未知错误!"); + throw new Exception(Lang.Text("Launch.Account.Microsoft.Error.Unknown")); else throw new Exception(ModLaunch.McLoginMsLoader.Error.Message, ModLaunch.McLoginMsLoader.Error); } catch (ThreadInterruptedException ex) { - ModMain.Hint("已取消登录!"); + ModMain.Hint(Lang.Text("Launch.Account.LoginCancelled")); } catch (Exception ex) { @@ -62,15 +62,12 @@ private void BtnLogin_Click(object sender, EventArgs e) else if (ex is AuthenticationException && ex.Message.ContainsF("SSL/TLS")) { ModBase.Log(ex, - """ - 正版登录验证失败,请考虑在 [设置 → 其他] 中关闭 [在正版登录时验证 SSL 证书],然后再试。 - - 原始错误信息: - """, ModBase.LogLevel.Msgbox); + Lang.Text("Launch.Account.Microsoft.LoginFailed.Message") + "\r\n" + ex.Message, + ModBase.LogLevel.Msgbox); } else { - ModBase.Log(ex, "正版登录尝试失败", ModBase.LogLevel.Msgbox); + ModBase.Log(ex, Lang.Text("Launch.Account.Microsoft.LoginFailed.Title"), ModBase.LogLevel.Msgbox); } } finally @@ -79,7 +76,7 @@ private void BtnLogin_Click(object sender, EventArgs e) { BtnLogin.IsEnabled = true; BtnBack.Visibility = Visibility.Visible; - BtnLogin.Text = "登录"; + BtnLogin.Text = Lang.Text("Launch.Account.Login"); }); } }, "Ms Login"); diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml index 0bd59bd20..c25256509 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml @@ -21,31 +21,38 @@ - - - + + + - - + - + + ToolTip="{DynamicResource Launch.Account.Offline.Uuid.Custom.ToolTip}" /> + ToolTip="{DynamicResource Launch.Account.Offline.Uuid.Custom.Input.ToolTip}" /> + Text="{DynamicResource Launch.Account.Offline.Back}" HorizontalAlignment="Center" /> + ColorType="Highlight" Text="{DynamicResource Launch.Account.Offline.Create}" + HorizontalAlignment="Center" /> \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml.cs index 90ccc58ef..4850ce23a 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginOffline.xaml.cs @@ -42,9 +42,9 @@ private void BtnLogin_Click(object sender, EventArgs e) var Username = TextName.Text; var UsernameValidateResult = new RegexValidator("^[A-z0-9_]{3,16}$").Validate(Username); if (!UsernameValidateResult.IsValid) - if (ModMain.MyMsgBox( - $"你输入的玩家 ID 不符合标准(3 - 16 位,只可以包含英文字母、数字与下划线),可能导致部分版本的游戏无法启动或发生错误。{"\r\n"}强烈建议使用规范的玩家 ID!{"\r\n"}如果你坚持,仍然可以继续创建档案。", - "玩家 ID 不符合规范", "继续", Lang.Text("Common.Action.Cancel"), IsWarn: true, ForceWait: true) == 2) + if (ModMain.MyMsgBox( + Lang.Text("Launch.Account.Offline.InvalidPlayerId.Message"), + Lang.Text("Launch.Account.Offline.InvalidPlayerId.Title"), Lang.Text("Common.Action.Continue"), Lang.Text("Common.Action.Cancel"), IsWarn: true, ForceWait: true) == 2) return; // UUID string UserUuid = null; @@ -55,7 +55,7 @@ private void BtnLogin_Click(object sender, EventArgs e) var UuidValidateResult = new RegexValidator("^[a-fA-F0-9]{32}$").Validate(UuidInput); if (RadioUuidCustom.Checked && !UuidValidateResult.IsValid) { - ModMain.Hint("UUID 不符合要求:" + UuidValidateResult, ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Account.Offline.InvalidUuid", UuidValidateResult), ModMain.HintType.Critical); return; } @@ -82,7 +82,7 @@ private void BtnLogin_Click(object sender, EventArgs e) ModProfile.SaveProfile(); ModProfile.SelectedProfile = NewProfile; ModProfile.IsCreatingProfile = false; - ModMain.Hint("档案新建成功!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Account.Profile.Created"), ModMain.HintType.Finish); ModBase.RunInUi(() => ModMain.FrmLaunchLeft.RefreshPage(true)); } } diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml index afc103a52..e77c7297e 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml @@ -17,9 +17,9 @@ - - + @@ -40,14 +40,14 @@ CornerRadius="5" Margin="0,0,4,0"> diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs index 8cb01a674..d0eef9d12 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs @@ -109,27 +109,27 @@ private void ProfileContMenuBuild(MyListItem sender, EventArgs e) { // 更改 UUID var btnEditUuid = new MyIconButton - { Logo = Icon.IconButtonEdit, ToolTip = "更改 UUID", Tag = sender.Tag }; + { Logo = Icon.IconButtonEdit, ToolTip = Lang.Text("Launch.Account.Profile.ChangeUuid"), Tag = sender.Tag }; ToolTipService.SetPlacement(btnEditUuid, PlacementMode.Center); ToolTipService.SetVerticalOffset(btnEditUuid, 30d); ToolTipService.SetHorizontalOffset(btnEditUuid, 2d); btnEditUuid.Click += EditProfileUuid; // 复制 UUID var btnCopyUuid = new MyIconButton - { Logo = Icon.IconButtonCopy, ToolTip = "复制 UUID", Tag = sender.Tag }; + { Logo = Icon.IconButtonCopy, ToolTip = Lang.Text("Launch.Account.Profile.CopyUuid"), Tag = sender.Tag }; ToolTipService.SetPlacement(btnCopyUuid, PlacementMode.Center); ToolTipService.SetVerticalOffset(btnCopyUuid, 30d); ToolTipService.SetHorizontalOffset(btnCopyUuid, 2d); btnCopyUuid.Click += CopyProfileUuid; // 更改验证服务器名称 var btnEditServerName = new MyIconButton - { Logo = Icon.IconButtonInfo, ToolTip = "更改验证服务器名称", Tag = sender.Tag }; + { Logo = Icon.IconButtonInfo, ToolTip = Lang.Text("Launch.Account.Profile.ChangeAuthServerName"), Tag = sender.Tag }; ToolTipService.SetPlacement(btnEditServerName, PlacementMode.Center); ToolTipService.SetVerticalOffset(btnEditServerName, 30d); ToolTipService.SetHorizontalOffset(btnEditServerName, 2d); btnEditServerName.Click += EditProfileServer; // 删除档案 - var btnDelete = new MyIconButton { Logo = Icon.IconButtonDelete, ToolTip = "删除档案", Tag = sender.Tag }; + var btnDelete = new MyIconButton { Logo = Icon.IconButtonDelete, ToolTip = Lang.Text("Launch.Account.Profile.Delete"), Tag = sender.Tag }; ToolTipService.SetPlacement(btnDelete, PlacementMode.Center); ToolTipService.SetVerticalOffset(btnDelete, 30d); ToolTipService.SetHorizontalOffset(btnDelete, 2d); @@ -166,14 +166,14 @@ private void CopyProfileUuid(object sender, EventArgs e) private void EditProfileServer(object sender, EventArgs e) { var profile = (ModProfile.McProfile)((MyIconButton)sender).Tag; - string name = ModMain.MyMsgBoxInput("修改验证服务器名称", "请输入新的验证服务器名称", profile.ServerName); + string name = ModMain.MyMsgBoxInput(Lang.Text("Launch.Account.Profile.EditServerName.Title"), Lang.Text("Launch.Account.Profile.EditServerName.Message"), profile.ServerName); if (name is not null) ModProfile.EditAuthServerName(profile, name); } // 删除档案 private void DeleteProfile(object sender, EventArgs e) { - if (ModMain.MyMsgBox($"你正在选择删除此档案,该操作无法撤销。{"\r\n"}确定继续?", "删除档案确认", "继续", Lang.Text("Common.Action.Cancel"), IsWarn: true, + if (ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.DeleteConfirm.Message"), Lang.Text("Launch.Account.Profile.DeleteConfirm.Title"), Lang.Text("Common.Action.Continue"), Lang.Text("Common.Action.Cancel"), IsWarn: true, ForceWait: true) == 2) return; ModProfile.RemoveProfile((ModProfile.McProfile)((MyIconButton)sender).Tag); diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml index 975e561b6..c6c9c1c3e 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml @@ -29,34 +29,43 @@ CornerRadius="5" Margin="0,8,0,0"> - - - - + + + + - - + + diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs index b87c49eb0..ebbb5bc26 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfileSkin.xaml.cs @@ -1,5 +1,6 @@ using System.Windows; using System.Windows.Input; +using PCL.Core.App.Localization; namespace PCL; @@ -97,7 +98,7 @@ private void BtnEditPassword_Click(object sender, RoutedEventArgs e) } else { - ModMain.Hint("当前档案不支持修改密码!"); + ModMain.Hint(Lang.Text("Launch.Account.ProfileSkin.PasswordUnsupported")); } } @@ -127,7 +128,7 @@ private void Skin_Click(object sender, RoutedEventArgs e) ModBase.OpenWebsite(ModProfile.SelectedProfile.Server.BeforeFirst("api/yggdrasil/authserver") + "user/closet"); else - ModMain.Hint("当前档案不支持修改皮肤!"); + ModMain.Hint(Lang.Text("Launch.Account.ProfileSkin.SkinUnsupported")); } // 保存皮肤 @@ -151,7 +152,7 @@ private void BtnSkinCape_Click(object sender, RoutedEventArgs e) ModBase.OpenWebsite(ModProfile.SelectedProfile.Server.BeforeFirst("api/yggdrasil/authserver") + "user/closet"); else - ModMain.Hint("当前档案不支持修改披风!"); + ModMain.Hint(Lang.Text("Launch.Account.ProfileSkin.CapeUnsupported")); } #endregion From b2753fb2ec074c79e17c144c7131d8ac2d28785e Mon Sep 17 00:00:00 2001 From: ClovenBugle Date: Fri, 22 May 2026 02:54:21 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E7=9A=AE=E8=82=A4=E3=80=81=E6=8A=AB?= =?UTF-8?q?=E9=A3=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 64 +++++++ .../App/Localization/Languages/zh-CN.xaml | 64 +++++++ .../Modules/Minecraft/ModMinecraft.cs | 10 +- .../Pages/PageLaunch/MySkin.xaml | 5 +- .../Pages/PageLaunch/MySkin.xaml.cs | 163 ++++++++---------- 5 files changed, 210 insertions(+), 96 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index ecb9180ff..bc5dad5bf 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -924,4 +924,68 @@ Back Continue + + + Save as + Change cape + Click to change skin (right click for more options) + Skin is being fetched, please wait! + Choose location to save skin + Skin Image Files (*.png)|*.png + Skin saved successfully! + There is a skin being fetched, please try again later! + Refreshing avatar... + Avatar refreshed! + Skin changed successfully! + + + Changing cape, please wait! + Login failed, unable to change cape! + Fetching cape list, please wait... + No Cape + Select Cape + Cape change failed + Cape change failed: {0} + Cape changed successfully! It will take effect after a while... + + + Migrator + Realms MapMaker + Mojira Moderator + Chinese Translator + Translator + Cobalt + Vanilla + Minecon 2011 Attendee + Minecon 2012 Attendee + Minecon 2013 Attendee + Minecon 2015 Attendee + Minecon 2016 Attendee + Cherry Blossom + 15th Anniversary + Purple Heart + Follower's + MCC 15th Year + Minecraft Experience + Mojang Office + Home + Menace + Yearn + Common + Pan + Founder's + Copper + Zombie Horse + + + Skin Files (*.png;*.jpg;*.webp)|*.png;*.jpg;*.webp + Select skin file + Skin image must be 64x32 or 64x64 pixels! + Skin file must be smaller than 24 KB, the selected file is {0} KB + Select skin model + Is this skin Steve model (wide arms) or Alex model (slim arms)? + Steve model + Alex model + I do not know + Please confirm the skin model on the skin download page before using this skin! \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index e301a77ea..c16ea3574 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -918,4 +918,68 @@ 返回 继续 + + + 另存为 + 更换披风 + 点击更换皮肤(右键查看更多选项) + 皮肤正在获取中,请稍候! + 选取保存皮肤的位置 + 皮肤图片文件(*.png)|*.png + 皮肤保存成功! + 有正在获取中的皮肤,请稍后再试! + 正在刷新头像…… + 已刷新头像! + 更改皮肤成功! + + + 正在更改披风中,请稍候! + 登录失败,无法更改披风! + 正在获取披风列表,请稍候…… + 无披风 + 选择披风 + 更改披风失败 + 更改披风失败:{0} + 更改披风成功!等待一段时间后将会生效…… + + + 迁移者披风 + Realms 地图制作者披风 + Mojira 管理员披风 + Crowdin 中文翻译者披风 + Crowdin 翻译者披风 + Cobalt 披风 + 原版披风 + Minecon 2011 参与者披风 + Minecon 2012 参与者披风 + Minecon 2013 参与者披风 + Minecon 2015 参与者披风 + Minecon 2016 参与者披风 + 樱花披风 + 15 周年纪念披风 + 紫色心形披风 + 追随者披风 + MCC 15 周年披风 + 村民救援披风 + Mojang 办公室披风 + 家园披风 + 入侵披风 + 渴望披风 + 普通披风 + 薄煎饼披风 + 创始人披风 + 铜披风 + 僵尸马披风 + + + 皮肤文件(*.png;*.jpg;*.webp)|*.png;*.jpg;*.webp + 选择皮肤文件 + 皮肤图片大小应为 64x32 像素或 64x64 像素! + 皮肤文件大小需小于 24 KB,而所选文件大小为 {0} KB + 选择皮肤种类 + 此皮肤为 Steve 模型(粗手臂)还是 Alex 模型(细手臂)? + Steve 模型 + Alex 模型 + 我不知道 + 请在皮肤下载页面确认皮肤种类后再使用此皮肤! \ No newline at end of file diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs index 2ded6f1b1..1cd191672 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs @@ -2437,7 +2437,7 @@ public struct McSkinInfo /// public static McSkinInfo McSkinSelect() { - var FileName = SystemDialogs.SelectFile("皮肤文件(*.png;*.jpg;*.webp)|*.png;*.jpg;*.webp", "选择皮肤文件"); + var FileName = SystemDialogs.SelectFile(Lang.Text("Launch.Skin.FileDialog.Filter"), Lang.Text("Launch.Skin.FileDialog.Title")); // 验证有效性 if (string.IsNullOrEmpty(FileName)) @@ -2447,14 +2447,14 @@ public static McSkinInfo McSkinSelect() var Image = new MyBitmap(FileName); if (Image.Pic.Width != 64 || !(Image.Pic.Height == 32 || Image.Pic.Height == 64)) { - ModMain.Hint("皮肤图片大小应为 64x32 像素或 64x64 像素!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Skin.InvalidSize"), ModMain.HintType.Critical); return new McSkinInfo { IsVaild = false }; } var FileInfo = new FileInfo(FileName); if (FileInfo.Length > 24 * 1024) { - ModMain.Hint("皮肤文件大小需小于 24 KB,而所选文件大小为 " + Lang.Number(FileInfo.Length / 1024d, "N2") + " KB", + ModMain.Hint(Lang.Text("Launch.Skin.FileTooLarge", Lang.Number(FileInfo.Length / 1024d, "N2")), ModMain.HintType.Critical); return new McSkinInfo { IsVaild = false }; } @@ -2466,11 +2466,11 @@ public static McSkinInfo McSkinSelect() } // 获取皮肤种类 - var IsSlim = ModMain.MyMsgBox("此皮肤为 Steve 模型(粗手臂)还是 Alex 模型(细手臂)?", "选择皮肤种类", "Steve 模型", "Alex 模型", "我不知道", + var IsSlim = ModMain.MyMsgBox(Lang.Text("Launch.Skin.Model.SelectMessage"), Lang.Text("Launch.Skin.Model.SelectTitle"), Lang.Text("Launch.Skin.Model.Steve"), Lang.Text("Launch.Skin.Model.Alex"), Lang.Text("Launch.Skin.Model.Unknown"), HighLight: false); if (IsSlim == 3) { - ModMain.Hint("请在皮肤下载页面确认皮肤种类后再使用此皮肤!"); + ModMain.Hint(Lang.Text("Launch.Skin.Model.UnknownHint")); return new McSkinInfo { IsVaild = false }; } diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml index 6daff17f8..719823b3f 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml @@ -15,11 +15,12 @@ - - diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs index 53a248236..06e0add68 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs @@ -6,9 +6,9 @@ using System.Windows.Input; using System.Windows.Media; using Newtonsoft.Json.Linq; +using PCL.Core.App.Localization; using PCL.Core.UI; using PCL.Network; -using PCL.Core.App.Localization; namespace PCL; @@ -44,7 +44,9 @@ public string Address set { _Address = value; - ToolTip = string.IsNullOrEmpty(_Address) ? Lang.Text("Common.State.Loading") : "点击更换皮肤(右键查看更多选项)"; + ToolTip = string.IsNullOrEmpty(_Address) + ? Lang.Text("Common.State.Loading") + : Lang.Text("Launch.Skin.Change.ToolTip"); } } @@ -52,13 +54,7 @@ public string Address public bool HasCape { get => BtnSkinCape.Visibility == Visibility.Collapsed; - set - { - if (value) - BtnSkinCape.Visibility = Visibility.Visible; - else - BtnSkinCape.Visibility = Visibility.Collapsed; - } + set => BtnSkinCape.Visibility = value ? Visibility.Visible : Visibility.Collapsed; } // 事件 @@ -92,11 +88,9 @@ private void PanSkin_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) ModAnimation.AniStart( ModAnimation.AaScaleTransform(this, 1d - ((ScaleTransform)RenderTransform).ScaleX, 60, Ease: new ModAnimation.AniEaseOutFluent()), "Skin Scale"); - if (IsSkinMouseDown) - { - IsSkinMouseDown = false; - Click?.Invoke(sender, e); - } + if (!IsSkinMouseDown) return; + IsSkinMouseDown = false; + Click?.Invoke(sender, e); } // 保存皮肤 @@ -108,33 +102,32 @@ public void BtnSkinSave_Click(object sender, RoutedEventArgs e) public static void Save(ModLoader.LoaderTask, string> Loader) { var Address = Loader.Output; - if (!(Loader.State == ModBase.LoadState.Finished)) + if (Loader.State != ModBase.LoadState.Finished) { - ModMain.Hint("皮肤正在获取中,请稍候!", ModMain.HintType.Critical); - if (!(Loader.State == ModBase.LoadState.Loading)) + ModMain.Hint(Lang.Text("Launch.Skin.Fetching"), ModMain.HintType.Critical); + if (Loader.State != ModBase.LoadState.Loading) Loader.Start(); return; } try { - var FileAddress = SystemDialogs.SelectSaveFile("选取保存皮肤的位置", ModBase.GetFileNameFromPath(Address), - "皮肤图片文件(*.png)|*.png"); - if (FileAddress.Contains(@"\")) + var FileAddress = SystemDialogs.SelectSaveFile(Lang.Text("Launch.Skin.SaveDialog.Title"), + ModBase.GetFileNameFromPath(Address), + Lang.Text("Launch.Skin.SaveDialog.Filter")); + if (!FileAddress.Contains(@"\")) return; + File.Delete(FileAddress); + if (Address.StartsWith(ModBase.PathImage)) { - File.Delete(FileAddress); - if (Address.StartsWith(ModBase.PathImage)) - { - var Image = new MyBitmap(Address); - Image.Save(FileAddress); - } - else - { - ModBase.CopyFile(Address, FileAddress); - } - - ModMain.Hint("皮肤保存成功!", ModMain.HintType.Finish); + var Image = new MyBitmap(Address); + Image.Save(FileAddress); } + else + { + ModBase.CopyFile(Address, FileAddress); + } + + ModMain.Hint(Lang.Text("Launch.Skin.SaveSuccess"), ModMain.HintType.Finish); } catch (Exception ex) { @@ -229,10 +222,10 @@ public void Load() } if (ImgFore.Source is not null) - using (Bitmap HairBitmap = Image.Clip(Scale * 40, Scale * 8, Scale * 8, Scale * 8)) - { - g.DrawImage(HairBitmap, new Rectangle(0, 0, 56, 56)); - } + { + using Bitmap HairBitmap = Image.Clip(Scale * 40, Scale * 8, Scale * 8, Scale * 8); + g.DrawImage(HairBitmap, new Rectangle(0, 0, 56, 56)); + } } if (!Directory.Exists(ModBase.PathTemp + @"Cache\Skin\Head")) @@ -249,12 +242,10 @@ public void Load() private object ScaleToSize(Bitmap Bitmap, int Width, int Height) { var ScaledBitmap = new Bitmap(Width, Height); - using (var g = Graphics.FromImage(ScaledBitmap)) - { - g.InterpolationMode = InterpolationMode.NearestNeighbor; - g.PixelOffsetMode = PixelOffsetMode.Half; - g.DrawImage(Bitmap, 0, 0, Width, Height); - } + using var g = Graphics.FromImage(ScaledBitmap); + g.InterpolationMode = InterpolationMode.NearestNeighbor; + g.PixelOffsetMode = PixelOffsetMode.Half; + g.DrawImage(Bitmap, 0, 0, Width, Height); return ScaledBitmap; } @@ -280,17 +271,12 @@ public void RefreshClick(object sender, RoutedEventArgs e) /// public static void RefreshCache(ModLoader.LoaderTask, string> sender = null) { - var HasLoaderRunning = false; - foreach (var SkinLoader in PageLaunchLeft.SkinLoaders) - if (SkinLoader.State == ModBase.LoadState.Loading) - { - HasLoaderRunning = true; - break; - } + var HasLoaderRunning = + PageLaunchLeft.SkinLoaders.Any(SkinLoader => SkinLoader.State == ModBase.LoadState.Loading); if (ModMain.FrmLaunchLeft is not null && HasLoaderRunning) // 由于 Abort 不是实时的,暂时不会释放文件,会导致删除报错,故只能取消执行 - ModMain.Hint("有正在获取中的皮肤,请稍后再试!"); + ModMain.Hint(Lang.Text("Launch.Skin.Refresh.Busy")); else // 清空缓存 // 刷新控件 @@ -298,7 +284,7 @@ public static void RefreshCache(ModLoader.LoaderTask {1}", ModProfile.SelectedProfile.Uuid, SkinAddress)); + ModBase.Log($"[Skin] 已写入皮肤地址缓存 {ModProfile.SelectedProfile.Uuid} -> {SkinAddress}"); foreach (var SkinLoader in new[] { PageLaunchLeft.SkinMs, PageLaunchLeft.SkinLegacy }) SkinLoader.WaitForExit(IsForceRestart: true); - ModMain.Hint("更改皮肤成功!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Skin.ChangeSuccess"), ModMain.HintType.Finish); } catch (Exception ex) { @@ -352,17 +338,17 @@ public void BtnSkinCape_Click(object sender, RoutedEventArgs e) // 检查条件,获取新披风 if (IsChanging) { - ModMain.Hint("正在更改披风中,请稍候!"); + ModMain.Hint(Lang.Text("Launch.Skin.Cape.Changing")); return; } if (ModLaunch.McLoginMsLoader.State == ModBase.LoadState.Failed) { - ModMain.Hint("登录失败,无法更改披风!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Skin.Cape.LoginFailed"), ModMain.HintType.Critical); return; } - ModMain.Hint("正在获取披风列表,请稍候……"); + ModMain.Hint(Lang.Text("Launch.Skin.Cape.FetchingList")); IsChanging = true; // 开始实际获取 ModBase.RunInNewThread(() => @@ -374,7 +360,7 @@ public void BtnSkinCape_Click(object sender, RoutedEventArgs e) ModLaunch.McLoginMsLoader.WaitForExit(ModProfile.GetLoginData()); if (ModLaunch.McLoginMsLoader.State != ModBase.LoadState.Finished) { - ModMain.Hint("登录失败,无法更改披风!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Launch.Skin.Cape.LoginFailed"), ModMain.HintType.Critical); return; } @@ -404,41 +390,25 @@ public void BtnSkinCape_Click(object sender, RoutedEventArgs e) } // 获取玩家的所有披风 - int? SelId = default; + int? SelId = null; ModBase.RunInUiWait(() => { try { - var CapeNames = new Dictionary - { - { "Migrator", "迁移者披风" }, { "MapMaker", "Realms 地图制作者披风" }, { "Moderator", "Mojira 管理员披风" }, - { "Translator-Chinese", "Crowdin 中文翻译者披风" }, { "Translator", "Crowdin 翻译者披风" }, - { "Cobalt", "Cobalt 披风" }, { "Vanilla", "原版披风" }, { "Minecon2011", "Minecon 2011 参与者披风" }, - { "Minecon2012", "Minecon 2012 参与者披风" }, { "Minecon2013", "Minecon 2013 参与者披风" }, - { "Minecon2015", "Minecon 2015 参与者披风" }, { "Minecon2016", "Minecon 2016 参与者披风" }, - { "Cherry Blossom", "樱花披风" }, { "15th Anniversary", "15 周年纪念披风" }, - { "Purple Heart", "紫色心形披风" }, { "Follower's", "追随者披风" }, { "MCC 15th Year", "MCC 15 周年披风" }, - { "Minecraft Experience", "村民救援披风" }, { "Mojang Office", "Mojang 办公室披风" }, - { "Home", "家园披风" }, { "Menace", "入侵披风" }, { "Yearn", "渴望披风" }, { "Common", "普通披风" }, - { "Pan", "薄煎饼披风" }, { "Founder's", "创始人披风" }, { "Copper", "铜披风" }, - { "Zombie Horse", "僵尸马披风" } - }; var SelectionControl = new List { new MyListItem { - Title = "无披风", + Title = Lang.Text("Launch.Skin.Cape.None"), Info = "Null" } }; - foreach (var Cape in SkinData["capes"]) - { - var CapeName = Cape["alias"].ToString(); - if (CapeNames.ContainsKey(CapeName)) - CapeName = CapeNames[CapeName]; - var state = Cape["state"]; // 检测披风状态,若为 ACTIVE 则选中 - var active = state is not null & state.ToString().ToUpper().Equals("ACTIVE"); - SelectionControl.Add(new MyListItem + SelectionControl.AddRange(from Cape in SkinData["capes"] + let CapeAlias = Cape["alias"].ToString() + let CapeName = _GetCapeDisplayName(CapeAlias) + let state = Cape["state"] + let active = state is not null & state.ToString().ToUpper().Equals("ACTIVE") + select new MyListItem { Title = CapeName, Info = Cape["alias"].ToString(), @@ -447,9 +417,9 @@ public void BtnSkinCape_Click(object sender, RoutedEventArgs e) Logo = (string)Cape["url"], LogoScale = 0.8d }); - } - SelId = ModMain.MyMsgBoxSelect(SelectionControl, "选择披风", Lang.Text("Common.Action.Confirm"), Lang.Text("Common.Action.Cancel")); + SelId = ModMain.MyMsgBoxSelect(SelectionControl, Lang.Text("Launch.Skin.Cape.SelectTitle"), + Lang.Text("Common.Action.Confirm"), Lang.Text("Common.Action.Cancel")); } catch (Exception ex) { @@ -462,8 +432,8 @@ public void BtnSkinCape_Click(object sender, RoutedEventArgs e) var Result = Requester.Fetch("https://api.minecraftservices.com/minecraft/profile/capes/active", new FetchParam { - Method = SelId.HasValue && SelId.Value == 0 ? "DELETE" : "PUT", - Content = SelId.HasValue && SelId.Value == 0 + Method = SelId is 0 ? "DELETE" : "PUT", + Content = SelId is 0 ? "" : new JObject(new JProperty("capeId", SkinData["capes"][SelId - 1]["id"])).ToString(0), ContentType = "application/json", @@ -471,9 +441,11 @@ public void BtnSkinCape_Click(object sender, RoutedEventArgs e) } ); if (Result.Contains("\"errorMessage\"")) - ModMain.Hint("更改披风失败:" + ((JObject)ModBase.GetJson(Result))["errorMessage"], ModMain.HintType.Critical); + ModMain.Hint( + Lang.Text("Launch.Skin.Cape.ChangeFailedWithReason", + ((JObject)ModBase.GetJson(Result))["errorMessage"]), ModMain.HintType.Critical); else - ModMain.Hint("更改披风成功!等待一段时间后将会生效……", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Launch.Skin.Cape.ChangeSuccess"), ModMain.HintType.Finish); } catch (Exception ex) { @@ -485,4 +457,17 @@ public void BtnSkinCape_Click(object sender, RoutedEventArgs e) } }, "Cape Change"); } -} + + private static string _GetCapeDisplayName(string capeAlias) + { + var safeName = capeAlias + .Replace("-", "") + .Replace(" ", "") + .Replace("'", ""); + var key = $"Launch.Skin.Cape.Name.{safeName}"; + var name = Lang.Text(key); + if (name == $"!{key}!" || name == key) + return capeAlias; + return name; + } +} \ No newline at end of file From efe1b6e5eb28de0e2005ee69efd7811bd7e9b354 Mon Sep 17 00:00:00 2001 From: ClovenBugle Date: Fri, 22 May 2026 04:06:09 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A1=B5=EF=BC=9A=E5=B7=A6=E4=BE=A7=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=81=E5=8F=B3=E4=BE=A7=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 109 +++++ .../App/Localization/Languages/zh-CN.xaml | 110 +++++ .../Modules/Minecraft/ModMinecraft.cs | 44 +- .../Pages/PageSelectLeft.xaml.cs | 419 +++++++++--------- .../Pages/PageSelectRight.xaml | 17 +- .../Pages/PageSelectRight.xaml.cs | 88 ++-- 6 files changed, 500 insertions(+), 287 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index bc5dad5bf..6799dced4 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -988,4 +988,113 @@ Alex model I do not know Please confirm the skin model on the skin download page before using this skin! + + + Folder list + Rename + Move up + Move down + Clear + Restore Name + Remove from list + Add or Import + Create .minecraft Folder + Create a new .minecraft folder in the PCL directory + Add Existing Folder + Add an existing Minecraft folder to the list + Import Modpack + Install a modpack into the currently selected Minecraft folder + Cannot add game folder while a download is in progress! + Minecraft folder path cannot contain exclamation marks or semicolons! + Enter Display Name + Enter the display name for this folder in the sidebar list. + Failed to add folder: PCL does not have permission to access this folder! + This folder is already in the list! + Folder name updated to {0}! + Folder {0} added! + Cannot create game folder while a download is in progress! + .minecraft folder created successfully! + Config Cleanup + Do you want to clean up PCL's configuration files in this folder? This includes per-instance settings (such as custom icons, third-party login configs) and does not affect the game itself. + Keep + Folder {0} has been removed from the list! + Folder name restored! + Delete Warning + Confirm Delete + Are you sure you want to delete this folder? Target folder: {0} All saves and other files in this folder will be permanently lost and cannot be recovered! + If you have stored files other than Minecraft in this folder, they will also be deleted! Continuing will cause all files in this folder to be permanently lost. Please double-check before proceeding! Target folder: {0} This is the final warning! + Deleting folder {0}... + Folder {0} deleted! + Confirm Clear + Are you sure you want to clear this folder? Target folder: {0} All saves and other files in this folder will be permanently lost and cannot be recovered! + If you have stored files other than Minecraft in this folder, they will also be cleared! Continuing will cause all files in this folder to be permanently lost. Please double-check before proceeding! Target folder: {0} This is the final warning! + Clearing folder {0}... + Folder {0} cleared! + Enter new name + Cannot switch game folder while a download is in progress! + + + Current Folder + Official Launcher Folder + Invalid Minecraft folder: {0} + Minecraft folder is invalid + Minecraft Folder Unavailable + + + Search game instances + Enter instance name or [game version] [mod loader] to search + No Instances Available + No game instances found. Please download a game instance first. If you have existing instances, select "Add Folder" in the left sidebar and import the .minecraft folder. + Download + No Matches + Fetching instance list + Regular + Moddable + Forge + NeoForge + Cleanroom + LabyMod + LiteLoader + Quilt + Fabric + Error + Hidden + Less-used + Favorites + April Fools' + No Hidden Instances + No instances are hidden. You can hide instances in the instance category settings. Press F11 again to exit hidden instance viewing mode. + No Matching Hidden Instances + Please enter a search query + No hidden instances matching '{0}' found + No instances matching '{0}' found + Favorite + Unfavorite + Open Instance Folder + Settings + Confirm Instance Deletion + permanently + Are you sure you want to {0}delete instance {1}? + Since version isolation is enabled for this instance, saves, resource packs, mods, and other files will also be deleted! + Instance {0} has been permanently deleted! + Instance {0} has been moved to the recycle bin! + + + This instance has not been loaded. Please report this issue to the author. + PCL cannot recognize the MC version number of this version + Instance {0} not found + PCL does not have permission to access this folder. Please run PCL as administrator. + Requires {0} to be installed as a parent instance + Unknown error + Pre-release {0} + Release candidate {0} + Experimental snapshot{0} + Experimental snapshot + Snapshot {0} + Snapshot + Release {0} + Release + Old version + April Fools' {0} + An unknown error has occurred. Please report this issue to the author. \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index c16ea3574..5b1b57430 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -982,4 +982,114 @@ Alex 模型 我不知道 请在皮肤下载页面确认皮肤种类后再使用此皮肤! + + + 文件夹列表 + 重命名 + 上移 + 下移 + 清空 + 复原名称 + 移出列表 + 添加或导入 + 新建 .minecraft 文件夹 + 在 PCL 当前所在文件夹下创建新的 .minecraft 文件夹 + 添加已有文件夹 + 将一个已有的 Minecraft 文件夹添加到列表 + 导入整合包 + 在当前选择的 Minecraft 文件夹下安装整合包 + 在下载任务进行时,无法添加游戏文件夹! + Minecraft 文件夹路径中不能含有感叹号或分号! + 输入显示名称 + 输入该文件夹在左边栏列表中显示的名称。 + 添加文件夹失败:PCL 没有访问该文件夹的权限! + 此文件夹已在列表中! + 文件夹名称已更新为 {0}! + 文件夹 {0} 已添加! + 在下载任务进行时,无法创建游戏文件夹! + 新建 .minecraft 文件夹成功! + 配置文件清理 + 是否需要清理 PCL 在该文件夹中的配置文件? 这包括各个实例的独立设置(如自定义图标、第三方登录配置)等,对游戏本身没有影响。 + 保留 + 文件夹 {0} 已从列表中移除! + 文件夹名称已复原! + 删除警告 + 确认删除 + 你确定要删除这个文件夹吗? 目标文件夹:{0} 这会导致该文件夹中的所有存档与其他文件永久丢失,且不可恢复! + 如果你在该文件夹中存放了除 MC 以外的其他文件,这些文件也会被一同删除! 继续删除会导致该文件夹中的所有文件永久丢失,请在仔细确认后再继续! 目标文件夹:{0} 这是最后一次警告! + 正在删除文件夹 {0}! + 已删除文件夹 {0}! + + 确认清空 + 你确定要清空这个文件夹吗? 目标文件夹:{0} 这会导致该文件夹中的所有存档与其他文件永久丢失,且不可恢复! + 如果你在该文件夹中存放了除 MC 以外的其他文件,这些文件也会被一同清空! 继续清空会导致该文件夹中的所有文件永久丢失,请在仔细确认后再继续! 目标文件夹:{0} 这是最后一次警告! + 正在清空文件夹 {0}! + 已清空文件夹 {0}! + 输入新名称 + 在下载任务进行时,无法切换游戏文件夹! + + + 当前文件夹 + 官方启动器文件夹 + 无效的 Minecraft 文件夹:{0} + Minecraft 文件夹失效 + Minecraft 文件夹失效 + + + 搜索游戏实例 + 输入实例名称或 [游戏版本号] [Mod 加载器] 进行搜索 + 无可用实例 + 未找到任何游戏实例,请先下载一个游戏实例。 若有已存在的实例,请在左边的列表中选择添加文件夹,选择 .minecraft 文件夹将其导入。 + 下载游戏 + 无匹配的游戏实例 + 正在获取实例列表 + 常规实例 + 可安装 Mod + Forge 实例 + NeoForge 实例 + Cleanroom 实例 + LabyMod 实例 + LiteLoader 实例 + Quilt 实例 + Fabric 实例 + 错误的实例 + 隐藏的实例 + 不常用实例 + 收藏夹 + 愚人节版本 + 无隐藏实例 + 没有实例被隐藏,你可以在实例设置的实例分类选项中隐藏实例。 再次按下 F11 即可退出隐藏实例查看模式。 + 无匹配的隐藏实例 + 请输入搜索内容 + 没有找到与 '{0}' 匹配的隐藏实例 + 没有找到与 '{0}' 匹配的实例 + 收藏 + 取消收藏 + 打开实例目录 + 设置 + 实例删除确认 + 永久 + 你确定要{0}删除实例 {1} 吗? + 由于该实例开启了版本隔离,删除时该实例对应的存档、资源包、Mod 等文件也将被一并删除! + 实例 {0} 已永久删除! + 实例 {0} 已删除到回收站! + + + 该实例未被加载,请向作者反馈此问题 + PCL 无法识别该版本的 MC 版本号 + 未找到实例 {0} + PCL 没有对该文件夹的访问权限,请右键以管理员身份运行 PCL + 需要安装 {0} 作为前置实例 + 未知错误 + 预发布版 {0} + 发布候选 {0} + 实验性快照{0} + 实验性快照 + 快照版 {0} + 快照版 + 正式版 {0} + 正式版 + 远古版本 + 愚人节版本 {0} + 发生了未知错误,请向作者反馈此问题 \ No newline at end of file diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs index 1cd191672..bccaf1339 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs @@ -264,7 +264,7 @@ private static void McFolderListLoadSub() continue; if (!folder.Contains(">") || !folder.EndsWithF(@"\")) { - ModMain.Hint("无效的 Minecraft 文件夹:" + folder, ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Select.Folder.Invalid", folder), ModMain.HintType.Critical); continue; } @@ -278,8 +278,8 @@ private static void McFolderListLoadSub() catch (Exception ex) { ModMain.MyMsgBox( - "失效的 Minecraft 文件夹:" + "\r\n" + path + "\r\n" + "\r\n" + - ex.Message, "Minecraft 文件夹失效", IsWarn: true); + Lang.Text("Select.Folder.Invalid", path) + "\r\n" + "\r\n" + + ex.Message, Lang.Text("Select.Folder.InvalidTitle"), IsWarn: true); ModBase.Log(ex, $"无法访问 Minecraft 文件夹 {path}"); } } @@ -295,7 +295,7 @@ private static void McFolderListLoadSub() { if (Directory.Exists(ModBase.ExePath + @"versions\")) originalMcFolderList.Add(new McFolder - { Name = "当前文件夹", Location = ModBase.ExePath, Type = McFolder.Types.Original }); + { Name = Lang.Text("Select.Folder.CurrentFolder"), Location = ModBase.ExePath, Type = McFolder.Types.Original }); foreach (var folder in new DirectoryInfo(ModBase.ExePath).GetDirectories()) if (Directory.Exists(Path.Combine(folder.FullName, "versions")) || folder.Name == ".minecraft") { @@ -316,7 +316,7 @@ private static void McFolderListLoadSub() Directory.Exists(Path.Combine(MojangPath, "versions"))) // 当前文件夹不是官启文件夹 // 具有权限且存在 versions 文件夹 originalMcFolderList.Add(new McFolder - { Name = "官方启动器文件夹", Location = MojangPath, Type = McFolder.Types.Original }); + { Name = Lang.Text("Select.Folder.OfficialLauncherFolder"), Location = MojangPath, Type = McFolder.Types.Original }); ModBase.Log(cacheMcFolderList.Count + " 个自定义文件夹," + originalMcFolderList.Count + " 个原始文件夹"); @@ -356,7 +356,7 @@ private static void McFolderListLoadSub() { Directory.CreateDirectory(ModBase.ExePath + @".minecraft\versions\"); cacheMcFolderList.Add(new McFolder - { Name = "当前文件夹", Location = ModBase.ExePath + @".minecraft\", Type = McFolder.Types.Original }); + { Name = Lang.Text("Select.Folder.CurrentFolder"), Location = ModBase.ExePath + @".minecraft\", Type = McFolder.Types.Original }); } foreach (var Folder in cacheMcFolderList) McFolderLauncherProfilesJsonCreate(Folder.Location); @@ -448,7 +448,7 @@ public class McInstance /// /// 显示的描述文本。 /// - public string Desc = "该实例未被加载,请向作者反馈此问题"; + public string Desc = Lang.Text("Select.Instance.Description.NotLoaded"); /// /// 强制实例分类,0 为未启用,1 为隐藏,2 及以上为其他普通分类。 @@ -753,7 +753,7 @@ public McInstanceInfo Info // 无法获取 _info.VanillaName = "Unknown"; - Desc = "PCL 无法识别该版本的 MC 版本号"; + Desc = Lang.Text("Select.Instance.Description.UnknownMcVersion"); } catch (Exception ex) { @@ -1039,7 +1039,7 @@ public bool Check() if (!Directory.Exists(PathInstance)) { State = McInstanceState.Error; - Desc = "未找到实例 " + Name; + Desc = Lang.Text("Select.Instance.Description.NotFound", Name); return false; } @@ -1052,7 +1052,7 @@ public bool Check() catch (Exception ex) { State = McInstanceState.Error; - Desc = "PCL 没有对该文件夹的访问权限,请右键以管理员身份运行 PCL"; + Desc = Lang.Text("Select.Instance.Description.NoPermission"); ModBase.Log(ex, "没有访问实例文件夹的权限"); return false; } @@ -1093,7 +1093,7 @@ public bool Check() if (!File.Exists(Path.Combine(ModBase.GetPathFromFullPath(PathInstance), InheritInstanceName, InheritInstanceName + ".json"))) { State = McInstanceState.Error; - Desc = "需要安装 " + InheritInstanceName + " 作为前置实例"; + Desc = Lang.Text("Select.Instance.Description.NeedInherit", InheritInstanceName); return false; } } @@ -1101,7 +1101,7 @@ public bool Check() { ModBase.Log(ex, "依赖实例检查出错(" + Name + ")"); State = McInstanceState.Error; - Desc = "未知错误:" + ex; + Desc = Lang.Text("Select.Instance.Description.UnknownError") + ": " + ex; return false; } @@ -1339,7 +1339,7 @@ public McInstance Load() } catch (Exception ex) { - Desc = "未知错误:" + ex; + Desc = Lang.Text("Select.Instance.Description.UnknownError") + ": " + ex; Logo = ModBase.PathImage + "Blocks/RedstoneBlock.png"; State = McInstanceState.Error; ModBase.Log(ex, "加载实例失败(" + Name + ")", ModBase.LogLevel.Feedback); @@ -1401,28 +1401,28 @@ public string GetDefaultDescription() case McInstanceState.LiteLoader: { if (this.Info.VanillaName.ContainsF("pre", true)) - Info = "预发布版 " + this.Info.VanillaName; + Info = Lang.Text("Select.Instance.Description.PreRelease", this.Info.VanillaName); else if (this.Info.VanillaName.ContainsF("rc", true)) - Info = "发布候选 " + this.Info.VanillaName; + Info = Lang.Text("Select.Instance.Description.ReleaseCandidate", this.Info.VanillaName); else if (this.Info.VanillaName.Contains("experimental")) - Info = "实验性快照" + this.Info.VanillaName; + Info = Lang.Text("Select.Instance.Description.ExperimentalSnapshot", this.Info.VanillaName); else if (this.Info.VanillaName == "pending") - Info = "实验性快照"; + Info = Lang.Text("Select.Instance.Description.ExperimentalSnapshot.Pending"); else if (IsSnapshot()) - Info = this.Info.Reliable ? "快照版 " + this.Info.VanillaName.Replace("-snapshot", "") : "快照版"; + Info = this.Info.Reliable ? Lang.Text("Select.Instance.Description.Snapshot", this.Info.VanillaName.Replace("-snapshot", "")) : Lang.Text("Select.Instance.Description.Snapshot.Unknown"); else - Info = this.Info.Reliable ? "正式版 " + this.Info.VanillaName : "正式版"; + Info = this.Info.Reliable ? Lang.Text("Select.Instance.Description.Release", this.Info.VanillaName) : Lang.Text("Select.Instance.Description.Release.Unknown"); break; } case McInstanceState.Old: { - Info = "远古版本"; + Info = Lang.Text("Select.Instance.Description.Old"); break; } case McInstanceState.Fool: { - Info = "愚人节版本 " + this.Info.VanillaName; + Info = Lang.Text("Select.Instance.Description.AprilFools", this.Info.VanillaName); break; } case McInstanceState.Error: @@ -1432,7 +1432,7 @@ public string GetDefaultDescription() default: { - return "发生了未知错误,请向作者反馈此问题"; + return Lang.Text("Select.Instance.Description.ReportUnknownError"); } } diff --git a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs b/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs index 560049bb1..e1c980b79 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs @@ -1,16 +1,14 @@ -using System.Collections.ObjectModel; using System.IO; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Input; -using FluentValidation; using PCL.Core.App; +using PCL.Core.App.Localization; using PCL.Core.Logging; using PCL.Core.UI; using PCL.Core.Utils.Validate; using PCL.Network; -using PCL.Core.App.Localization; namespace PCL; @@ -22,7 +20,7 @@ public partial class PageSelectLeft : IRefreshable public PageSelectLeft() { Initialized += PageSelectLeft_Initialized; - Loaded += PageSelectLeft_Loaded; + Loaded += PageSelectLeft_Loaded; InitializeComponent(); } @@ -62,7 +60,7 @@ private void McFolderListUI() // 文件夹列表标题 ModMain.FrmSelectLeft.PanList.Children.Add(new TextBlock { - Text = "文件夹列表", + Text = Lang.Text("Select.Folder.ListTitle"), Margin = new Thickness(13, 18, 5, 4), Opacity = 0.6, FontSize = 12 @@ -107,38 +105,54 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd switch (folder.Type) { case ModMinecraft.McFolder.Types.Original: - AddMenuItem("Rename", "重命名", ICON_RENAME, new Thickness(0, 2, 0, 0), + AddMenuItem("Rename", Lang.Text("Select.Folder.Rename"), ICON_RENAME, new Thickness(0, 2, 0, 0), ModMain.FrmSelectLeft.Rename_Click); - AddMenuItem("MoveUp", "上移", ICON_MOVEUP, null, ModMain.FrmSelectLeft.MoveUp_Click); - AddMenuItem("MoveDown", "下移", ICON_MOVEDOWN, null, ModMain.FrmSelectLeft.MoveDown_Click); - AddMenuItem("Open", Lang.Text("Common.Action.Open"), ICON_OPEN, null, ModMain.FrmSelectLeft.Open_Click); - AddMenuItem("Refresh", Lang.Text("Common.Action.Refresh"), ICON_REFRESH, null, ModMain.FrmSelectLeft.Refresh_Click); + AddMenuItem("MoveUp", Lang.Text("Select.Folder.MoveUp"), ICON_MOVEUP, null, + ModMain.FrmSelectLeft.MoveUp_Click); + AddMenuItem("MoveDown", Lang.Text("Select.Folder.MoveDown"), ICON_MOVEDOWN, null, + ModMain.FrmSelectLeft.MoveDown_Click); + AddMenuItem("Open", Lang.Text("Common.Action.Open"), ICON_OPEN, null, + ModMain.FrmSelectLeft.Open_Click); + AddMenuItem("Refresh", Lang.Text("Common.Action.Refresh"), ICON_REFRESH, null, + ModMain.FrmSelectLeft.Refresh_Click); AddMenuItem("Delete", - ModMinecraft.McFolderList.Count == 1 && folder.Location == Path.Combine(ModBase.ExePath, ".minecraft") + @"\" - ? "清空" - : Lang.Text("Common.Action.Delete"), ICON_DELETE, new Thickness(0, 0, 0, 2), ModMain.FrmSelectLeft.Delete_Click); + ModMinecraft.McFolderList.Count == 1 && + folder.Location == Path.Combine(ModBase.ExePath, ".minecraft") + @"\" + ? Lang.Text("Select.Folder.Clear") + : Lang.Text("Common.Action.Delete"), ICON_DELETE, new Thickness(0, 0, 0, 2), + ModMain.FrmSelectLeft.Delete_Click); break; case ModMinecraft.McFolder.Types.RenamedOriginal: - AddMenuItem("Restore", "复原名称", ICON_RENAME, new Thickness(0, 2, 0, 0), + AddMenuItem("Restore", Lang.Text("Select.Folder.RestoreName"), ICON_RENAME, + new Thickness(0, 2, 0, 0), ModMain.FrmSelectLeft.Restore_Click); - AddMenuItem("Rename", "重命名", ICON_RENAME, null, ModMain.FrmSelectLeft.Rename_Click); - AddMenuItem("MoveUp", "上移", ICON_MOVEUP, null, ModMain.FrmSelectLeft.MoveUp_Click); - AddMenuItem("MoveDown", "下移", ICON_MOVEDOWN, null, ModMain.FrmSelectLeft.MoveDown_Click); - AddMenuItem("Open", Lang.Text("Common.Action.Open"), ICON_OPEN, null, ModMain.FrmSelectLeft.Open_Click); - AddMenuItem("Refresh", Lang.Text("Common.Action.Refresh"), ICON_REFRESH, null, ModMain.FrmSelectLeft.Refresh_Click); + AddMenuItem("Rename", Lang.Text("Select.Folder.Rename"), ICON_RENAME, null, + ModMain.FrmSelectLeft.Rename_Click); + AddMenuItem("MoveUp", Lang.Text("Select.Folder.MoveUp"), ICON_MOVEUP, null, + ModMain.FrmSelectLeft.MoveUp_Click); + AddMenuItem("MoveDown", Lang.Text("Select.Folder.MoveDown"), ICON_MOVEDOWN, null, + ModMain.FrmSelectLeft.MoveDown_Click); + AddMenuItem("Open", Lang.Text("Common.Action.Open"), ICON_OPEN, null, + ModMain.FrmSelectLeft.Open_Click); + AddMenuItem("Refresh", Lang.Text("Common.Action.Refresh"), ICON_REFRESH, null, + ModMain.FrmSelectLeft.Refresh_Click); AddMenuItem("Delete", Lang.Text("Common.Action.Delete"), ICON_DELETE, new Thickness(0, 0, 0, 2), ModMain.FrmSelectLeft.Delete_Click); break; case ModMinecraft.McFolder.Types.Custom: - AddMenuItem("Rename", "重命名", ICON_RENAME, new Thickness(0, 2, 0, 0), + AddMenuItem("Rename", Lang.Text("Select.Folder.Rename"), ICON_RENAME, new Thickness(0, 2, 0, 0), ModMain.FrmSelectLeft.Rename_Click); - AddMenuItem("MoveUp", "上移", ICON_MOVEUP, null, ModMain.FrmSelectLeft.MoveUp_Click); - AddMenuItem("MoveDown", "下移", ICON_MOVEDOWN, null, ModMain.FrmSelectLeft.MoveDown_Click); - AddMenuItem("Open", Lang.Text("Common.Action.Open"), ICON_OPEN, null, ModMain.FrmSelectLeft.Open_Click); - AddMenuItem("Refresh", Lang.Text("Common.Action.Refresh"), ICON_REFRESH, null, ModMain.FrmSelectLeft.Refresh_Click); - AddMenuItem("Remove", "移出列表", + AddMenuItem("MoveUp", Lang.Text("Select.Folder.MoveUp"), ICON_MOVEUP, null, + ModMain.FrmSelectLeft.MoveUp_Click); + AddMenuItem("MoveDown", Lang.Text("Select.Folder.MoveDown"), ICON_MOVEDOWN, null, + ModMain.FrmSelectLeft.MoveDown_Click); + AddMenuItem("Open", Lang.Text("Common.Action.Open"), ICON_OPEN, null, + ModMain.FrmSelectLeft.Open_Click); + AddMenuItem("Refresh", Lang.Text("Common.Action.Refresh"), ICON_REFRESH, null, + ModMain.FrmSelectLeft.Refresh_Click); + AddMenuItem("Remove", Lang.Text("Select.Folder.RemoveFromList"), "F1 M 23.3428,25.205L 23.3805,25.4461C 23.9229,27.177 30.261,29.0992 38,29.0992C 45.7386,29.0992 52.0765,27.1771 52.6194,25.4463L 52.6571,25.205C 52.6571,23.3616 46.0949,21.3109 38,21.3109C 29.9051,21.3109 23.3428,23.3616 23.3428,25.205 Z M 23.3428,53.0204L 19.1571,26.2111C 19.0534,25.8817 19,25.5459 19,25.205C 19,20.9036 27.5066,17.4167 38,17.4167C 48.4934,17.4167 57,20.9036 57,25.205C 57,25.5459 56.9466,25.8818 56.8429,26.2112L 52.6571,53.0204L 52.5974,53.0204C 51.9241,56.1393 45.6457,58.5833 38,58.5833C 30.3543,58.5833 24.076,56.1393 23.4026,53.0204L 23.3428,53.0204 Z M 51.8228,30.5485C 48.3585,32.0537 43.4469,32.9933 38,32.9933C 32.5531,32.9933 27.6415,32.0537 24.1771,30.5484L 27.5988,52.464L 27.6857,52.464C 27.6857,53.3857 32.3036,54.6892 38,54.6892C 43.6964,54.6892 48.3143,53.3857 48.3143,52.464L 48.4011,52.464L 51.8228,30.5485 Z ", null, ModMain.FrmSelectLeft.Remove_Click); AddMenuItem("Delete", Lang.Text("Common.Action.Delete"), ICON_DELETE, new Thickness(0, 0, 0, 2), @@ -190,7 +204,7 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd contMenu.PlacementTarget = newItem; contMenu.IsOpen = true; }; - newItem.Buttons = new[] { newIconButton }; + newItem.Buttons = [newIconButton]; ModMain.FrmSelectLeft.PanList.Children.Add(newItem); @@ -200,7 +214,7 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd // 标题文本 ModMain.FrmSelectLeft.PanList.Children.Add(new TextBlock { - Text = "添加或导入", + Text = Lang.Text("Select.Folder.AddOrImport"), Margin = new Thickness(13, 18, 5, 4), Opacity = 0.6, FontSize = 12 @@ -213,9 +227,9 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd { IsScaleAnimationEnabled = false, Type = MyListItem.CheckType.Clickable, - Title = "新建 .minecraft 文件夹", + Title = Lang.Text("Select.Folder.CreateNew.Title"), Height = 34, - ToolTip = "在 PCL 当前所在文件夹下创建新的 .minecraft 文件夹", + ToolTip = Lang.Text("Select.Folder.CreateNew.ToolTip"), LogoScale = 0.9, Logo = Icon.IconButtonCreate }; @@ -231,9 +245,9 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd { IsScaleAnimationEnabled = false, Type = MyListItem.CheckType.Clickable, - Title = "添加已有文件夹", + Title = Lang.Text("Select.Folder.AddExisting.Title"), Height = 34, - ToolTip = "将一个已有的 Minecraft 文件夹添加到列表", + ToolTip = Lang.Text("Select.Folder.AddExisting.ToolTip"), Logo = Icon.IconButtonAdd }; ToolTipService.SetPlacement(itemAdd, PlacementMode.Right); @@ -247,9 +261,9 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd { IsScaleAnimationEnabled = false, Type = MyListItem.CheckType.Clickable, - Title = "导入整合包", + Title = Lang.Text("Select.Folder.ImportModpack.Title"), Height = 34, - ToolTip = "在当前选择的 Minecraft 文件夹下安装整合包", + ToolTip = Lang.Text("Select.Folder.ImportModpack.ToolTip"), Logo = "F1 m 11.293 11.293 l -3 3 a 1 1 0 0 0 0 1.41406 a 1 1 0 0 0 1.41406 0 L 12 13.4141 l 2.29297 2.29297 a 1 1 0 0 0 1.41406 0 a 1 1 0 0 0 0 -1.41406 l -3 -3 a 1.0001 1.0001 0 0 0 -1.41406 0 z M 12 11 a 1 1 0 0 0 -1 1 v 6 a 1 1 0 0 0 1 1 a 1 1 0 0 0 1 -1 V 12 A 1 1 0 0 0 12 11 Z M 14 1 a 1 1 0 0 0 -1 1 v 5 c 0 1.09272 0.907275 2 2 2 h 5 A 1 1 0 0 0 21 8 A 1 1 0 0 0 20 7 H 15 V 2 A 1 1 0 0 0 14 1 Z M 6 1 C 4.35499 1 3 2.35499 3 4 v 16 c 0 1.64501 1.35499 3 3 3 h 12 c 1.64501 0 3 -1.35499 3 -3 V 8.00195 V 8 C 21.001 7.09394 20.6387 6.22279 19.9961 5.58398 L 16.4121 2 L 16.4101 1.99805 C 15.7718 1.35838 14.9038 0.999054 14 1 Z m 0 2 h 8 a 1.0001 1.0001 0 0 0 0.002 0 c 0.373356 -0.0006051 0.730614 0.147632 0.994141 0.412109 a 1.0001 1.0001 0 0 0 0 0.00195 l 3.58789 3.58789 a 1.0001 1.0001 0 0 0 0.0039 0.00195 C 18.8531 7.26753 19.0006 7.62412 19 7.99805 A 1.0001 1.0001 0 0 0 19 8 v 12 c 0 0.564129 -0.435871 1 -1 1 H 6 C 5.43587 21 5 20.5641 5 20 V 4 C 5 3.43587 5.43587 3 6 3 Z" }; @@ -270,7 +284,7 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd return; } - if (!ModMinecraft.McFolderList.Any()) + if (ModMinecraft.McFolderList.Count == 0) throw new ArgumentNullException("没有可用的 Minecraft 文件夹"); States.Game.SelectedFolder = ModMinecraft.McFolderList[0].Location.Replace(ModBase.ExePath, "$"); ((MyListItem)ModMain.FrmSelectLeft.PanList.Children[1]).Checked = true; @@ -292,48 +306,47 @@ void AddMenuItem(string name, string header, string icon = null, Thickness? padd private void MoveUp_Click(object sender, RoutedEventArgs e) { var folder = - (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent).PlacementTarget) + (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent) + .PlacementTarget) .Tag; var index = ModMinecraft.McFolderList.IndexOf(folder); - if (index > 0) - { - ModMinecraft.McFolderList.RemoveAt(index); - ModMinecraft.McFolderList.Insert(index - 1, folder); - UpdateFolderOrder(); - } + if (index <= 0) return; + ModMinecraft.McFolderList.RemoveAt(index); + ModMinecraft.McFolderList.Insert(index - 1, folder); + UpdateFolderOrder(); } private void MoveDown_Click(object sender, RoutedEventArgs e) { var folder = - (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent).PlacementTarget) + (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent) + .PlacementTarget) .Tag; var index = ModMinecraft.McFolderList.IndexOf(folder); - if (index < ModMinecraft.McFolderList.Count - 1) - { - ModMinecraft.McFolderList.RemoveAt(index); - ModMinecraft.McFolderList.Insert(index + 1, folder); - UpdateFolderOrder(); - } + if (index >= ModMinecraft.McFolderList.Count - 1) return; + ModMinecraft.McFolderList.RemoveAt(index); + ModMinecraft.McFolderList.Insert(index + 1, folder); + UpdateFolderOrder(); } private void UpdateFolderOrder() { - var folders = new List(); - foreach (var folder in ModMinecraft.McFolderList) - folders.Add($"{folder.Name}>{folder.Location}"); - States.Game.Folders = folders.ToArray().Join("|"); + States.Game.Folders = ModMinecraft.McFolderList + .Select(folder => $"{folder.Name}>{folder.Location}") + .ToArray() + .Join("|"); McFolderListUI(); } private void Restore_Click(object sender, RoutedEventArgs e) { var folder = - (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyListItem)sender).Parent).Parent).PlacementTarget) + (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyListItem)sender).Parent).Parent) + .PlacementTarget) .Tag; var index = ModMinecraft.McFolderList.IndexOf(folder); ModMinecraft.McFolderList[index].Type = ModMinecraft.McFolder.Types.Original; - ModMinecraft.McFolderList[index].Name = "官方启动器文件夹"; + ModMinecraft.McFolderList[index].Name = Lang.Text("Select.Folder.OfficialLauncherFolder"); UpdateFolderOrder(); } @@ -344,7 +357,7 @@ private void Add_Click() // 检查是否有下载任务 if (ModNet.HasDownloadingTask()) { - ModMain.Hint("在下载任务进行时,无法添加游戏文件夹!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Select.Folder.CannotAddWhileDownloading"), ModMain.HintType.Critical); return; } @@ -354,24 +367,22 @@ private void Add_Click() NewFolder = SystemDialogs.SelectFolder(); if (string.IsNullOrEmpty(NewFolder)) return; - if (NewFolder.Contains("!") || NewFolder.Contains(";")) + if (NewFolder.Contains('!') || NewFolder.Contains(';')) { - ModMain.Hint("Minecraft 文件夹路径中不能含有感叹号或分号!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Select.Folder.InvalidPathChars"), ModMain.HintType.Critical); return; } // 要求输入显示名称 var SplitedNames = NewFolder.TrimEnd('\\').Split(@"\"); var DefaultName = SplitedNames.Last() == ".minecraft" - ? SplitedNames.Count() >= 3 ? SplitedNames[SplitedNames.Count() - 2] : "" + ? SplitedNames.Length >= 3 ? SplitedNames[^2] : "" : SplitedNames.Last(); if (DefaultName.Length > 40) - DefaultName = DefaultName.Substring(0, 39); - var NewName = ModMain.MyMsgBoxInput("输入显示名称", "输入该文件夹在左边栏列表中显示的名称。", DefaultName, - new Collection> - { - new NullOrWhiteSpaceValidator(), new StringLengthValidator(), new BlacklistValidator([">", "|"]) - }); + DefaultName = DefaultName[..39]; + var NewName = ModMain.MyMsgBoxInput(Lang.Text("Select.Folder.InputDisplayName.Title"), + Lang.Text("Select.Folder.InputDisplayName.Message"), DefaultName, + [new NullOrWhiteSpaceValidator(), new StringLengthValidator(), new BlacklistValidator([">", "|"])]); if (string.IsNullOrWhiteSpace(NewName)) return; // 添加文件夹 @@ -408,13 +419,9 @@ public static void AddFolder(string FolderPath, string DisplayName, bool ShowHin if (!FolderPath.EndsWith(@"\")) FolderPath += @"\"; if (!ModBase.CheckPermission(FolderPath)) { - if (ShowHint) - { - ModMain.Hint("添加文件夹失败:PCL 没有访问该文件夹的权限!", ModMain.HintType.Critical); - return; - } - - throw new Exception("PCL 没有访问文件夹的权限:" + FolderPath); + if (!ShowHint) throw new Exception("PCL 没有访问文件夹的权限:" + FolderPath); + ModMain.Hint(Lang.Text("Select.Folder.AccessDenied"), ModMain.HintType.Critical); + return; } if (!ModBase.CheckPermission(FolderPath + @"versions\")) @@ -425,27 +432,26 @@ public static void AddFolder(string FolderPath, string DisplayName, bool ShowHin break; } - var Folders = new List(States.Game.Folders.ToString().Split("|")); + var Folders = new List(States.Game.Folders.Split("|")); var IsAdded = false; var IsReplace = false; for (int i = 0, loopTo = Folders.Count - 1; i <= loopTo; i++) { var Folder = Folders[i]; if (string.IsNullOrEmpty(Folder)) continue; - if ((Folder.Split(">")[1] ?? "") == (FolderPath ?? "")) + if (Folder.Split(">")[1] != (FolderPath ?? "")) continue; + IsAdded = true; + if (Folder.Split(">")[0] == DisplayName) { - IsAdded = true; - if ((Folder.Split(">")[0] ?? "") == (DisplayName ?? "")) - { - if (ShowHint) ModMain.Hint("此文件夹已在列表中!"); - return; - } - - Folders[i] = $"{DisplayName}>{FolderPath}"; - IsReplace = true; - if (ShowHint) ModMain.Hint($"文件夹名称已更新为 {DisplayName} !", ModMain.HintType.Finish); - break; + if (ShowHint) ModMain.Hint(Lang.Text("Select.Folder.AlreadyInList")); + return; } + + Folders[i] = $"{DisplayName}>{FolderPath}"; + IsReplace = true; + if (ShowHint) + ModMain.Hint(Lang.Text("Select.Folder.NameUpdated", DisplayName), ModMain.HintType.Finish); + break; } if (!IsAdded) Folders.Add($"{DisplayName}>{FolderPath}"); @@ -453,7 +459,7 @@ public static void AddFolder(string FolderPath, string DisplayName, bool ShowHin States.Game.SelectedFolder = FolderPath.Replace(ModBase.ExePath, "$"); ModMinecraft.McFolderListLoader.Start(IsForceRestart: true); if (IsReplace) return; - if (ShowHint) ModMain.Hint($"文件夹 {DisplayName} 已添加!", ModMain.HintType.Finish); + if (ShowHint) ModMain.Hint(Lang.Text("Select.Folder.Added", DisplayName), ModMain.HintType.Finish); var ModFolder = new DirectoryInfo(FolderPath + @"mods\"); if (!(ModFolder.Exists && ModFolder.EnumerateFiles().Count() >= 3)) return; var VersionFolder = new DirectoryInfo(FolderPath + @"versions\"); @@ -483,7 +489,7 @@ public void Create_Click() // 检查是否有下载任务 if (ModNet.HasDownloadingTask()) { - ModMain.Hint("在下载任务进行时,无法创建游戏文件夹!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Select.Folder.CannotCreateWhileDownloading"), ModMain.HintType.Critical); return; } @@ -493,7 +499,7 @@ public void Create_Click() Directory.CreateDirectory(ModBase.ExePath + @".minecraft\versions\"); States.Game.SelectedFolder = @"$.minecraft\"; ModMinecraft.McFolderLauncherProfilesJsonCreate(ModBase.ExePath + @".minecraft\"); - ModMain.Hint("新建 .minecraft 文件夹成功!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Select.Folder.CreateSuccess"), ModMain.HintType.Finish); } ModMinecraft.McFolderListLoader.Start(IsForceRestart: true); @@ -508,11 +514,9 @@ public void Remove_Click(object sender, RoutedEventArgs e) (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent) .PlacementTarget).Tag; switch (ModMain.MyMsgBox( - """ - 是否需要清理 PCL 在该文件夹中的配置文件? - 这包括各个实例的独立设置(如自定义图标、第三方登录配置)等,对游戏本身没有影响。 - """, - "配置文件清理", Lang.Text("Common.Action.Delete"), "保留", Lang.Text("Common.Action.Cancel"))) + Lang.Text("Select.Folder.Cleanup.Message"), + Lang.Text("Select.Folder.Cleanup.Title"), Lang.Text("Common.Action.Delete"), + Lang.Text("Select.Folder.Cleanup.Keep"), Lang.Text("Common.Action.Cancel"))) { case 1: { @@ -541,23 +545,24 @@ 是否需要清理 PCL 在该文件夹中的配置文件? // 若修改了本部分代码,应对应修改 Delete_Click 中的代码 // 获取并删除列表项 - var Folders = new List(States.Game.Folders.ToString().Split("|")); + var Folders = new List(States.Game.Folders.Split("|")); var Name = ""; for (int i = 0, loopTo = Folders.Count - 1; i <= loopTo; i++) { if (string.IsNullOrEmpty(Folders[i])) break; - if (Folders[i].EndsWith(Folder.Location)) - { - Name = Folders[i].BeforeFirst(">"); - Folders.RemoveAt(i); - break; - } + if (!Folders[i].EndsWith(Folder.Location)) continue; + Name = Folders[i].BeforeFirst(">"); + Folders.RemoveAt(i); + break; } // 保存 - States.Game.Folders = !Folders.Any() ? "" : Folders.ToArray().Join("|"); - ModMain.Hint(Folder.Type == ModMinecraft.McFolder.Types.Custom ? $"文件夹 {Name} 已从列表中移除!" : "文件夹名称已复原!", + States.Game.Folders = Folders.Count == 0 ? "" : Folders.ToArray().Join("|"); + ModMain.Hint( + Folder.Type == ModMinecraft.McFolder.Types.Custom + ? Lang.Text("Select.Folder.RemoveSuccess", Name) + : Lang.Text("Select.Folder.RestoreSuccess"), ModMain.HintType.Finish); ModMinecraft.McFolderListLoader.Start(IsForceRestart: true); } @@ -570,57 +575,59 @@ 是否需要清理 PCL 在该文件夹中的配置文件? public void Delete_Click(object sender, RoutedEventArgs e) { - var Folder = - (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent).PlacementTarget) - .Tag; - var DeleteText = - (Folder.Type == ModMinecraft.McFolder.Types.Original || - Folder.Type == ModMinecraft.McFolder.Types.RenamedOriginal) && - (Folder.Location ?? "") == (ModBase.ExePath + @".minecraft\" ?? "") && ModMinecraft.McFolderList.Count == 1 - ? "清空" - : Lang.Text("Common.Action.Delete"); - if (ModMain.MyMsgBox( - $""" - 你确定要{DeleteText}这个文件夹吗? - 目标文件夹:{Folder.Location} - - 这会导致该文件夹中的所有存档与其他文件永久丢失,且不可恢复! - """, "删除警告", Lang.Text("Common.Action.Cancel"), Lang.Text("Common.Action.Confirm"), Lang.Text("Common.Action.Cancel")) != 2) + var menuItem = (MyMenuItem)sender; + var contextMenu = (ContextMenu)menuItem.Parent; + var popup = (Popup)contextMenu.Parent; + var listItem = (MyListItem)popup.PlacementTarget; + var folder = (ModMinecraft.McFolder)listItem.Tag; + + var isClearing = + folder.Type is ModMinecraft.McFolder.Types.Original or ModMinecraft.McFolder.Types.RenamedOriginal + && folder.Location == ModBase.ExePath + @".minecraft\" + && ModMinecraft.McFolderList.Count == 1; + + var deleteText = Lang.Text(isClearing ? "Select.Folder.Clear" : "Common.Action.Delete"); + var firstWarning = + Lang.Text(isClearing ? "Select.Folder.Clear.FirstWarning" : "Select.Folder.Delete.FirstWarning", + folder.Location); + var finalWarning = + Lang.Text(isClearing ? "Select.Folder.Clear.FinalWarning" : "Select.Folder.Delete.FinalWarning", + folder.Location); + var confirmTitle = Lang.Text(isClearing ? "Select.Folder.Clear.Confirm" : "Select.Folder.Delete.Confirm"); + var inProgress = Lang.Text(isClearing ? "Select.Folder.Clear.InProgress" : "Select.Folder.Delete.InProgress", + folder.Name); + var success = Lang.Text(isClearing ? "Select.Folder.Clear.Success" : "Select.Folder.Delete.Success", + folder.Name); + + if (ModMain.MyMsgBox(firstWarning, Lang.Text("Select.Folder.Delete.WarningTitle"), + Lang.Text("Common.Action.Cancel"), Lang.Text("Common.Action.Confirm"), + Lang.Text("Common.Action.Cancel")) != 2) return; - if (ModMain.MyMsgBox( - $""" - 如果你在该文件夹中存放了除 MC 以外的其他文件,这些文件也会被一同删除! - 继续删除会导致该文件夹中的所有文件永久丢失,请在仔细确认后再继续! - 目标文件夹:{Folder.Location} - - 这是最后一次警告! - """, - "删除警告", $"确认{DeleteText}", Lang.Text("Common.Action.Cancel"), IsWarn: true) != 1) + + if (ModMain.MyMsgBox(finalWarning, Lang.Text("Select.Folder.Delete.WarningTitle"), + confirmTitle, Lang.Text("Common.Action.Cancel"), + IsWarn: true) != 1) return; - // 移出列表 - var Folders = new List(States.Game.Folders.ToString().Split("|")); - for (var i = Folders.Count - 1; i >= 0; i -= 1) - if (!string.IsNullOrEmpty(Folders[i]) && Folders[i].EndsWith(Folder.Location)) - { - Folders.RemoveAt(i); - break; - } - States.Game.Folders = !Folders.Any() ? "" : Folders.ToArray().Join("|"); - // 删除文件夹 - // 刷新列表 + var folders = States.Game.Folders.Split('|', StringSplitOptions.RemoveEmptyEntries).ToList(); + var index = folders.FindIndex(f => f.EndsWith(folder.Location)); + if (index >= 0) + folders.RemoveAt(index); + States.Game.Folders = string.Join("|", folders); + ModBase.RunInNewThread(() => { try { - ModMain.Hint($"正在{DeleteText}文件夹 {Folder.Name}!"); - ModBase.DeleteDirectory(Folder.Location); - if (DeleteText == "清空") Directory.CreateDirectory(Folder.Location); - ModMain.Hint($"已{DeleteText}文件夹 {Folder.Name}!", ModMain.HintType.Finish); + ModMain.Hint(inProgress); + ModBase.DeleteDirectory(folder.Location); + if (isClearing) + Directory.CreateDirectory(folder.Location); + ModMain.Hint(success, ModMain.HintType.Finish); } catch (Exception ex) { - ModBase.Log(ex, $"{DeleteText}文件夹 {Folder.Name} 失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, $"{deleteText}文件夹 {folder.Name} 失败", ModBase.LogLevel.Hint); } finally { @@ -650,7 +657,7 @@ public void RefreshCurrent() public static void RefreshCurrent(string Folder) { ModBase.WriteIni(Path.Combine(Folder, "PCL.ini"), "InstanceCache", ""); - if ((Folder ?? "") == (ModMinecraft.McFolderSelected ?? "")) + if (Folder == ModMinecraft.McFolderSelected) ModLoader.LoaderFolderRun(ModMinecraft.McInstanceListLoader, ModMinecraft.McFolderSelected, ModLoader.LoaderFolderRunType.ForceRun, 1, @"versions\"); } @@ -658,42 +665,41 @@ public static void RefreshCurrent(string Folder) public void Rename_Click(object sender, RoutedEventArgs e) { var Folder = - (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent).PlacementTarget) + (ModMinecraft.McFolder)((MyListItem)((Popup)((ContextMenu)((MyMenuItem)sender).Parent).Parent) + .PlacementTarget) .Tag; try { // 获取输入 - var NewName = ModMain.MyMsgBoxInput("输入新名称", "", Folder.Name, - new Collection> - { - new NullOrWhiteSpaceValidator(), new StringLengthValidator(1, 30), new BlacklistValidator([">", "|"]) - }); + var NewName = ModMain.MyMsgBoxInput(Lang.Text("Select.Folder.Rename.Title"), "", Folder.Name, + [ + new NullOrWhiteSpaceValidator(), new StringLengthValidator(1, 30), + new BlacklistValidator([">", "|"]) + ]); if (string.IsNullOrWhiteSpace(NewName)) return; // 修改自定义名 - var Folders = new List(States.Game.Folders.ToString().Split("|")); + var Folders = new List(States.Game.Folders.Split("|")); var IsAdded = false; for (int i = 0, loopTo = Folders.Count - 1; i <= loopTo; i++) { var FolderCurrent = Folders[i]; if (string.IsNullOrEmpty(FolderCurrent)) continue; - if ((FolderCurrent.Split(">")[1] ?? "") == (Folder.Location ?? "")) - { - IsAdded = true; - if ((FolderCurrent.Split(">")[0] ?? "") == (NewName ?? "")) - // 名称未修改 - return; + if (FolderCurrent.Split(">")[1] != (Folder.Location ?? "")) continue; + IsAdded = true; + if (FolderCurrent.Split(">")[0] == NewName) + // 名称未修改 + return; - Folders[i] = $"{NewName}>{Folder.Location}"; - break; - } + Folders[i] = $"{NewName}>{Folder.Location}"; + break; } // 如果没有添加过,则添加进去(因为修改了默认项的名称) if (!IsAdded) Folders.Add($"{NewName}>{Folder.Location}"); - ModMain.Hint($"文件夹名称已更新为 {NewName} !", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Select.Folder.NameUpdated", NewName), ModMain.HintType.Finish); // 保存 States.Game.Folders = Folders.ToArray().Join("|"); ModMinecraft.McFolderListLoader.Start(IsForceRestart: true); @@ -712,7 +718,7 @@ public void Folder_Change(MyListItem sender, ModBase.RouteEventArgs e) // 检查是否有下载任务 if (ModNet.HasDownloadingTask(true)) { - ModMain.Hint("在下载任务进行时,无法切换游戏文件夹!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Select.Folder.SwitchBlockedByDownload"), ModMain.HintType.Critical); e.Handled = true; return; } @@ -731,15 +737,15 @@ private void Item_MouseMove(object sender, MouseEventArgs e) { var Item = (MyListItem)sender; // 当按住鼠标左键时开始拖拽操作 - if (e.LeftButton == MouseButtonState.Pressed) - try - { - DragDrop.DoDragDrop(Item, Item.Tag, DragDropEffects.Move); - } - catch (Exception ex) - { - ModBase.Log(ex, "开始拖拽操作失败"); - } + if (e.LeftButton != MouseButtonState.Pressed) return; + try + { + DragDrop.DoDragDrop(Item, Item.Tag, DragDropEffects.Move); + } + catch (Exception ex) + { + ModBase.Log(ex, "开始拖拽操作失败"); + } } // 拖拽进入时的处理 @@ -759,7 +765,7 @@ private void Item_DragEnter(object sender, DragEventArgs e) e.Effects = DragDropEffects.None; } } - catch (Exception ex) + catch (Exception) { e.Effects = DragDropEffects.None; } @@ -772,12 +778,11 @@ private void Item_DragOver(object sender, DragEventArgs e) { try { - if (e.Data.GetDataPresent(typeof(ModMinecraft.McFolder))) - e.Effects = DragDropEffects.Move; - else - e.Effects = DragDropEffects.None; + e.Effects = e.Data.GetDataPresent(typeof(ModMinecraft.McFolder)) + ? DragDropEffects.Move + : DragDropEffects.None; } - catch (Exception ex) + catch (Exception) { e.Effects = DragDropEffects.None; } @@ -823,7 +828,7 @@ private void Item_Drop(object sender, DragEventArgs e) var SourceFolder = (ModMinecraft.McFolder)e.Data.GetData(typeof(ModMinecraft.McFolder)); // 检查是否为有效的拖拽操作 - if (SourceFolder is null || ReferenceEquals(SourceFolder, TargetFolder)) + if (ReferenceEquals(SourceFolder, TargetFolder)) { e.Handled = true; return; @@ -841,37 +846,33 @@ private void Item_Drop(object sender, DragEventArgs e) var TargetIndex = ModMinecraft.McFolderList.IndexOf(TargetFolder); // 执行移动操作 - if (SourceIndex != TargetIndex) - { - // 先移除源文件夹 - ModMinecraft.McFolderList.RemoveAt(SourceIndex); - - // 计算新的插入位置 - int NewTargetIndex; - - if (SourceIndex < TargetIndex) - // 向下拖拽:插入到目标项目的后面 - // 由于移除了源项目,目标索引已经自动减1,所以直接使用TargetIndex就是插入到目标后面 - NewTargetIndex = TargetIndex; - else - // 向上拖拽:插入到目标项目的前面 - NewTargetIndex = TargetIndex; - - // 确保插入位置不超出列表范围 - if (NewTargetIndex > ModMinecraft.McFolderList.Count) - NewTargetIndex = ModMinecraft.McFolderList.Count; - else if (NewTargetIndex < 0) NewTargetIndex = 0; - - // 插入到新位置 - ModMinecraft.McFolderList.Insert(NewTargetIndex, SourceFolder); - - // 更新文件夹顺序并刷新UI - UpdateFolderOrder(); - - var Direction = SourceIndex < TargetIndex ? "后面" : "前面"; - ModBase.Log( - $"[Control] 文件夹拖拽排序:{SourceFolder.Name} -> 位置 {NewTargetIndex} (在 {TargetFolder.Name} {Direction})", ModBase.LogLevel.Debug); - } + if (SourceIndex == TargetIndex) return; + // 先移除源文件夹 + ModMinecraft.McFolderList.RemoveAt(SourceIndex); + + // 计算新的插入位置 + int NewTargetIndex; + + // 向下拖拽:插入到目标项目的后面 + // 由于移除了源项目,目标索引已经自动减1,所以直接使用TargetIndex就是插入到目标后面 + // 向上拖拽:插入到目标项目的前面 + NewTargetIndex = TargetIndex; + + // 确保插入位置不超出列表范围 + if (NewTargetIndex > ModMinecraft.McFolderList.Count) + NewTargetIndex = ModMinecraft.McFolderList.Count; + else if (NewTargetIndex < 0) NewTargetIndex = 0; + + // 插入到新位置 + ModMinecraft.McFolderList.Insert(NewTargetIndex, SourceFolder); + + // 更新文件夹顺序并刷新UI + UpdateFolderOrder(); + + var Direction = SourceIndex < TargetIndex ? "后面" : "前面"; + ModBase.Log( + $"[Control] 文件夹拖拽排序:{SourceFolder.Name} -> 位置 {NewTargetIndex} (在 {TargetFolder.Name} {Direction})", + ModBase.LogLevel.Debug); } catch (Exception ex) @@ -885,4 +886,4 @@ private void Item_Drop(object sender, DragEventArgs e) } #endregion -} +} \ No newline at end of file diff --git a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml index 83361737c..05bd6520c 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml +++ b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml @@ -11,8 +11,8 @@ - + @@ -20,22 +20,25 @@ - + Text="{DynamicResource Select.Instance.Empty.Download}" Margin="0,10,0,0" + Padding="13,0" ColorType="Highlight" /> - @@ -45,7 +48,7 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs index c4f659615..03cbb4018 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs @@ -35,6 +35,8 @@ public partial class PageSelectRight public PageSelectRight() { InitializeComponent(); + Load.Text = Lang.Text("Select.Instance.Loading"); + PanVerSearchBox.HintText = Lang.Text("Select.Instance.Search.Hint"); Loaded += PageSelectRight_Loaded; Unloaded += PageSelectRight_Unloaded; LoaderInit(); @@ -166,7 +168,7 @@ private void McInstanceListUI(ModLoader.LoaderTask Loader) { case ModMinecraft.McInstanceCardType.OriginalLike: { - CardName = "常规实例"; + CardName = Lang.Text("Select.Instance.Card.Regular"); break; } case ModMinecraft.McInstanceCardType.API: @@ -201,47 +203,47 @@ private void McInstanceListUI(ModLoader.LoaderTask Loader) if ((IsLiteExists ? 1 : 0) + (IsForgeExists ? 1 : 0) + (IsFabricExists ? 1 : 0) + (IsNeoForgeExists ? 1 : 0) + (IsQuiltExists ? 1 : 0) + (IsCleanroomExists ? 1 : 0) + (IsLabyModExists ? 1 : 0) > 1) - CardName = "可安装 Mod"; + CardName = Lang.Text("Select.Instance.Card.Modable"); else if (IsForgeExists) - CardName = "Forge 实例"; + CardName = Lang.Text("Select.Instance.Card.Forge"); else if (IsNeoForgeExists) - CardName = "NeoForge 实例"; + CardName = Lang.Text("Select.Instance.Card.NeoForge"); else if (IsCleanroomExists) - CardName = "Cleanroom 实例"; + CardName = Lang.Text("Select.Instance.Card.Cleanroom"); else if (IsLabyModExists) - CardName = "LabyMod 实例"; + CardName = Lang.Text("Select.Instance.Card.LabyMod"); else if (IsLiteExists) - CardName = "LiteLoader 实例"; + CardName = Lang.Text("Select.Instance.Card.LiteLoader"); else if (IsQuiltExists) - CardName = "Quilt 实例"; + CardName = Lang.Text("Select.Instance.Card.Quilt"); else - CardName = "Fabric 实例"; + CardName = Lang.Text("Select.Instance.Card.Fabric"); break; } case ModMinecraft.McInstanceCardType.Error: { - CardName = "错误的实例"; + CardName = Lang.Text("Select.Instance.Card.Error"); break; } case ModMinecraft.McInstanceCardType.Hidden: { - CardName = "隐藏的实例"; + CardName = Lang.Text("Select.Instance.Card.Hidden"); break; } case ModMinecraft.McInstanceCardType.Rubbish: { - CardName = "不常用实例"; + CardName = Lang.Text("Select.Instance.Card.LessUsed"); break; } case ModMinecraft.McInstanceCardType.Star: { - CardName = "收藏夹"; + CardName = Lang.Text("Select.Instance.Card.Favorites"); break; } case ModMinecraft.McInstanceCardType.Fool: { - CardName = "愚人节版本"; + CardName = Lang.Text("Select.Instance.Card.AprilFools"); break; } @@ -254,7 +256,7 @@ private void McInstanceListUI(ModLoader.LoaderTask Loader) #endregion // 建立控件 - var CardTitle = $"{CardName}{(CardName == "收藏夹" ? "" : $" ({Lang.Number(filteredInstances.Count, "N0")})")}"; + var CardTitle = $"{CardName}{(Card.Key == ModMinecraft.McInstanceCardType.Star ? "" : $" ({Lang.Number(filteredInstances.Count, "N0")})")}"; var NewCard = new MyCard { Title = CardTitle, Margin = new Thickness(0d, 0d, 0d, 15d) }; var NewStack = new StackPanel { @@ -303,20 +305,14 @@ void PutMethod(StackPanel Stack) PanBack.Visibility = Visibility.Collapsed; if (ShowHidden) { - LabEmptyTitle.Text = "无隐藏实例"; - LabEmptyContent.Text = """ - 没有实例被隐藏,你可以在实例设置的实例分类选项中隐藏实例。 - 再次按下 F11 即可退出隐藏实例查看模式。 - """; + LabEmptyTitle.Text = Lang.Text("Select.Instance.Hidden.EmptyTitle"); + LabEmptyContent.Text = Lang.Text("Select.Instance.Hidden.EmptyMessage"); BtnEmptyDownload.Visibility = Visibility.Collapsed; } else { - LabEmptyTitle.Text = "无可用实例"; - LabEmptyContent.Text = """ - 未找到任何游戏实例,请先下载一个游戏实例。 - 若有已存在的实例,请在左边的列表中选择添加文件夹,选择 .minecraft 文件夹将其导入。 - """; + LabEmptyTitle.Text = Lang.Text("Select.Instance.Empty.Title"); + LabEmptyContent.Text = Lang.Text("Select.Instance.Empty.Message"); BtnEmptyDownload.Visibility = Config.Preference.Hide.PageDownload && !PageSetupUI.HiddenForceShow ? Visibility.Collapsed @@ -332,22 +328,18 @@ 再次按下 F11 即可退出隐藏实例查看模式。 PanEmpty.Visibility = Visibility.Collapsed; PanBack.Visibility = Visibility.Visible; PanEmptySearch.Visibility = Visibility.Visible; - LabEmptySearchTitle.Text = "无匹配的隐藏实例"; + LabEmptySearchTitle.Text = Lang.Text("Select.Instance.Hidden.EmptySearchTitle"); LabEmptySearchContent.Text = string.IsNullOrWhiteSpace(searchText) - ? "请输入搜索内容" - : $"没有找到与 '{searchText}' 匹配的隐藏实例"; + ? Lang.Text("Select.Instance.Search.EmptyInput") + : Lang.Text("Select.Instance.Search.NoHiddenResult", searchText); } else if (ShowHidden) { // 无隐藏实例 - 显示"无隐藏实例"提示 PanEmpty.Visibility = Visibility.Visible; PanBack.Visibility = Visibility.Collapsed; - LabEmptyTitle.Text = "无隐藏实例"; - LabEmptyContent.Text = - """ - 没有实例被隐藏,你可以在实例设置的实例分类选项中隐藏实例。 - 再次按下 F11 即可退出隐藏实例查看模式。 - """; + LabEmptyTitle.Text = Lang.Text("Select.Instance.Hidden.EmptyTitle"); + LabEmptyContent.Text = Lang.Text("Select.Instance.Hidden.EmptyMessage"); BtnEmptyDownload.Visibility = Visibility.Collapsed; PanVerSearchBox.Visibility = Visibility.Collapsed; } @@ -358,10 +350,10 @@ 再次按下 F11 即可退出隐藏实例查看模式。 PanEmpty.Visibility = Visibility.Collapsed; PanBack.Visibility = Visibility.Visible; PanEmptySearch.Visibility = Visibility.Visible; - LabEmptySearchTitle.Text = "无匹配的游戏实例"; + LabEmptySearchTitle.Text = Lang.Text("Select.Instance.EmptySearch.Title"); LabEmptySearchContent.Text = string.IsNullOrWhiteSpace(searchText) - ? "请输入搜索内容" - : $"没有找到与 '{searchText}' 匹配的实例"; + ? Lang.Text("Select.Instance.Search.EmptyInput") + : Lang.Text("Select.Instance.Search.NoResult", searchText); } } else @@ -431,7 +423,7 @@ private static void McVersionListContent(MyListItem sender, EventArgs e) var BtnStar = new MyIconButton(); if (Version.IsStar) { - BtnStar.ToolTip = "取消收藏"; + BtnStar.ToolTip = Lang.Text("Select.Instance.Unfavorite"); ToolTipService.SetPlacement(BtnStar, PlacementMode.Center); ToolTipService.SetVerticalOffset(BtnStar, 30d); ToolTipService.SetHorizontalOffset(BtnStar, 2d); @@ -440,7 +432,7 @@ private static void McVersionListContent(MyListItem sender, EventArgs e) } else { - BtnStar.ToolTip = "收藏"; + BtnStar.ToolTip = Lang.Text("Select.Instance.Favorite"); ToolTipService.SetPlacement(BtnStar, PlacementMode.Center); ToolTipService.SetVerticalOffset(BtnStar, 30d); ToolTipService.SetHorizontalOffset(BtnStar, 2d); @@ -456,7 +448,7 @@ private static void McVersionListContent(MyListItem sender, EventArgs e) ModLoader.LoaderFolderRunType.ForceRun, 1, @"versions\"); }; var BtnOpenFolder = new MyIconButton { LogoScale = 1.1d, Logo = Icon.IconButtonOpen }; - BtnOpenFolder.ToolTip = "打开实例目录"; + BtnOpenFolder.ToolTip = Lang.Text("Select.Instance.OpenFolder"); ToolTipService.SetPlacement(BtnOpenFolder, PlacementMode.Center); ToolTipService.SetVerticalOffset(BtnOpenFolder, 30d); ToolTipService.SetHorizontalOffset(BtnOpenFolder, 2d); @@ -470,7 +462,7 @@ private static void McVersionListContent(MyListItem sender, EventArgs e) if (Version.State != ModMinecraft.McInstanceState.Error) { var BtnCont = new MyIconButton { LogoScale = 1.1d, Logo = Icon.IconButtonSetup }; - BtnCont.ToolTip = "设置"; + BtnCont.ToolTip = Lang.Text("Select.Instance.Settings"); ToolTipService.SetPlacement(BtnCont, PlacementMode.Center); ToolTipService.SetVerticalOffset(BtnCont, 30d); ToolTipService.SetHorizontalOffset(BtnCont, 2d); @@ -534,12 +526,10 @@ public static void DeleteVersion(MyListItem item, ModMinecraft.McInstance instan var IsShiftPressed = Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift); var IsHintIndie = instance.State != ModMinecraft.McInstanceState.Error && (instance.PathIndie ?? "") != (ModMinecraft.McFolderSelected ?? ""); - switch (ModMain.MyMsgBox( - $""" - 你确定要{(IsShiftPressed ? "永久" : "")}删除实例 {instance.Name} 吗?{(IsHintIndie - ? "\r\n由于该实例开启了版本隔离,删除时该实例对应的存档、资源包、Mod 等文件也将被一并删除!" - : "")} - """, "实例删除确认", Button2: Lang.Text("Common.Action.Cancel"), IsWarn: true)) + var permanentText = IsShiftPressed ? Lang.Text("Select.Instance.Delete.Permanent") : ""; + var confirmMsg = Lang.Text("Select.Instance.Delete.ConfirmMessage", permanentText, instance.Name); + var confirmFullMsg = confirmMsg + (IsHintIndie ? "\r\n" + Lang.Text("Select.Instance.Delete.IsolatedWarning") : ""); + switch (ModMain.MyMsgBox(confirmFullMsg, Lang.Text("Select.Instance.Delete.ConfirmTitle"), Button2: Lang.Text("Common.Action.Cancel"), IsWarn: true)) { case 1: { @@ -549,13 +539,13 @@ public static void DeleteVersion(MyListItem item, ModMinecraft.McInstance instan if (IsShiftPressed) { ModBase.DeleteDirectory(instance.PathInstance); - ModMain.Hint($"实例 {instance.Name} 已永久删除!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Select.Instance.Delete.PermanentSuccess", instance.Name), ModMain.HintType.Finish); } else { FileSystem.DeleteDirectory(instance.PathInstance, UIOption.AllDialogs, RecycleOption.SendToRecycleBin); - ModMain.Hint($"实例 {instance.Name} 已删除到回收站!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Select.Instance.Delete.RecycleBinSuccess", instance.Name), ModMain.HintType.Finish); } break; From 71fd2083f8e30f20e95ba541683301f10a46873c Mon Sep 17 00:00:00 2001 From: ClovenBugle Date: Fri, 22 May 2026 04:32:36 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E3=80=81=E5=90=AF=E5=8A=A8=E7=8A=B6=E6=80=81=EF=BC=9A=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E9=98=B6=E6=AE=B5=E5=90=8D=E3=80=81=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E3=80=81=E5=8F=96=E6=B6=88=E3=80=81=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E8=84=9A=E6=9C=AC=E3=80=81=E5=90=AF=E5=8A=A8=E5=89=8D?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E3=80=81=E8=B4=AD=E4=B9=B0=E6=AD=A3=E7=89=88?= =?UTF-8?q?=E3=80=81=E8=AF=95=E7=8E=A9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 63 +++++++++++++ .../App/Localization/Languages/zh-CN.xaml | 63 +++++++++++++ .../Modules/Minecraft/ModLaunch.cs | 92 +++++++++---------- .../Pages/PageLaunch/PageLaunchLeft.xaml.cs | 8 +- 4 files changed, 177 insertions(+), 49 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index 6799dced4..7031d42aa 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -1097,4 +1097,67 @@ Old version April Fools' {0} An unknown error has occurred. Please report this issue to the author. + + + Getting Java + Logging in + Completing files + Getting launch arguments + Extracting natives + Pre-launch processing + Running custom command + Starting process + Waiting for game window + Finishing up + Launching Minecraft + + + {0} launched successfully! + Launch cancelled! + Export script cancelled! + Launch script exported successfully! + + + Launch Failed + Export Script Failed + + + Invalid state change: {0} + A game is already launching! + Cannot launch Minecraft: {0} + No Java available, launch cancelled! + + + Game path cannot contain ! or ; ({0}) + Game Path Check + The path of instance "{0}" contains characters that may affect the game (non-ASCII characters). Do you still want to launch? If you are unsure, you can choose "Continue" first, and try modifying the game path if the game crashes shortly after launch. + Continue + Go Back + No Minecraft instance selected! + Minecraft problem: {0} + Please select a profile before launching! + This instance requires Microsoft login. Please use a Microsoft login profile! + This instance requires third-party login. Please use a third-party login profile! + The third-party login server used by this profile does not match the instance requirement. Please use a matching profile! + This instance requires Microsoft or third-party login. Please use a matching profile! + + + It looks like you haven't purchased the game... If you think Minecraft is good, consider purchasing it to support the developers... Don't keep freeloading. This prompt will no longer appear after you verify a genuine account! + Purchase the Game? + Purchase! + Nah, maybe next time + + + You must log in with a Microsoft account to launch the game! + Microsoft Login + Purchase + Demo + Back + The game will launch in demo mode! + + + PCL has launched {0} games for you! If PCL has been useful, maybe consider supporting the original PCL author... Without everyone's support, it's hard for PCL to maintain updates for years while staying free and ad-free! + {0} launches! + Support! + I refuse \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index 5b1b57430..77106da6b 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -1092,4 +1092,67 @@ 远古版本 愚人节版本 {0} 发生了未知错误,请向作者反馈此问题 + + + 获取 Java + 登录 + 补全文件 + 获取启动参数 + 解压文件 + 预启动处理 + 执行自定义命令 + 启动进程 + 等待游戏窗口出现 + 结束处理 + Minecraft 启动 + + + {0} 启动成功! + 已取消启动! + 已取消导出启动脚本! + 导出启动脚本成功! + + + 启动失败 + 导出启动脚本失败 + + + 错误的状态改变:{0} + 已有游戏正在启动中! + 无法启动 Minecraft:{0} + 没有可用的 Java,已取消启动! + + + 游戏路径中不可包含 ! 或 ;({0}) + 游戏路径检查 + 欲启动实例 "{0}" 的路径中存在可能影响游戏正常运行的字符(非 ASCII 字符),是否仍旧启动游戏? 如果不清楚具体作用,你可以先选择 "继续",发现游戏在启动后很快出现崩溃的情况后再尝试修改游戏路径等操作 + 继续 + 返回处理 + 未选择 Minecraft 实例! + Minecraft 存在问题:{0} + 请先选择一个档案再启动游戏! + 当前实例要求使用正版验证,请使用正版验证档案启动游戏! + 当前实例要求使用第三方验证,请使用第三方验证档案启动游戏! + 当前档案使用的第三方验证服务器与实例要求使用的不一致,请使用符合要求的档案启动游戏! + 当前实例要求使用正版验证或第三方验证,请使用符合要求的档案启动游戏! + + + 看起来你似乎没买正版... 如果觉得 Minecraft 还不错,可以购买正版支持一下,毕竟开发游戏也真的很不容易...不要一直白嫖啦。 在验证一个正版账号之后,就不会出现这个提示了! + 考虑一下正版? + 支持正版游戏! + 下次一定 + + + 你必须先登录正版账号才能启动游戏! + 正版验证 + 购买正版 + 试玩 + 返回 + 游戏将以试玩模式启动! + + + PCL 已经为你启动了 {0} 次游戏啦! 如果 PCL 还算好用的话,也许可以考虑赞助一下 PCL 原作者…… 如果没有大家的支持,PCL 很难在免费、无任何广告的情况下维持数年的更新(磕头)……! + {0} 次启动! + 支持一下! + 但是我拒绝 \ No newline at end of file diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs index 3b6bec2b6..380cac108 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs @@ -38,63 +38,63 @@ private static void McLaunchPrecheck() // 检查路径 if (ModMinecraft.McInstanceSelected.PathIndie.Contains("!") || ModMinecraft.McInstanceSelected.PathIndie.Contains(";")) - throw new Exception("游戏路径中不可包含 ! 或 ;(" + ModMinecraft.McInstanceSelected.PathIndie + ")"); + throw new Exception(Lang.Text("Minecraft.Launch.Precheck.InvalidPathChars", ModMinecraft.McInstanceSelected.PathIndie)); if (ModMinecraft.McInstanceSelected.PathInstance.Contains("!") || ModMinecraft.McInstanceSelected.PathInstance.Contains(";")) - throw new Exception("游戏路径中不可包含 ! 或 ;(" + ModMinecraft.McInstanceSelected.PathInstance + ")"); + throw new Exception(Lang.Text("Minecraft.Launch.Precheck.InvalidPathChars", ModMinecraft.McInstanceSelected.PathInstance)); if (Conversions.ToBoolean(ModBase.IsUtf8CodePage() && !(bool)States.Hint.NonAsciiGamePath && !ModMinecraft.McInstanceSelected.PathInstance.IsASCII())) { var userChoice = ModMain.MyMsgBox( - $"欲启动实例 \"{ModMinecraft.McInstanceSelected.Name}\" 的路径中存在可能影响游戏正常运行的字符(非 ASCII 字符),是否仍旧启动游戏?{"\r\n"}{"\r\n"}如果不清楚具体作用,你可以先选择 \"继续\",发现游戏在启动后很快出现崩溃的情况后再尝试修改游戏路径等操作", - "游戏路径检查", "继续", "返回处理", Lang.Text("Common.Hint.DoNotShowAgain")); + Lang.Text("Minecraft.Launch.Precheck.NonAsciiPath.Message", ModMinecraft.McInstanceSelected.Name), + Lang.Text("Minecraft.Launch.Precheck.NonAsciiPath.Title"), Lang.Text("Minecraft.Launch.Precheck.NonAsciiPath.Continue"), Lang.Text("Minecraft.Launch.Precheck.NonAsciiPath.Back"), Lang.Text("Common.Hint.DoNotShowAgain")); if (userChoice == 2) throw new Exception("$$"); if (userChoice == 3) States.Hint.NonAsciiGamePath = true; } // 检查实例 if (ModMinecraft.McInstanceSelected is null) - throw new Exception("未选择 Minecraft 实例!"); + throw new Exception(Lang.Text("Minecraft.Launch.Precheck.NoInstance")); ModMinecraft.McInstanceSelected.Load(); if (ModMinecraft.McInstanceSelected.State == ModMinecraft.McInstanceState.Error) - throw new Exception("Minecraft 存在问题:" + ModMinecraft.McInstanceSelected.Desc); + throw new Exception(Lang.Text("Minecraft.Launch.Precheck.InstanceError", ModMinecraft.McInstanceSelected.Desc)); // 检查输入信息 var CheckResult = ""; ModBase.RunInUiWait(() => CheckResult = Conversions.ToString(ModProfile.IsProfileValid())); if (ModProfile.SelectedProfile is null) // 没选档案 { - CheckResult = "请先选择一个档案再启动游戏!"; + CheckResult = Lang.Text("Minecraft.Launch.Precheck.NoProfile"); } else if (ModMinecraft.McInstanceSelected.Info.HasLabyMod || Conversions.ToBoolean( Operators.ConditionalCompareObjectEqual( ModBase.Setup.Get("VersionServerLoginRequire", ModMinecraft.McInstanceSelected), 1, false))) // 要求正版验证 { - if (!(ModProfile.SelectedProfile.Type == McLoginType.Ms)) CheckResult = "当前实例要求使用正版验证,请使用正版验证档案启动游戏!"; + if (!(ModProfile.SelectedProfile.Type == McLoginType.Ms)) CheckResult = Lang.Text("Minecraft.Launch.Precheck.RequireMicrosoft"); } else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual( ModBase.Setup.Get("VersionServerLoginRequire", ModMinecraft.McInstanceSelected), 2, false))) // 要求第三方验证 { if (!(ModProfile.SelectedProfile.Type == McLoginType.Auth)) - CheckResult = "当前实例要求使用第三方验证,请使用第三方验证档案启动游戏!"; + CheckResult = Lang.Text("Minecraft.Launch.Precheck.RequireThirdParty"); else if (Conversions.ToBoolean(!Operators.ConditionalCompareObjectEqual( ModProfile.SelectedProfile.Server.BeforeLast("/authserver"), ModBase.Setup.Get("VersionServerAuthServer", ModMinecraft.McInstanceSelected), false))) - CheckResult = "当前档案使用的第三方验证服务器与实例要求使用的不一致,请使用符合要求的档案启动游戏!"; + CheckResult = Lang.Text("Minecraft.Launch.Precheck.AuthServerMismatch"); } else if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual( ModBase.Setup.Get("VersionServerLoginRequire", ModMinecraft.McInstanceSelected), 3, false))) // 要求正版验证或第三方验证 { if (ModProfile.SelectedProfile.Type == McLoginType.Legacy) - CheckResult = "当前实例要求使用正版验证或第三方验证,请使用符合要求的档案启动游戏!"; + CheckResult = Lang.Text("Minecraft.Launch.Precheck.RequireMicrosoftOrThirdParty"); else if (Conversions.ToBoolean(ModProfile.SelectedProfile.Type == McLoginType.Auth && !Operators.ConditionalCompareObjectEqual( ModProfile.SelectedProfile.Server.BeforeLast("/authserver"), ModBase.Setup.Get("VersionServerAuthServer", ModMinecraft.McInstanceSelected), false))) - CheckResult = "当前档案使用的第三方验证服务器与实例要求使用的不一致,请使用符合要求的档案启动游戏!"; + CheckResult = Lang.Text("Minecraft.Launch.Precheck.AuthServerMismatch"); } if (!string.IsNullOrEmpty(CheckResult)) @@ -132,12 +132,10 @@ private static void McLaunchPrecheck() case 1800: case 2000: if (ModMain.MyMsgBox( - $"PCL 已经为你启动了 {States.System.LaunchCount} 次游戏啦!\n" + - "如果 PCL 还算好用的话,也许可以考虑赞助一下 PCL 原作者……\n" + - "如果没有大家的支持,PCL 很难在免费、无任何广告的情况下维持数年的更新(磕头)……!", - $"{States.System.LaunchCount} 次启动!", - "支持一下!", - "但是我拒绝") == 1) + Lang.Text("Minecraft.Launch.Donate.Message", States.System.LaunchCount), + Lang.Text("Minecraft.Launch.Donate.Title", States.System.LaunchCount), + Lang.Text("Minecraft.Launch.Donate.Support"), + Lang.Text("Minecraft.Launch.Donate.Decline")) == 1) { ModBase.OpenWebsite("https://afdian.com/a/LTCat"); } @@ -157,26 +155,26 @@ private static void McLaunchPrecheck() if (RegionUtils.IsRestrictedFeatAllowed) { if (ModMain.MyMsgBox( - $"看起来你似乎没买正版...{"\r\n"}如果觉得 Minecraft 还不错,可以购买正版支持一下,毕竟开发游戏也真的很不容易...不要一直白嫖啦。{"\r\n"}{"\r\n"}在验证一个正版账号之后,就不会出现这个提示了!", - "考虑一下正版?", "支持正版游戏!", "下次一定") == + Lang.Text("Minecraft.Launch.PurchaseHint.Message"), + Lang.Text("Minecraft.Launch.PurchaseHint.Title"), Lang.Text("Minecraft.Launch.PurchaseHint.Purchase"), Lang.Text("Minecraft.Launch.PurchaseHint.Later")) == 1) ModBase.OpenWebsite( "https://www.xbox.com/zh-cn/games/store/minecraft-java-bedrock-edition-for-pc/9nxp44l49shj"); } else { - switch (ModMain.MyMsgBox("你必须先登录正版账号才能启动游戏!", - "正版验证", - "购买正版", - "试玩", - "返回", + switch (ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.AccountVerification.Message"), + Lang.Text("Minecraft.Launch.AccountVerification.Title"), + Lang.Text("Minecraft.Launch.AccountVerification.Purchase"), + Lang.Text("Minecraft.Launch.AccountVerification.Demo"), + Lang.Text("Minecraft.Launch.AccountVerification.Back"), Button1Action: () => ModBase.OpenWebsite( "https://www.xbox.com/zh-cn/games/store/minecraft-java-bedrock-edition-for-pc/9nxp44l49shj"))) { case 2: { - ModMain.Hint("游戏将以试玩模式启动!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Minecraft.Launch.DemoMode"), ModMain.HintType.Critical); CurrentLaunchOptions.ExtraArgs.Add("--demo"); break; } @@ -249,7 +247,7 @@ public static bool McLaunchStart(McLaunchOptions Options = null) throw new Exception("McLaunchStart 必须在 UI 线程调用!"); if (McLaunchLoader.State == ModBase.LoadState.Loading) { - ModMain.Hint("已有游戏正在启动中!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Minecraft.Launch.Error.AlreadyLaunching"), ModMain.HintType.Critical); IsLaunching = false; return false; } @@ -263,7 +261,7 @@ public static bool McLaunchStart(McLaunchOptions Options = null) CurrentLaunchOptions.Instance.Load(); if (CurrentLaunchOptions.Instance.State == ModMinecraft.McInstanceState.Error) { - ModMain.Hint("无法启动 Minecraft:" + CurrentLaunchOptions.Instance.Desc, ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Minecraft.Launch.Error.CannotLaunch", CurrentLaunchOptions.Instance.Desc), ModMain.HintType.Critical); IsLaunching = false; return false; } @@ -353,24 +351,24 @@ private static void McLaunchStart(ModLoader.LoaderTask // 构造主加载器 var Loaders = new List { - new ModLoader.LoaderTask("获取 Java", McLaunchJava) { ProgressWeight = 4d, Block = false }, + new ModLoader.LoaderTask(Lang.Text("Minecraft.Launch.Stage.GetJava"), McLaunchJava) { ProgressWeight = 4d, Block = false }, McLoginLoader, - new ModLoader.LoaderCombo("补全文件", + new ModLoader.LoaderCombo(Lang.Text("Minecraft.Launch.Stage.CompleteFiles"), ModDownload.DlClientFix(ModMinecraft.McInstanceSelected, false, ModDownload.AssetsIndexExistsBehaviour.DownloadInBackground)) { ProgressWeight = 15d, Show = false }, - new ModLoader.LoaderTask>("获取启动参数", McLaunchArgumentMain) + new ModLoader.LoaderTask>(Lang.Text("Minecraft.Launch.Stage.GetArguments"), McLaunchArgumentMain) { ProgressWeight = 2d }, - new ModLoader.LoaderTask, int>("解压文件", McLaunchNatives) + new ModLoader.LoaderTask, int>(Lang.Text("Minecraft.Launch.Stage.ExtractNatives"), McLaunchNatives) { ProgressWeight = 2d }, - new ModLoader.LoaderTask("预启动处理", _ => McLaunchPrerun()) { ProgressWeight = 1d }, - new ModLoader.LoaderTask("执行自定义命令", McLaunchCustom) { ProgressWeight = 1d }, - new ModLoader.LoaderTask("启动进程", McLaunchRun) { ProgressWeight = 2d }, - new ModLoader.LoaderTask("等待游戏窗口出现", McLaunchWait) { ProgressWeight = 1d }, - new ModLoader.LoaderTask("结束处理", _ => McLaunchEnd()) { ProgressWeight = 1d } + new ModLoader.LoaderTask(Lang.Text("Minecraft.Launch.Stage.PreLaunch"), _ => McLaunchPrerun()) { ProgressWeight = 1d }, + new ModLoader.LoaderTask(Lang.Text("Minecraft.Launch.Stage.CustomCommand"), McLaunchCustom) { ProgressWeight = 1d }, + new ModLoader.LoaderTask(Lang.Text("Minecraft.Launch.Stage.StartProcess"), McLaunchRun) { ProgressWeight = 2d }, + new ModLoader.LoaderTask(Lang.Text("Minecraft.Launch.Stage.WaitWindow"), McLaunchWait) { ProgressWeight = 1d }, + new ModLoader.LoaderTask(Lang.Text("Minecraft.Launch.Stage.End"), _ => McLaunchEnd()) { ProgressWeight = 1d } }; // .ProgressWeight = 15, .Block = False - var LaunchLoader = new ModLoader.LoaderCombo("Minecraft 启动", Loaders) { Show = false }; + var LaunchLoader = new ModLoader.LoaderCombo(Lang.Text("Minecraft.Launch.Stage.Root"), Loaders) { Show = false }; if (McLoginLoader.State == ModBase.LoadState.Finished) McLoginLoader.State = ModBase.LoadState.Waiting; // 要求重启登录主加载器,它会自行决定是否启动副加载器 // 等待加载器执行并更新 UI @@ -391,13 +389,13 @@ private static void McLaunchStart(ModLoader.LoaderTask { case ModBase.LoadState.Finished: { - ModMain.Hint(ModMinecraft.McInstanceSelected.Name + " 启动成功!", ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Minecraft.Launch.Success", ModMinecraft.McInstanceSelected.Name), ModMain.HintType.Finish); break; } case ModBase.LoadState.Aborted: { if (AbortHint is null) - ModMain.Hint(CurrentLaunchOptions?.SaveBatch is null ? "已取消启动!" : "已取消导出启动脚本!"); + ModMain.Hint(CurrentLaunchOptions?.SaveBatch is null ? Lang.Text("Minecraft.Launch.Cancelled") : Lang.Text("Minecraft.Launch.ExportScript.Cancelled")); else ModMain.Hint(AbortHint, ModMain.HintType.Finish); @@ -410,7 +408,7 @@ private static void McLaunchStart(ModLoader.LoaderTask default: { - throw new Exception("错误的状态改变:" + ModBase.GetStringFromEnum(LaunchLoader.State)); + throw new Exception(Lang.Text("Minecraft.Launch.Error.InvalidState", ModBase.GetStringFromEnum(LaunchLoader.State))); } } @@ -427,7 +425,7 @@ private static void McLaunchStart(ModLoader.LoaderTask // 若错误信息为 $$,则不提示 if (!(CurrentEx.Message == "$$")) ModMain.MyMsgBox(CurrentEx.Message.TrimStart('$'), - CurrentLaunchOptions?.SaveBatch is null ? "启动失败" : "导出启动脚本失败"); + CurrentLaunchOptions?.SaveBatch is null ? Lang.Text("Launch.Error.Title") : Lang.Text("Launch.Error.ExportScriptTitle")); throw; } @@ -440,8 +438,8 @@ private static void McLaunchStart(ModLoader.LoaderTask // 没有特殊处理过的错误信息 McLaunchLog("错误:" + ex); - ModBase.Log(ex, CurrentLaunchOptions?.SaveBatch is null ? "Minecraft 启动失败" : "导出启动脚本失败", - ModBase.LogLevel.Msgbox, CurrentLaunchOptions?.SaveBatch is null ? "启动失败" : "导出启动脚本失败"); + ModBase.Log(ex, CurrentLaunchOptions?.SaveBatch is null ? "Minecraft launch failed" : "Export script failed", + ModBase.LogLevel.Msgbox, CurrentLaunchOptions?.SaveBatch is null ? Lang.Text("Launch.Error.Title") : Lang.Text("Launch.Error.ExportScriptTitle")); throw; } } @@ -606,7 +604,7 @@ public struct McLoginResult // 登录主模块加载器 public static ModLoader.LoaderTask McLoginLoader = - new("登录", McLoginStart, McLoginInput, ThreadPriority.BelowNormal) + new(Lang.Text("Minecraft.Launch.Stage.Login"), McLoginStart, McLoginInput, ThreadPriority.BelowNormal) { ReloadTimeout = 1, ProgressWeight = 15d, Block = false }; public static McLoginData McLoginInput() @@ -2071,7 +2069,7 @@ private static void McLaunchJava(ModLoader.LoaderTask task) } else { - ModMain.Hint("没有可用的 Java,已取消启动!", ModMain.HintType.Critical); + ModMain.Hint(Lang.Text("Minecraft.Launch.Error.NoJava"), ModMain.HintType.Critical); throw new Exception("$$"); } } @@ -3337,7 +3335,7 @@ private static void McLaunchCustom(ModLoader.LoaderTask Loader) if (CurrentLaunchOptions.SaveBatch is not null) { McLaunchLog("导出启动脚本完成,强制结束启动过程"); - AbortHint = "导出启动脚本成功!"; + AbortHint = Lang.Text("Minecraft.Launch.ExportScript.Success"); ModBase.OpenExplorer(CurrentLaunchOptions.SaveBatch); Loader.Parent.Abort(); return; // 导出脚本完成 diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs index b10ebeb08..7e974884c 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.cs @@ -30,6 +30,10 @@ private enum LaunchButtonAction private LaunchButtonAction _launchButtonAction; + private static string StageWaitWindow => Lang.Text("Minecraft.Launch.Stage.WaitWindow"); + private static string StageEnd => Lang.Text("Minecraft.Launch.Stage.End"); + private static string StageRoot => Lang.Text("Minecraft.Launch.Stage.Root"); + // 加载当前实例 private bool IsLoad; @@ -384,7 +388,7 @@ public void LaunchingRefresh() if (Loader.State == ModBase.LoadState.Loading || Loader.State == ModBase.LoadState.Waiting) { LabLaunchingStage.Text = Loader.Name; - IsLaunched = Loader.Name == "等待游戏窗口出现" || Loader.Name == "结束处理"; + IsLaunched = Loader.Name == StageWaitWindow || Loader.Name == StageEnd; exitTry = true; break; } @@ -417,7 +421,7 @@ public void LaunchingRefresh() try { foreach (var Loader in ModNet.NetManager.Tasks) - if (Loader.RealParent is not null && Loader.RealParent.Name == "Minecraft 启动" && + if (Loader.RealParent is not null && Loader.RealParent.Name == StageRoot && Loader.State == ModBase.LoadState.Loading) HasLaunchDownloader = true; } From b4c9dd7b18cf17a1bf98dc8e66d99e3e29d24de6 Mon Sep 17 00:00:00 2001 From: ClovenBugle Date: Fri, 22 May 2026 05:02:57 +0800 Subject: [PATCH 6/9] =?UTF-8?q?Microsoft=E3=80=81=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95=E6=B5=81=E7=A8=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 44 ++++++++ .../App/Localization/Languages/zh-CN.xaml | 44 ++++++++ .../Modules/Minecraft/ModLaunch.cs | 104 +++++++++--------- 3 files changed, 139 insertions(+), 53 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index 7031d42aa..f39c1493d 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -1160,4 +1160,48 @@ {0} launches! Support! I refuse + + + Password Required + During login, please select {0}Other Sign-in Methods{1}, then select {0}Use My Password{1}. If this option is not available, please select {0}Set Password{1}, then log in after setting it up. + Re-login + Set Password + Account Info Refresh Failed + The launcher encountered a network error while trying to refresh account information. You can cancel, check your network, and try again, or ignore the error and continue launching, but some servers may not be playable. + This account appears to be banned by Microsoft and cannot log in. + You have not registered an Xbox account. Please register first and then log in. + The country or region of your network cannot log in to a Microsoft account. Please use an accelerator or VPN. + The account is underage. You need to modify the date of birth before logging in. Is the age currently set on this account over 13? + Over 13 + Under 13 + I don't know + Please modify the account's date of birth on the opened webpage (change to at least 18 years old). Wait one minute after the modification is successful, then return to PCL and you can log in normally! + Please modify the account's date of birth on the opened webpage (change to at least 18 years old). Wait one minute after the modification is successful, then return to PCL and you can log in normally! + $Too many login attempts, please wait a few minutes and try again! + $Abnormal login attempts from this IP. If you are using a VPN or accelerator, please turn it off or switch nodes and try again! + Unable to get account information. This account may not have purchased Minecraft Java Edition, or the Xbox Game Pass may have expired. + Purchase Minecraft + Please create a Minecraft player profile first, then log in again. + Create Profile + You have already added this profile... + Continue + I Understand + Login Failed + Register + Login Hint + + + Login refresh failed + Third-party Login Failed + Second login refresh failed + Login failed: Connection to login server timed out. Please check your network connection or try using a VPN! + $Login failed: Connection to login server timed out. Please check your network connection or try using a VPN! Details: + Third-party login failed. Please check your network connection. + Selected profile {0} is invalid! + You have not created a profile, unable to switch! + $You have not created a profile, please create one first! + You only have one profile in this account, unable to switch! + Select Profile + Login failed: {0} + Details: \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index 77106da6b..d36a241e8 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -1155,4 +1155,48 @@ {0} 次启动! 支持一下! 但是我拒绝 + + + 需要使用密码登录 + 请在登录时选择 {0}其他登录方法{1},然后选择 {0}使用我的密码{1}。 如果没有该选项,请选择 {0}设置密码{1},设置完毕后再登录。 + 重新登录 + 设置密码 + 账号信息获取失败 + 启动器在尝试刷新账号信息时遇到了网络错误。 你可以选择取消,检查网络后再次启动,也可以选择忽略错误继续启动,但可能无法游玩部分服务器。 + 该账号似乎已被微软封禁,无法登录。 + 你尚未注册 Xbox 账户,请在注册后再登录。 + 你的网络所在的国家或地区无法登录微软账号。 请使用加速器或 VPN。 + 该账号年龄不足,你需要先修改出生日期,然后才能登录。 该账号目前填写的年龄是否在 13 岁以上? + 13 岁以上 + 12 岁以下 + 我不知道 + 请在打开的网页中修改账号的出生日期(至少改为 18 岁以上)。 在修改成功后等待一分钟,然后再回到 PCL,就可以正常登录了! + 请在打开的网页中修改账号的出生日期(至少改为 18 岁以上)。 在修改成功后等待一分钟,然后再回到 PCL,就可以正常登录了! + $登录尝试太过频繁,请等待几分钟后再试! + $当前 IP 的登录尝试异常。 如果你使用了 VPN 或加速器,请把它们关掉或更换节点后再试! + 暂时无法获取到此账户信息,此账户可能没有购买 Minecraft Java Edition 或者账户的 Xbox Game Pass 已过期 + 购买 Minecraft + 请先创建 Minecraft 玩家档案,然后再重新登录。 + 创建档案 + 你已经添加了这个档案... + 继续 + 我知道了 + 登录失败 + 注册 + 登录提示 + + + 刷新登录失败 + 第三方验证失败 + 二轮刷新登录失败 + 登录失败:连接登录服务器超时。 请检查你的网络状况是否良好,或尝试使用 VPN! + $登录失败:连接登录服务器超时。 请检查你的网络状况是否良好,或尝试使用 VPN! 详细信息: + 第三方验证登录失败,请检查你的网络状况是否良好。 + 选择的角色 {0} 无效! + 你还没有创建角色,无法更换! + $你还没有创建角色,请在创建角色后再试! + 你的账户中只有一个角色,无法更换! + 选择使用的角色 + 登录失败:{0} + 详细信息: \ No newline at end of file diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs index 380cac108..5869d19a5 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs @@ -776,7 +776,7 @@ private static void McLoginMsStart(ModLoader.LoaderTask ModBase.OpenWebsite("https://account.live.com/password/Change")) == 1) goto Retry; @@ -969,8 +969,8 @@ private static string[] MsLoginStep1Refresh(string Code) if (!IsLaunching) return; if (ModMain.MyMsgBox( - $"启动器在尝试刷新账号信息时遇到了网络错误。{"\r\n"}你可以选择取消,检查网络后再次启动,也可以选择忽略错误继续启动,但可能无法游玩部分服务器。", - "账号信息获取失败", "继续", Lang.Text("Common.Action.Cancel")) == 1) + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Message"), + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Title"), Lang.Text("Minecraft.Launch.Login.Continue"), Lang.Text("Common.Action.Cancel")) == 1) IsIgnore = true; }); if (IsIgnore) return new[] { "Ignore", "" }; @@ -1041,8 +1041,8 @@ private static string MsLoginStep2(string accessToken) if (!IsLaunching) return; if (ModMain.MyMsgBox( - $"启动器在尝试刷新账号信息时(Step 2)遇到了网络错误。{"\r\n"}你可以选择取消,检查网络后再次启动,也可以选择忽略错误继续启动,但可能无法游玩部分服务器。", - "账号信息获取失败", "继续", Lang.Text("Common.Action.Cancel")) == 1) + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Message"), + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Title"), Lang.Text("Minecraft.Launch.Login.Continue"), Lang.Text("Common.Action.Cancel")) == 1) IsIgnore = true; }); if (IsIgnore) return "Ignore"; @@ -1101,40 +1101,40 @@ private static string[] MsLoginStep3(string XBLToken) // 参考 https://github.com/PrismarineJS/prismarine-auth/blob/master/src/common/Constants.js if (result.Contains("2148916227")) { - ModMain.MyMsgBox("该账号似乎已被微软封禁,无法登录。", "登录失败", "我知道了", IsWarn: true); + ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.Login.Microsoft.Banned"), Lang.Text("Minecraft.Launch.Login.Failed"), Lang.Text("Minecraft.Launch.Login.IKnow"), IsWarn: true); throw new Exception("$$"); } if (result.Contains("2148916233")) { - if (ModMain.MyMsgBox("你尚未注册 Xbox 账户,请在注册后再登录。", "登录提示", "注册", Lang.Text("Common.Action.Cancel")) == 1) + if (ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.Login.Microsoft.XboxNotRegistered"), Lang.Text("Minecraft.Launch.Login.Hint"), Lang.Text("Minecraft.Launch.Login.Register"), Lang.Text("Common.Action.Cancel")) == 1) ModBase.OpenWebsite("https://signup.live.com/signup"); throw new Exception("$$"); } if (result.Contains("2148916235")) { - ModMain.MyMsgBox($"你的网络所在的国家或地区无法登录微软账号。{"\r\n"}请使用加速器或 VPN。", "登录失败", "我知道了"); + ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.Login.Microsoft.RegionBlocked"), Lang.Text("Minecraft.Launch.Login.Failed"), Lang.Text("Minecraft.Launch.Login.IKnow")); throw new Exception("$$"); } if (result.Contains("2148916238")) { - if (ModMain.MyMsgBox("该账号年龄不足,你需要先修改出生日期,然后才能登录。" + "\r\n" + "该账号目前填写的年龄是否在 13 岁以上?", - "登录提示", "13 岁以上", "12 岁以下", "我不知道") == 1) + if (ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.Message"), + Lang.Text("Minecraft.Launch.Login.Hint"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.AgeOver13"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.AgeUnder13"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.Unknown")) == 1) { ModBase.OpenWebsite("https://account.live.com/editprof.aspx"); ModMain.MyMsgBox( - "请在打开的网页中修改账号的出生日期(至少改为 18 岁以上)。" + "\r\n" + "在修改成功后等待一分钟,然后再回到 PCL,就可以正常登录了!", - "登录提示"); + Lang.Text("Minecraft.Launch.Login.Microsoft.ChangeBirthDate.Message"), + Lang.Text("Minecraft.Launch.Login.Hint")); } else { ModBase.OpenWebsite( "https://support.microsoft.com/zh-cn/account-billing/如何更改-microsoft-帐户上的出生日期-837badbc-999e-54d2-2617-d19206b9540a"); ModMain.MyMsgBox( - "请根据打开的网页的说明,修改账号的出生日期(至少改为 18 岁以上)。" + "\r\n" + - "在修改成功后等待一分钟,然后再回到 PCL,就可以正常登录了!", "登录提示"); + Lang.Text("Minecraft.Launch.Login.Microsoft.ChangeBirthDate.SupportMessage"), + Lang.Text("Minecraft.Launch.Login.Hint")); } throw new Exception("$$"); @@ -1147,8 +1147,8 @@ private static string[] MsLoginStep3(string XBLToken) if (!IsLaunching) return; if (ModMain.MyMsgBox( - $"启动器在尝试刷新账号信息时(Step 3)遇到了网络错误。{"\r\n"}你可以选择取消,检查网络后再次启动,也可以选择忽略错误继续启动,但可能无法游玩部分服务器。", - "账号信息获取失败", "继续", Lang.Text("Common.Action.Cancel")) == 1) + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Message"), + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Title"), Lang.Text("Minecraft.Launch.Login.Continue"), Lang.Text("Common.Action.Cancel")) == 1) IsIgnore = true; }); if (IsIgnore) @@ -1198,13 +1198,13 @@ private static string MsLoginStep4(string[] Tokens) if (ex.StatusCode.Equals(HttpStatusCode.TooManyRequests)) { ModBase.Log(ex, "正版验证 Step 4 汇报 429"); - throw new Exception("$登录尝试太过频繁,请等待几分钟后再试!"); + throw new Exception(Lang.Text("Minecraft.Launch.Login.Microsoft.TooManyRequests")); } if (ex.StatusCode is { } arg1 && arg1 == HttpStatusCode.Forbidden) { ModBase.Log(ex, "正版验证 Step 4 汇报 403"); - throw new Exception("$当前 IP 的登录尝试异常。" + "\r\n" + "如果你使用了 VPN 或加速器,请把它们关掉或更换节点后再试!"); + throw new Exception(Lang.Text("Minecraft.Launch.Login.Microsoft.AbnormalIp")); } ModProfile.ProfileLog("正版验证 Step 4/6 获取 MC AccessToken 失败:" + ex); @@ -1214,8 +1214,8 @@ private static string MsLoginStep4(string[] Tokens) if (!IsLaunching) return; if (ModMain.MyMsgBox( - $"启动器在尝试刷新账号信息时(Step 4)遇到了网络错误。{"\r\n"}你可以选择取消,检查网络后再次启动,也可以选择忽略错误继续启动,但可能无法游玩部分服务器。", - "账号信息获取失败", "继续", Lang.Text("Common.Action.Cancel")) == 1) + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Message"), + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Title"), Lang.Text("Minecraft.Launch.Login.Continue"), Lang.Text("Common.Action.Cancel")) == 1) IsIgnore = true; }); if (IsIgnore) @@ -1261,8 +1261,8 @@ private static void MsLoginStep5(string accessToken) if (!(ResultJson.ContainsKey("items") && ResultJson["items"].Any(x => x["name"]?.ToString() == "product_minecraft" || x["name"]?.ToString() == "game_minecraft"))) { - switch (ModMain.MyMsgBox("暂时无法获取到此账户信息,此账户可能没有购买 Minecraft Java Edition 或者账户的 Xbox Game Pass 已过期", - "登录失败", "购买 Minecraft", Lang.Text("Common.Action.Cancel"))) + switch (ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.Login.Microsoft.NotPurchased"), + Lang.Text("Minecraft.Launch.Login.Failed"), Lang.Text("Minecraft.Launch.Login.Microsoft.PurchaseMinecraft"), Lang.Text("Common.Action.Cancel"))) { case 1: { @@ -1312,7 +1312,7 @@ private static string[] MsLoginStep6(string AccessToken) if (ex.StatusCode.Equals(HttpStatusCode.TooManyRequests)) { ModBase.Log(ex, "正版验证 Step 6 汇报 429"); - throw new Exception("$登录尝试太过频繁,请等待几分钟后再试!"); + throw new Exception(Lang.Text("Minecraft.Launch.Login.Microsoft.TooManyRequests")); } if (ex.StatusCode is { } arg2 && arg2 == HttpStatusCode.NotFound) @@ -1320,7 +1320,7 @@ private static string[] MsLoginStep6(string AccessToken) ModBase.Log(ex, "正版验证 Step 6 汇报 404"); ModBase.RunInNewThread(() => { - switch (ModMain.MyMsgBox("请先创建 Minecraft 玩家档案,然后再重新登录。", "登录失败", "创建档案", Lang.Text("Common.Action.Cancel"))) + switch (ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.Login.Microsoft.CreateProfile.Message"), Lang.Text("Minecraft.Launch.Login.Failed"), Lang.Text("Minecraft.Launch.Login.Microsoft.CreateProfile.Button"), Lang.Text("Common.Action.Cancel"))) { case 1: { @@ -1339,8 +1339,8 @@ private static string[] MsLoginStep6(string AccessToken) if (!IsLaunching) return; if (ModMain.MyMsgBox( - $"启动器在尝试刷新账号信息时(Step 6)遇到了网络错误。{"\r\n"}你可以选择取消,检查网络后再次启动,也可以选择忽略错误继续启动,但可能无法游玩部分服务器。", - "账号信息获取失败", "继续", Lang.Text("Common.Action.Cancel")) == 1) + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Message"), + Lang.Text("Minecraft.Launch.Login.RefreshAccountFailed.Title"), Lang.Text("Minecraft.Launch.Login.Continue"), Lang.Text("Common.Action.Cancel")) == 1) IsIgnore = true; }); if (IsIgnore) @@ -1403,10 +1403,10 @@ private static void McLoginServerStart(ModLoader.LoaderTask Date: Fri, 22 May 2026 05:12:43 +0800 Subject: [PATCH 7/9] =?UTF-8?q?Java=E3=80=81=E5=90=AF=E5=8A=A8=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 13 ++++++++ .../App/Localization/Languages/zh-CN.xaml | 13 ++++++++ .../Modules/Minecraft/ModLaunch.cs | 30 +++++++++---------- 3 files changed, 41 insertions(+), 15 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index f39c1493d..c82193d17 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -1126,6 +1126,11 @@ A game is already launching! Cannot launch Minecraft: {0} No Java available, launch cancelled! + OptiFine may be incompatible with auto-join server, potentially causing missing textures or even game crashes! + Unable to connect to third-party login server ({0}). + Unable to connect to third-party login server ({0}). Details: + Missing "mainClass" in version JSON! + Unable to open the Natives file ({0}), the file may be corrupted. Please try relaunching the game. Game path cannot contain ! or ; ({0}) @@ -1204,4 +1209,12 @@ Select Profile Login failed: {0} Details: + + + Java Not Found + Please search and install it manually + You need to install the LegacyJavaFixer mod, or install Java 7 to launch this version. Please search and install Java 7 manually, then re-search or import it in Settings → Launch Options → Game Java. + You need to install Java 7 to launch this version. Please search and install Java 7 manually, then re-search or import it in Settings → Launch Options → Game Java. + You need to install Java 8u141 ~ 8u320 to launch this version. Please search and install it manually, then re-search or import it in Settings → Launch Options → Game Java. + You need to install Java 8u141 or later to launch this version. Please search and install it manually, then re-search or import it in Settings → Launch Options → Game Java. \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index d36a241e8..c3b912085 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -1121,6 +1121,11 @@ 已有游戏正在启动中! 无法启动 Minecraft:{0} 没有可用的 Java,已取消启动! + OptiFine 与自动进入服务器可能不兼容,有概率导致材质丢失甚至游戏崩溃! + 无法连接到第三方登录服务器({0}) + 无法连接到第三方登录服务器({0}) 详细信息: + 实例 JSON 中没有 mainClass 项! + 无法打开 Natives 文件({0}),该文件可能已损坏,请重新尝试启动游戏 游戏路径中不可包含 ! 或 ;({0}) @@ -1199,4 +1204,12 @@ 选择使用的角色 登录失败:{0} 详细信息: + + + 未找到 Java + 请自行搜索并安装 + 你需要先安装 LegacyJavaFixer Mod,或安装 Java 7 才能启动该版本。 请自行搜索并安装 Java 7,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。 + 你需要安装 Java 7 才能启动该版本。 请自行搜索并安装 Java 7,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。 + 你需要安装 Java 8u141 ~ 8u320 才能启动该版本。 请自行搜索并安装,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。 + 你需要安装 Java 8u141 或更高版本的 Java 8 才能启动该版本。 请自行搜索并安装,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。 \ No newline at end of file diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs index 5869d19a5..9a81fb997 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs @@ -2012,26 +2012,26 @@ private static void McLaunchJava(ModLoader.LoaderTask task) { if (ModMinecraft.McInstanceSelected.Info.HasForge) ModMain.MyMsgBox( - $"你需要先安装 LegacyJavaFixer Mod,或安装 Java 7 才能启动该版本。{"\r\n"}请自行搜索并安装 Java 7,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。", - "未找到 Java"); + Lang.Text("Minecraft.Launch.Java.NeedLegacyJavaFixerOrJava7"), + Lang.Text("Minecraft.Launch.Java.NotFound.Title")); else ModMain.MyMsgBox( - $"你需要安装 Java 7 才能启动该版本。{"\r\n"}请自行搜索并安装 Java 7,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。", - "未找到 Java"); + Lang.Text("Minecraft.Launch.Java.NeedJava7"), + Lang.Text("Minecraft.Launch.Java.NotFound.Title")); throw new Exception("$$"); } else if (minVer > new Version(1, 8, 0, 140) && maxVer < new Version(1, 8, 0, 321)) { ModMain.MyMsgBox( - $"你需要安装 Java 8u141 ~ 8u320 才能启动该版本。{"\r\n"}请自行搜索并安装,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。", - "未找到 Java"); + Lang.Text("Minecraft.Launch.Java.NeedJava8U141ToU320"), + Lang.Text("Minecraft.Launch.Java.NotFound.Title")); throw new Exception("$$"); } else if (minVer > new Version(1, 8, 0, 140)) { ModMain.MyMsgBox( - $"你需要安装 Java 8u141 或更高版本的 Java 8 才能启动该版本。{"\r\n"}请自行搜索并安装,安装后在 设置 → 启动选项 → 游戏 Java 中重新搜索或导入。", - "未找到 Java"); + Lang.Text("Minecraft.Launch.Java.NeedJava8U141OrLater"), + Lang.Text("Minecraft.Launch.Java.NotFound.Title")); throw new Exception("$$"); } else @@ -2395,7 +2395,7 @@ private static void McLaunchArgumentMain(ModLoader.LoaderTask Date: Fri, 22 May 2026 08:34:25 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 43 +++++++++++++++++++ .../App/Localization/Languages/zh-CN.xaml | 43 +++++++++++++++++++ .../Modules/Minecraft/ModLaunch.cs | 14 +++--- .../Modules/Minecraft/ModMinecraft.cs | 14 +++--- .../Modules/Minecraft/ModProfile.cs | 8 ++-- .../Pages/PageLaunch/MyMsgLogin.xaml.cs | 4 +- .../Pages/PageLaunch/MySkin.xaml.cs | 14 +++--- .../Pages/PageLaunch/PageLaunchLeft.xaml.cs | 14 +++--- .../Pages/PageLaunch/PageLaunchRight.xaml.cs | 6 +-- .../Pages/PageLaunch/PageLoginProfile.xaml.cs | 2 +- .../Pages/PageSelectLeft.xaml.cs | 12 +++--- .../Pages/PageSelectRight.xaml.cs | 6 +-- 12 files changed, 133 insertions(+), 47 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index c82193d17..800bff98b 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -788,6 +788,8 @@ View details Loading... + Failed to download homepage ({0}) + Failed to read external file: {0} Test Title Text @@ -798,6 +800,8 @@ The login page will open automatically, and the authorization code will be auto-filled. If you have network issues and the page fails to load, please use a VPN and try again. If the code is not auto-filled, paste this authorization code {0} (will be automatically copied) into the page. You can also open {1} on another device and enter the authorization code. Successfully logged in through the webpage! Microsoft verification polling failed + Microsoft login dialog initialization failed + Microsoft login dialog loading failed Verify @@ -883,6 +887,11 @@ UUID should only contain letters and numbers! Profile saved! Profile deleted successfully! + Failed to read profile list + Profile data read failed, the file may be corrupted. The profile file has been backed up and reset. + Failed to write profile list + Failed to modify profile ID + Failed to change skin Profile migration @@ -920,6 +929,7 @@ This profile does not support changing the password! This profile does not support changing the skin! This profile does not support changing the cape! + Failed to switch login page ({0}) Back @@ -988,6 +998,16 @@ Alex model I do not know Please confirm the skin model on the skin download page before using this skin! + Failed to save skin + Skin file corrupted: {0} + Failed to load avatar: {0} + Failed to refresh skin cache + Failed to refresh skin after changing Microsoft skin + Failed to get player cape list + Skin file has errors + Skin fetch rate limited, please try again in 5 minutes ({0}) + Failed to get Microsoft skin ({0}) + Failed to get Authlib-Injector skin ({0}) Folder list @@ -1039,6 +1059,15 @@ Invalid Minecraft folder: {0} Minecraft folder is invalid Minecraft Folder Unavailable + Failed to load Minecraft folder list + Folder drag-and-drop sort failed + Auto-install modpack failed: {0} + Failed to add folder ({0}) + Failed to add new folder to list + Failed to remove game folder from list + Failed to rename folder + Failed to {0} folder {1} + Failed to clean up leftover ignored items ({0}) Search game instances @@ -1097,6 +1126,13 @@ Old version April Fools' {0} An unknown error has occurred. Please report this issue to the author. + Failed to load instance ({0}) + Failed to categorize instance list + Failed to load .minecraft instance list + Failed to load instance icon + Failed to render instance list UI + Failed to delete instance {0} + Failed to send Minecraft update notification ({0}) Getting Java @@ -1131,6 +1167,12 @@ Unable to connect to third-party login server ({0}). Details: Missing "mainClass" in version JSON! Unable to open the Natives file ({0}), the file may be corrupted. Please try relaunching the game. + Failed to cancel launch and terminate process + Failed to refresh launch info + Failed to add proxy info, giving up + Failed to set GPU preference, Minecraft may run on the default GPU + Failed to execute custom command + Failed to set process priority Game path cannot contain ! or ; ({0}) @@ -1194,6 +1236,7 @@ Login Failed Register Login Hint + Failed to get login input info Login refresh failed diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index c3b912085..8a83518de 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -775,6 +775,8 @@ 主页内容编写有误,请根据下列错误信息进行检查: {0} 重试 主页加载过于缓慢(花费了 {0} 秒),请向主页作者反馈此问题,或暂时停止使用该主页 + 下载主页失败({0}) + 读取外部文件失败:{0} 回声洞 因为只有空壳因此已被移除,请前往设置选择其他预设主页 @@ -792,6 +794,8 @@ 登录网页将自动开启,授权码将自动填充。 如果网络环境不佳,网页可能一直加载不出来,届时请使用 VPN 并重试。 如果没有自动填充,请在页面内粘贴此授权码 {0}(将自动复制) 你也可以用其他设备打开 {1} 并输入授权码。 网页登录成功! 正版验证轮询失败 + 正版验证弹窗初始化失败 + 正版验证弹窗加载失败 开始正版验证 @@ -803,6 +807,7 @@ 正版登录验证失败,请考虑在 [设置 → 其他] 中关闭 [在正版登录时验证 SSL 证书],然后再试。 原始错误信息: 正版登录尝试失败 未知错误! + 切换登录分页失败({0}) 验证服务器: {0} @@ -877,6 +882,10 @@ UUID 只应该包括英文字母和数字! 档案信息已保存! 档案删除成功! + 读取档案列表失败 + 档案数据读取失败,文件可能意外损坏。已对档案文件进行备份重置。 + 写入档案列表失败 + 修改档案 ID 失败 档案迁移 @@ -914,6 +923,7 @@ 当前档案不支持修改密码! 当前档案不支持修改皮肤! 当前档案不支持修改披风! + 更改皮肤失败 返回 @@ -931,6 +941,14 @@ 正在刷新头像…… 已刷新头像! 更改皮肤成功! + 保存皮肤失败 + 皮肤文件已损坏:{0} + 载入头像失败:{0} + 刷新皮肤缓存失败 + 更改正版皮肤后刷新皮肤失败 + 获取正版皮肤太过频繁,请 5 分钟后再试({0}) + 获取微软正版皮肤失败({0}) + 获取 Authlib-Injector 皮肤失败({0}) 正在更改披风中,请稍候! @@ -941,6 +959,7 @@ 更改披风失败 更改披风失败:{0} 更改披风成功!等待一段时间后将会生效…… + 获取玩家皮肤列表失败 迁移者披风 @@ -976,6 +995,7 @@ 选择皮肤文件 皮肤图片大小应为 64x32 像素或 64x64 像素! 皮肤文件大小需小于 24 KB,而所选文件大小为 {0} KB + 皮肤文件存在错误 选择皮肤种类 此皮肤为 Steve 模型(粗手臂)还是 Alex 模型(细手臂)? Steve 模型 @@ -1034,6 +1054,15 @@ 无效的 Minecraft 文件夹:{0} Minecraft 文件夹失效 Minecraft 文件夹失效 + 加载 Minecraft 文件夹列表失败 + 拖拽文件夹排序操作失败 + 自动安装整合包失败:{0} + 添加文件夹失败({0}) + 向文件夹列表中添加新文件夹失败 + 从列表中移除游戏文件夹失败 + 重命名文件夹失败 + {0}文件夹 {1} 失败 + 清理残留的忽略项目失败({0}) 搜索游戏实例 @@ -1092,6 +1121,12 @@ 远古版本 愚人节版本 {0} 发生了未知错误,请向作者反馈此问题 + 加载实例失败({0}) + 分类实例列表失败 + 加载 .minecraft 实例列表失败 + 加载实例图标失败 + 将实例列表转换显示时失败 + 删除实例 {0} 失败 获取 Java @@ -1111,6 +1146,7 @@ 已取消启动! 已取消导出启动脚本! 导出启动脚本成功! + Minecraft 更新提示发送失败({0}) 启动失败 @@ -1126,6 +1162,12 @@ 无法连接到第三方登录服务器({0}) 详细信息: 实例 JSON 中没有 mainClass 项! 无法打开 Natives 文件({0}),该文件可能已损坏,请重新尝试启动游戏 + 取消启动结束进程失败 + 刷新启动信息失败 + 添加代理信息到游戏失败,放弃加入 + 调整显卡设置失败,Minecraft 可能会使用默认显卡运行 + 执行自定义命令失败 + 设置进程优先级失败 游戏路径中不可包含 ! 或 ;({0}) @@ -1189,6 +1231,7 @@ 登录失败 注册 登录提示 + 获取登录输入信息失败 刷新登录失败 diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs index 9a81fb997..b3bc30f86 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs @@ -616,7 +616,7 @@ public static McLoginData McLoginInput() } catch (Exception ex) { - ModBase.Log(ex, "获取登录输入信息失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Minecraft.Launch.Login.Error.Input"), ModBase.LogLevel.Feedback); } return LoginData; @@ -2494,7 +2494,7 @@ private static string McLaunchArgumentsJvmOld(ModMinecraft.McInstance instance) } catch (Exception ex) { - ModBase.Log(ex, "添加代理信息到游戏失败,放弃加入", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Minecraft.Launch.Error.Proxy"), ModBase.LogLevel.Hint); } // 添加 Java Wrapper 作为主 Jar @@ -2619,7 +2619,7 @@ private static string McLaunchArgumentsJvmNew(ModMinecraft.McInstance instance) } catch (Exception ex) { - ModBase.Log(ex, "添加代理信息到游戏失败,放弃加入", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Minecraft.Launch.Error.Proxy"), ModBase.LogLevel.Hint); } // 添加 RetroWrapper 相关参数 @@ -3091,7 +3091,7 @@ private static void McLaunchPrerun() } catch (Exception exx) { - ModBase.Log(exx, "调整显卡设置失败,Minecraft 可能会使用默认显卡运行", ModBase.LogLevel.Hint); + ModBase.Log(exx, Lang.Text("Minecraft.Launch.Error.GpuSet"), ModBase.LogLevel.Hint); } } } @@ -3365,7 +3365,7 @@ private static void McLaunchCustom(ModLoader.LoaderTask Loader) } catch (Exception ex) { - ModBase.Log(ex, "执行全局自定义命令失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Minecraft.Launch.Error.CustomCommand"), ModBase.LogLevel.Hint); } finally { @@ -3395,7 +3395,7 @@ private static void McLaunchCustom(ModLoader.LoaderTask Loader) } catch (Exception ex) { - ModBase.Log(ex, "执行实例自定义命令失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Minecraft.Launch.Error.CustomCommand"), ModBase.LogLevel.Hint); } finally { @@ -3466,7 +3466,7 @@ private static void McLaunchRun(ModLoader.LoaderTask Loader) } catch (Exception ex) { - ModBase.Log(ex, "设置进程优先级失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Minecraft.Launch.Error.PrioritySet"), ModBase.LogLevel.Feedback); } } diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs index bccaf1339..65d277e1a 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs @@ -58,7 +58,7 @@ public static void McDownloadClientUpdateHint(string versionName, JObject json) catch (Exception ex) { - ModBase.Log(ex, "Minecraft 更新提示发送失败(" + (versionName ?? "Nothing") + ")", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Minecraft.Error.UpdateNotify", versionName ?? "Nothing"), ModBase.LogLevel.Feedback); } } @@ -369,7 +369,7 @@ private static void McFolderListLoadSub() catch (Exception ex) { - ModBase.Log(ex, "加载 Minecraft 文件夹列表失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.Load"), ModBase.LogLevel.Feedback); } } @@ -1342,7 +1342,7 @@ public McInstance Load() Desc = Lang.Text("Select.Instance.Description.UnknownError") + ": " + ex; Logo = ModBase.PathImage + "Blocks/RedstoneBlock.png"; State = McInstanceState.Error; - ModBase.Log(ex, "加载实例失败(" + Name + ")", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Instance.Error.Load", Name), ModBase.LogLevel.Feedback); } finally { @@ -1960,7 +1960,7 @@ private static void InitMcInstanceList(ModLoader.LoaderTask loader) catch (Exception ex) { ModBase.WriteIni(Path.Combine(path, "PCL.ini"), "InstanceCache", ""); // 要求下次重新加载 - ModBase.Log(ex, "加载 .minecraft 实例列表失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Instance.Error.ListLoad"), ModBase.LogLevel.Feedback); } } @@ -2128,7 +2128,7 @@ private static Dictionary> InitMcInstanceLi } catch (Exception ex) { - ModBase.Log(ex, "清理残留的忽略项目失败(" + instanceFolder + ")", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.Cleanup", instanceFolder), ModBase.LogLevel.Hint); } } else @@ -2283,7 +2283,7 @@ private static Dictionary> InitMcInstanceLi catch (Exception ex) { results.Clear(); - ModBase.Log(ex, "分类实例列表失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Instance.Error.Classify"), ModBase.LogLevel.Feedback); } #endregion @@ -2461,7 +2461,7 @@ public static McSkinInfo McSkinSelect() } catch (Exception ex) { - ModBase.Log(ex, "皮肤文件存在错误", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Skin.File.Error"), ModBase.LogLevel.Hint); return new McSkinInfo { IsVaild = false }; } diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs index 24d50946c..d8e746a20 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModProfile.cs @@ -359,7 +359,7 @@ public static void GetProfile() { } - ModBase.Log(ex, "档案数据读取失败,文件可能意外损坏。已对档案文件进行备份重置。", ModBase.LogLevel.Msgbox); + ModBase.Log(ex, Lang.Text("Launch.Account.Profile.Error.Corrupted"), ModBase.LogLevel.Msgbox); } } @@ -428,7 +428,7 @@ public static void SaveProfile(JArray listJson = null) } catch (Exception ex) { - ModBase.Log(ex, "写入档案列表失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Launch.Account.Profile.Error.Write"), ModBase.LogLevel.Feedback); } } @@ -579,7 +579,7 @@ public static void EditProfileId() if (exSummary.Contains("403")) ModMain.MyMsgBox(Lang.Text("Launch.Account.Profile.EditPlayerId.Cooldown"), Lang.Text("Launch.Account.Profile.EditPlayerId.Failed.Title"), Lang.Text("Common.Action.Confirm")); else - ModBase.Log(ex, "修改档案 ID 失败", ModBase.LogLevel.Msgbox); + ModBase.Log(ex, Lang.Text("Launch.Account.Profile.Error.ChangeId"), ModBase.LogLevel.Msgbox); } }); } @@ -1187,7 +1187,7 @@ public static void ChangeSkinMs() if (ex.GetType().Equals(typeof(TaskCanceledException))) ModMain.Hint("更改皮肤失败:与 Mojang 皮肤服务器的连接超时,请检查你的网络是否通畅!", ModMain.HintType.Critical); else - ModBase.Log(ex, "更改皮肤失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Account.Profile.Error.ChangeSkin"), ModBase.LogLevel.Hint); } finally { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs index 034edf3b9..64c77c93b 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/MyMsgLogin.xaml.cs @@ -138,7 +138,7 @@ public MyMsgLogin(ModMain.MyMsgBoxConverter Converter) } catch (Exception ex) { - ModBase.Log(ex, "正版验证弹窗初始化失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Account.LoginDialog.Error.Init"), ModBase.LogLevel.Hint); } Loaded += Load; @@ -171,7 +171,7 @@ private void Load(object sender, EventArgs e) } catch (Exception ex) { - ModBase.Log(ex, "正版验证弹窗加载失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Account.LoginDialog.Error.Load"), ModBase.LogLevel.Hint); } } diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs index 06e0add68..3f0c37e48 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/MySkin.xaml.cs @@ -131,7 +131,7 @@ public static void Save(ModLoader.LoaderTask, stri } catch (Exception ex) { - ModBase.Log(ex, "保存皮肤失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Skin.Save.Error"), ModBase.LogLevel.Hint); } } @@ -161,7 +161,7 @@ public void Load() } catch (Exception ex) // #2272 { - ModBase.Log(ex, $"皮肤文件已损坏:{Address}", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Skin.Load.Error.Corrupted", Address), ModBase.LogLevel.Hint); File.Delete(Address); return; } @@ -235,7 +235,7 @@ public void Load() } catch (Exception ex) { - ModBase.Log(ex, "载入头像失败(" + (Address ?? "null") + "," + Loader.Name + ")", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Skin.Load.Error.Avatar", (Address ?? "null") + "," + Loader.Name), ModBase.LogLevel.Hint); } } @@ -301,7 +301,7 @@ public static void RefreshCache(ModLoader.LoaderTask Task) } catch (Exception ex) { - ModBase.Log(ex, $"下载主页失败({Address})", ModBase.ModeDebug ? ModBase.LogLevel.Msgbox : ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Homepage.Error.Download", Address), ModBase.ModeDebug ? ModBase.LogLevel.Msgbox : ModBase.LogLevel.Hint); } } @@ -438,7 +438,7 @@ ex is UnauthorizedAccessException } else { - ModBase.Log(ex, "加载主页界面失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Launch.Homepage.LoadFailed.Title"), ModBase.LogLevel.Hint); } return; diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs index d0eef9d12..513086708 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLoginProfile.xaml.cs @@ -49,7 +49,7 @@ public void RefreshProfileList() } catch (Exception ex) { - ModBase.Log(ex, "读取档案列表失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Launch.Account.Profile.Error.Read"), ModBase.LogLevel.Feedback); } if (!ModProfile.ProfileList.Any()) diff --git a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs b/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs index e1c980b79..a9731e6f5 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageSelectLeft.xaml.cs @@ -390,7 +390,7 @@ private void Add_Click() } catch (Exception ex) { - ModBase.Log(ex, $"添加文件夹失败({NewFolder})", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.Add", NewFolder), ModBase.LogLevel.Feedback); } } @@ -478,7 +478,7 @@ public static void AddFolder(string FolderPath, string DisplayName, bool ShowHin } catch (Exception ex) { - ModBase.Log(ex, "向文件夹列表中添加新文件夹失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.AddNew"), ModBase.LogLevel.Feedback); } }); // 加上斜杠…… } @@ -569,7 +569,7 @@ public void Remove_Click(object sender, RoutedEventArgs e) catch (Exception ex) { - ModBase.Log(ex, "从列表中移除游戏文件夹失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.Remove"), ModBase.LogLevel.Feedback); } } @@ -627,7 +627,7 @@ folder.Type is ModMinecraft.McFolder.Types.Original or ModMinecraft.McFolder.Typ } catch (Exception ex) { - ModBase.Log(ex, $"{deleteText}文件夹 {folder.Name} 失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.Operate", deleteText, folder.Name), ModBase.LogLevel.Hint); } finally { @@ -706,7 +706,7 @@ public void Rename_Click(object sender, RoutedEventArgs e) } catch (Exception ex) { - ModBase.Log(ex, "重命名文件夹失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.Rename"), ModBase.LogLevel.Feedback); } } @@ -877,7 +877,7 @@ private void Item_Drop(object sender, DragEventArgs e) catch (Exception ex) { - ModBase.Log(ex, "拖拽放下操作失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Folder.Error.DragDrop"), ModBase.LogLevel.Feedback); } finally { diff --git a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs index 03cbb4018..06a9c6763 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs @@ -367,7 +367,7 @@ void PutMethod(StackPanel Stack) catch (Exception ex) { - ModBase.Log(ex, "将实例列表转换显示时失败", ModBase.LogLevel.Feedback); + ModBase.Log(ex, Lang.Text("Select.Instance.Error.UiUpdate"), ModBase.LogLevel.Feedback); } } @@ -406,7 +406,7 @@ public static MyListItem McVersionListItem(ModMinecraft.McInstance instance) } catch (Exception ex) { - ModBase.Log(ex, "加载实例图标失败", ModBase.LogLevel.Hint); + ModBase.Log(ex, Lang.Text("Select.Instance.Error.IconLoad"), ModBase.LogLevel.Hint); NewItem.Logo = "pack://application:,,,/images/Blocks/RedstoneBlock.png"; } @@ -595,7 +595,7 @@ public static void DeleteVersion(MyListItem item, ModMinecraft.McInstance instan } catch (Exception ex) { - ModBase.Log(ex, $"删除实例 {instance.Name} 失败", ModBase.LogLevel.Msgbox); + ModBase.Log(ex, Lang.Text("Select.Instance.Error.Delete", instance.Name), ModBase.LogLevel.Msgbox); } } From 5a09afb6aa550a0484de7afe901151e53fed6e79 Mon Sep 17 00:00:00 2001 From: ClovenBugle Date: Fri, 22 May 2026 09:22:20 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=B6=A6=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Localization/Languages/en-US.xaml | 475 +++++++++--------- .../App/Localization/Languages/zh-CN.xaml | 15 +- .../Modules/Minecraft/ModLaunch.cs | 2 +- .../Modules/Minecraft/ModMinecraft.cs | 2 +- .../Pages/PageLaunch/PageLaunchLeft.xaml | 2 +- .../Pages/PageSelectRight.xaml.cs | 17 +- 6 files changed, 258 insertions(+), 255 deletions(-) diff --git a/PCL.Core/App/Localization/Languages/en-US.xaml b/PCL.Core/App/Localization/Languages/en-US.xaml index 800bff98b..de6187565 100644 --- a/PCL.Core/App/Localization/Languages/en-US.xaml +++ b/PCL.Core/App/Localization/Languages/en-US.xaml @@ -30,6 +30,7 @@ Default Auto Customize + I don't know Do not show again {0} ago in {0} @@ -742,25 +743,25 @@ Loading Launch Download - Loading version list, please wait + Getting version list... Loading, please wait - No available game instance + No instance available The current instance is being installed and cannot be launched! The current instance is being installed and cannot be configured! - Launching + Launching... Game launched Exporting launch script Completed Current step - Download support + Download libraries Login method Microsoft login Progress - Download speed + Speed Trivia - This is a test hint text, it should be long enough to have two lines. + This is a test trivia text that should be long enough to span two lines. Offline @@ -771,16 +772,16 @@ Community Edition notice You are using PCL Community Edition! This version is independently developed and maintained, and differs from the official version in its development path and user experience. If you downloaded the Community Edition by accident, we strongly recommend downloading the official PCL version for long-term use, as this distribution may not be user-friendly for newcomers. Additionally, please submit Community Edition issues to the Community Edition repository, and do not report Community Edition issues to the official repository! To permanently hide this notice, enter the correct PCL CE development organization name. - Enter PCL CE development organization name + Enter the PCL CE development organization name Not quite right... Launch log Loading homepage... Failed to load homepage - The homepage content is malformed. Check the following error information: {0} + The homepage content is malformed. Please check the following error information: {0} Retry - The homepage is loading too slowly (took {0} seconds). Please report this issue to the homepage author, or temporarily stop using this homepage. + The homepage is loading too slowly ({0} seconds). Please report this issue to the homepage author, or temporarily stop using this homepage. The Echo Cave preset has been removed as it only had a shell. Please go to Settings and select another homepage preset. @@ -788,109 +789,109 @@ View details Loading... - Failed to download homepage ({0}) - Failed to read external file: {0} + Failed to download homepage. ({0}) + Failed to read external file. ({0}) - Test Title Text + Test title text Reopen webpage Copy code Login to Minecraft - The login page will open automatically. Enter the authorization code {0} (will be automatically copied). If you have network issues and the page fails to load, please use a VPN and try again. You can also open {1} on another device and enter the authorization code above. - The login page will open automatically, and the authorization code will be auto-filled. If you have network issues and the page fails to load, please use a VPN and try again. If the code is not auto-filled, paste this authorization code {0} (will be automatically copied) into the page. You can also open {1} on another device and enter the authorization code. + The login page will open automatically. Enter the authorization code {0} (it will be copied automatically). If you have network issues and the page fails to load, please try again. You can also open {1} on another device and enter the code manually. + The login page will open automatically, and the authorization code will be filled in automatically. If you have network issues and the page fails to load, please try again. If the code is not filled in automatically, paste this authorization code {0} manually (it will be copied automatically). You can also open {1} on another device and enter the code manually. Successfully logged in through the webpage! - Microsoft verification polling failed - Microsoft login dialog initialization failed - Microsoft login dialog loading failed + Microsoft login polling failed + Failed to initialize Microsoft login dialog + Failed to load Microsoft login dialog - Verify + Login » Purchase » Website « Back Login - Login cancelled! - Microsoft login verification failed. Try disabling [Verify SSL certificate for Microsoft login] in [Settings → Miscellaneous], then try again. Raw error message: - Microsoft login failed + Login canceled! + Microsoft login authentication failed. Please consider disabling the "Verify SSL certificates for Microsoft login" option in "Settings → Miscellaneous" and try again. Original error message: + Microsoft login authentication failed Unknown error! - Auth server: {0} + Authentication server: {0} Switch profile Log out - Server + Authentication server Email Password - Register account + Register Forgot password Back Login - Auth server, username and password cannot be empty! - Invalid auth server address - Login cancelled! + Authentication server, username, and password cannot be empty! + The authentication server address is invalid. + Login canceled! Preset - LittleSkin - Third-party login failed + Third-party login failed. - ID - 3 - 16 characters, only letters, numbers and underscores + Username + 3 - 16 characters, letters, numbers, and underscores only UUID standard Standard - [Recommended] The generated UUID is consistent with other software such as HMCL, BakaXL and Bukkit + [Recommended] The generated UUID is consistent with other launchers such as HMCL, BakaXL, and Bukkit. Legacy - Use legacy PCL UUID generation rules If upgrading from an older PCL version and some single-player save data is missing, try this option - For advanced users. If you don't know what this is, do not select this option - Must be a 32-character hex string without hyphens + Use legacy PCL UUID generation rules. If some single-player save data is missing after upgrading from an older PCL version, try this option. + For advanced users. If you do not know what this is, do not select this option. + Must be a 32-character hexadecimal string without hyphens Back Create - Invalid player ID - Your player ID does not meet the standard (3 - 16 characters, only letters, numbers and underscores), which may cause some game versions to fail to launch or encounter errors. It is strongly recommended to use a standard player ID! If you insist, you can still continue to create the profile. + Invalid username + Your username does not meet the standard (3 - 16 characters, letters, numbers, and underscores only), which may cause some game versions to fail to launch or encounter errors. It is strongly recommended to use a standard username! If you insist on using this username, you can continue. UUID does not meet requirements: {0} - Profile created successfully! + Profile created! - Select a profile to launch the game - Create and select a profile to launch the game - Create profile + Select a profile before launching the game + Create and select a profile before launching the game + New profile Import / Export Change UUID Copy UUID - Change auth server name + Change authentication server name Delete profile - Modify auth server name - Enter the new auth server name + Change authentication server name + Enter the new authentication server name. Confirm profile deletion You are about to delete this profile. This action cannot be undone. Are you sure you want to continue? - Create profile - Select auth type + New profile - Select login type - Enter new player ID - Player ID can only be changed once every 30 days. Please consider carefully! - 3 - 16 characters, only letters, numbers and underscores - The player name to set is empty + Enter a new username + The username can only be changed once every 30 days. Please consider carefully! + 3 - 16 characters, letters, numbers, and underscores only + The username cannot be empty. Confirm change - Note: Player ID can only be changed once every 30 days. Please consider carefully! - ID change failed - This ID is already in use. Please choose a different one. - This ID contains invalid characters other than letters, numbers and underscores. - Player ID changed successfully. Current ID: {0} - After changing your ID for the first time, you must wait 30 days before changing it again. You can check the exact date on the official website. + Note: Username can only be changed once every 30 days. Please consider carefully! + Failed to change username + This username is already in use. Please choose a different one. + This username contains invalid characters other than letters, numbers and underscores. + Username changed successfully. Current username: {0} + After changing your username for the first time, you must wait 30 days before changing it again. You can check the exact date on the official website. - Create profile - Select UUID type + New profile - Select UUID type Standard UUID (recommended) Legacy PCL UUID (if single-player save data is missing, try this option) Change UUID for profile {0} 32 characters, no hyphens UUID should only contain letters and numbers! Profile saved! - Profile deleted successfully! - Failed to read profile list - Profile data read failed, the file may be corrupted. The profile file has been backed up and reset. - Failed to write profile list - Failed to modify profile ID + Profile deleted! + Failed to read profile list. + Failed to read profile data. The file may be corrupted; the profile file has been backed up and reset. + Failed to write profile list. + Failed to change username. Failed to change skin @@ -905,22 +906,22 @@ No new profiles to import. Successfully imported {0} profile(s)! Exporting to HMCL... - Successfully synced {0} profile(s). + Successfully synchronized {0} profile(s). Import error. Please check the file format. Export failed. - Profiles have been automatically migrated from legacy configuration files, total {0} profile(s) migrated + {0} profile(s) have been automatically migrated from legacy configuration files. - Player name cannot be empty! - Player name cannot contain double quotes! - Since 1.20.3, player names can have at most 16 characters! - Unknown auth type + Username cannot be empty! + Username cannot contain quotation marks! + Starting from version 1.20.3, usernames can contain a maximum of 16 characters! + Unknown login type. Skins and capes Change skin Save skin - Refresh skin + Refresh Change cape Edit profile Edit password @@ -929,7 +930,7 @@ This profile does not support changing the password! This profile does not support changing the skin! This profile does not support changing the cape! - Failed to switch login page ({0}) + Failed to switch login page. ({0}) Back @@ -938,25 +939,25 @@ Save as Change cape - Click to change skin (right click for more options) - Skin is being fetched, please wait! - Choose location to save skin - Skin Image Files (*.png)|*.png + Click to change (right-click for more options) + Obtaining the skin, please wait! + Select a location to save the skin file. + Skin image file (*.png)|*.png Skin saved successfully! - There is a skin being fetched, please try again later! - Refreshing avatar... - Avatar refreshed! + Still obtaining the skin, please try again later! + Updating avatar... + The avatar has been refreshed! Skin changed successfully! Changing cape, please wait! - Login failed, unable to change cape! - Fetching cape list, please wait... - No Cape - Select Cape - Cape change failed - Cape change failed: {0} - Cape changed successfully! It will take effect after a while... + Failed to login, and the cape cannot be changed! + Getting the list of capes, please wait... + None + Choose a cape + Failed to change the cape. + Failed to change the cape: {0} + Cape changed successfully! Migrator @@ -966,11 +967,11 @@ Translator Cobalt Vanilla - Minecon 2011 Attendee - Minecon 2012 Attendee - Minecon 2013 Attendee - Minecon 2015 Attendee - Minecon 2016 Attendee + MINECON 2011 + MINECON 2012 + MINECON 2013 + MINECON 2015 + MINECON 2016 Cherry Blossom 15th Anniversary Purple Heart @@ -983,31 +984,30 @@ Yearn Common Pan - Founder's + Founders Copper Zombie Horse - Skin Files (*.png;*.jpg;*.webp)|*.png;*.jpg;*.webp + Skin file (*.png;*.jpg;*.webp)|*.png;*.jpg;*.webp Select skin file - Skin image must be 64x32 or 64x64 pixels! - Skin file must be smaller than 24 KB, the selected file is {0} KB - Select skin model - Is this skin Steve model (wide arms) or Alex model (slim arms)? + The skin image should be 64x32 pixels or 64x64 pixels! + The skin file must be smaller than 24 KB. The selected file is {0} KB. + Skin model + Is this skin the Steve model (wide arms) or the Alex model (slim arms)? Steve model Alex model - I do not know Please confirm the skin model on the skin download page before using this skin! - Failed to save skin - Skin file corrupted: {0} + Failed to save the skin file. + Skin file is corrupted: {0} Failed to load avatar: {0} - Failed to refresh skin cache - Failed to refresh skin after changing Microsoft skin - Failed to get player cape list - Skin file has errors - Skin fetch rate limited, please try again in 5 minutes ({0}) - Failed to get Microsoft skin ({0}) - Failed to get Authlib-Injector skin ({0}) + Failed to refresh skin cache. + Failed to refresh the Microsoft skin after changing it. + Failed to get player cape list. + Skin file error + Skin fetch has been rate-limited. Please try again in 5 minutes. ({0}) + Failed to get Microsoft skin. ({0}) + Failed to get Authlib-Injector skin. ({0}) Folder list @@ -1015,70 +1015,70 @@ Move up Move down Clear - Restore Name + Restore name Remove from list - Add or Import - Create .minecraft Folder - Create a new .minecraft folder in the PCL directory - Add Existing Folder - Add an existing Minecraft folder to the list - Import Modpack - Install a modpack into the currently selected Minecraft folder - Cannot add game folder while a download is in progress! - Minecraft folder path cannot contain exclamation marks or semicolons! - Enter Display Name - Enter the display name for this folder in the sidebar list. + Add or import + Create a new folder + Create a new ".minecraft" folder at the location of PCL. + Add an existing folder + Add an existing Minecraft folder to the list. + Import a modpack + Install the modpack in the selected Minecraft folder. + The game folder cannot be added while the download task is in progress! + Minecraft folder paths cannot contain exclamation marks (!) or semicolons (;)! + Enter a display name + Enter the name of the folder that shows on the list on the left column. Failed to add folder: PCL does not have permission to access this folder! - This folder is already in the list! - Folder name updated to {0}! - Folder {0} added! - Cannot create game folder while a download is in progress! - .minecraft folder created successfully! - Config Cleanup - Do you want to clean up PCL's configuration files in this folder? This includes per-instance settings (such as custom icons, third-party login configs) and does not affect the game itself. + This folder already exists on the list! + The folder has been renamed to {0}! + The folder {0} has been added! + The game folder cannot be created while the download task is in progress! + Create a new ".minecraft" folder successfully! + Profile clean-up + Do you want to clean up the PCL config files in this folder? This includes settings for each instance (such as custom icons, third-party login options, etc.). It has no effect on the instance itself. Keep - Folder {0} has been removed from the list! - Folder name restored! - Delete Warning - Confirm Delete - Are you sure you want to delete this folder? Target folder: {0} All saves and other files in this folder will be permanently lost and cannot be recovered! - If you have stored files other than Minecraft in this folder, they will also be deleted! Continuing will cause all files in this folder to be permanently lost. Please double-check before proceeding! Target folder: {0} This is the final warning! + The folder {0} has been removed from the list! + The folder name has been restored! + Deletion warning + Delete + Are you sure you want to delete this folder? Target folder: {0} All saves and other files in this folder will be permanently lost and unrecoverable! + Non-Minecraft files stored in the folder will also be deleted! Continuing the deletion will cause all files in this folder to be permanently lost. Please confirm carefully before continuing! Target folder: {0} This is the last warning! Deleting folder {0}... - Folder {0} deleted! - Confirm Clear - Are you sure you want to clear this folder? Target folder: {0} All saves and other files in this folder will be permanently lost and cannot be recovered! - If you have stored files other than Minecraft in this folder, they will also be cleared! Continuing will cause all files in this folder to be permanently lost. Please double-check before proceeding! Target folder: {0} This is the final warning! + The folder {0} has been deleted! + Clear + Are you sure you want to clear this folder? Target folder: {0} All saves and other files in this folder will be permanently lost and unrecoverable! + Non-Minecraft files stored in the folder will also be cleared! Continuing will cause all files in this folder to be permanently lost. Please confirm carefully before continuing! Target folder: {0} This is the last warning! Clearing folder {0}... - Folder {0} cleared! - Enter new name - Cannot switch game folder while a download is in progress! + The folder {0} has been cleared! + Enter a new name + The game folder cannot be switched while the download task is in progress! - Current Folder - Official Launcher Folder + Current folder + Official launcher folder Invalid Minecraft folder: {0} - Minecraft folder is invalid - Minecraft Folder Unavailable - Failed to load Minecraft folder list - Folder drag-and-drop sort failed - Auto-install modpack failed: {0} - Failed to add folder ({0}) - Failed to add new folder to list - Failed to remove game folder from list - Failed to rename folder - Failed to {0} folder {1} - Failed to clean up leftover ignored items ({0}) + Invalid Minecraft folder + Minecraft folder unavailable + Failed to load Minecraft folder list. + Failed to sort folders by drag-and-drop. + Failed to install the modpack automatically: {0} + Failed to add folder. ({0}) + Failed to add a new folder to the folder list. + Failed to remove game folder from list. + Failed to rename the folder. + Failed to {0} folder {1}. + Failed to clean up leftover ignored items. ({0}) Search game instances - Enter instance name or [game version] [mod loader] to search - No Instances Available - No game instances found. Please download a game instance first. If you have existing instances, select "Add Folder" in the left sidebar and import the .minecraft folder. + Enter instance name or [game version] [mod loader] to search. + No instances available + No instances found. Please download an instance in any game version first. If there is an existing instance, click "Add an existing folder" on the list on the left, and select the ".minecraft" folder to import it. Download - No Matches - Fetching instance list + No matching instances + Getting instance list... Regular - Moddable + Mod-installable Forge NeoForge Cleanroom @@ -1091,81 +1091,81 @@ Less-used Favorites April Fools' - No Hidden Instances - No instances are hidden. You can hide instances in the instance category settings. Press F11 again to exit hidden instance viewing mode. - No Matching Hidden Instances - Please enter a search query - No hidden instances matching '{0}' found - No instances matching '{0}' found + No hidden instances + No instances are hidden. You can select "Hidden from list" in "Properties → Personalization → Category" to hide the instance. Press "F11" again to exit the hidden instance viewing mode. + No matching hidden instances + Please enter search content. + No hidden instances matching "{0}" were found. + No instances matching "{0}" were found. Favorite Unfavorite - Open Instance Folder - Settings - Confirm Instance Deletion - permanently - Are you sure you want to {0}delete instance {1}? - Since version isolation is enabled for this instance, saves, resource packs, mods, and other files will also be deleted! - Instance {0} has been permanently deleted! - Instance {0} has been moved to the recycle bin! + Folder + Properties + Instance deletion + Are you sure you want to delete the instance {0}? + Are you sure you want to permanently delete the instance {0}? + Since the instance isolation is enabled for this instance, the corresponding saves, resource packs, mods, and other files of this instance will also be deleted! + The instance {0} has been permanently deleted! + The instance {0} has been moved to the recycle bin! - This instance has not been loaded. Please report this issue to the author. - PCL cannot recognize the MC version number of this version - Instance {0} not found + This instance has not been loaded. Please report this issue to the developers. + PCL cannot recognize the Minecraft version number of this version. + Instance {0} not found. PCL does not have permission to access this folder. Please run PCL as administrator. - Requires {0} to be installed as a parent instance + {0} needs to be installed as a parent instance. Unknown error Pre-release {0} Release candidate {0} - Experimental snapshot{0} + Experimental snapshot {0} Experimental snapshot Snapshot {0} Snapshot Release {0} Release - Old version + Before release April Fools' {0} - An unknown error has occurred. Please report this issue to the author. - Failed to load instance ({0}) - Failed to categorize instance list - Failed to load .minecraft instance list - Failed to load instance icon - Failed to render instance list UI - Failed to delete instance {0} - Failed to send Minecraft update notification ({0}) + An unknown error occurred. Please report this issue to the author. + Failed to load instance. ({0}) + Failed while converting the instance list to display. + Failed to load .minecraft instance list. + Failed to load instance icon. + Failed to render instance list UI. + Failed to delete the instance {0}. + Failed to send Minecraft update notification. ({0}) - Getting Java - Logging in - Completing files - Getting launch arguments - Extracting natives + Get Java + Login + Complete files + Get launch arguments + Extract natives Pre-launch processing - Running custom command - Starting process - Waiting for game window - Finishing up - Launching Minecraft + Execute custom command + Start process + Wait for appearance + End processing + Minecraft launch {0} launched successfully! - Launch cancelled! - Export script cancelled! + Launch canceled! + Exporting launch script canceled! Launch script exported successfully! - Launch Failed - Export Script Failed + Launch failed + Failed to export launch script Invalid state change: {0} A game is already launching! Cannot launch Minecraft: {0} - No Java available, launch cancelled! + No Java available, launch canceled! OptiFine may be incompatible with auto-join server, potentially causing missing textures or even game crashes! - Unable to connect to third-party login server ({0}). + Unable to connect to third-party login server. ({0}) Unable to connect to third-party login server ({0}). Details: - Missing "mainClass" in version JSON! + Missing "mainClass" in version JSON! Unable to open the Natives file ({0}), the file may be corrupted. Please try relaunching the game. Failed to cancel launch and terminate process Failed to refresh launch info @@ -1176,88 +1176,87 @@ Game path cannot contain ! or ; ({0}) - Game Path Check + Game path check The path of instance "{0}" contains characters that may affect the game (non-ASCII characters). Do you still want to launch? If you are unsure, you can choose "Continue" first, and try modifying the game path if the game crashes shortly after launch. Continue - Go Back + Back No Minecraft instance selected! - Minecraft problem: {0} + Minecraft has a problem: {0} Please select a profile before launching! This instance requires Microsoft login. Please use a Microsoft login profile! This instance requires third-party login. Please use a third-party login profile! - The third-party login server used by this profile does not match the instance requirement. Please use a matching profile! + The third-party login server used by the current profile does not match the one required by this instance. Please use a matching profile! This instance requires Microsoft or third-party login. Please use a matching profile! - It looks like you haven't purchased the game... If you think Minecraft is good, consider purchasing it to support the developers... Don't keep freeloading. This prompt will no longer appear after you verify a genuine account! - Purchase the Game? + It looks like you haven't purchased the game... If you think Minecraft is good, consider purchasing it to support the developers... Don't keep freeloading. This prompt will no longer appear after you verify a valid Microsoft account! + Purchase the game? Purchase! Nah, maybe next time You must log in with a Microsoft account to launch the game! - Microsoft Login + Microsoft login Purchase Demo Back The game will launch in demo mode! - PCL has launched {0} games for you! If PCL has been useful, maybe consider supporting the original PCL author... Without everyone's support, it's hard for PCL to maintain updates for years while staying free and ad-free! + PCL has launched the game {0} times for you! If PCL has been useful, maybe consider supporting the original PCL author... Without everyone's support, it's hard for PCL to maintain updates for years while staying free and ad-free! {0} launches! Support! - I refuse + Pardon my rejection - Password Required + Password required During login, please select {0}Other Sign-in Methods{1}, then select {0}Use My Password{1}. If this option is not available, please select {0}Set Password{1}, then log in after setting it up. - Re-login - Set Password - Account Info Refresh Failed + Relogin + Set password + Failed to refresh account information The launcher encountered a network error while trying to refresh account information. You can cancel, check your network, and try again, or ignore the error and continue launching, but some servers may not be playable. This account appears to be banned by Microsoft and cannot log in. - You have not registered an Xbox account. Please register first and then log in. - The country or region of your network cannot log in to a Microsoft account. Please use an accelerator or VPN. + You have not registered an Xbox account. Please register one first and then log in. + The country or region of your network cannot log in to Microsoft accounts. Please use an accelerator or VPN. The account is underage. You need to modify the date of birth before logging in. Is the age currently set on this account over 13? - Over 13 - Under 13 - I don't know + 13 or older + 12 or younger Please modify the account's date of birth on the opened webpage (change to at least 18 years old). Wait one minute after the modification is successful, then return to PCL and you can log in normally! Please modify the account's date of birth on the opened webpage (change to at least 18 years old). Wait one minute after the modification is successful, then return to PCL and you can log in normally! - $Too many login attempts, please wait a few minutes and try again! - $Abnormal login attempts from this IP. If you are using a VPN or accelerator, please turn it off or switch nodes and try again! - Unable to get account information. This account may not have purchased Minecraft Java Edition, or the Xbox Game Pass may have expired. + Too many login attempts. Please wait a few minutes and try again! + Abnormal login attempts from this IP. If you are using a VPN or proxy, please turn it off or switch nodes and try again! + Unable to get account information. This account may not have purchased Minecraft: Java Edition, or its Xbox Game Pass may have expired. Purchase Minecraft Please create a Minecraft player profile first, then log in again. - Create Profile + Create profile You have already added this profile... Continue - I Understand - Login Failed + I see + Login failed Register - Login Hint - Failed to get login input info + Login hint + Failed to get login input information. Login refresh failed - Third-party Login Failed + Third-party login failed Second login refresh failed - Login failed: Connection to login server timed out. Please check your network connection or try using a VPN! - $Login failed: Connection to login server timed out. Please check your network connection or try using a VPN! Details: + Login failed: Connection to login server timed out. Please check your network connection! + $Login failed: Connection to login server timed out. Please check your network connection! Details: Third-party login failed. Please check your network connection. Selected profile {0} is invalid! - You have not created a profile, unable to switch! - $You have not created a profile, please create one first! - You only have one profile in this account, unable to switch! - Select Profile + You have not created a profile, so you cannot switch profiles! + $You have not created a profile. Please create one first! + There is only one profile in your account, so you cannot switch profiles! + Select profile Login failed: {0} Details: - Java Not Found - Please search and install it manually - You need to install the LegacyJavaFixer mod, or install Java 7 to launch this version. Please search and install Java 7 manually, then re-search or import it in Settings → Launch Options → Game Java. - You need to install Java 7 to launch this version. Please search and install Java 7 manually, then re-search or import it in Settings → Launch Options → Game Java. - You need to install Java 8u141 ~ 8u320 to launch this version. Please search and install it manually, then re-search or import it in Settings → Launch Options → Game Java. - You need to install Java 8u141 or later to launch this version. Please search and install it manually, then re-search or import it in Settings → Launch Options → Game Java. + Java not found + Please search and install it manually. + You need to install the LegacyJavaFixer mod, or install Java 7 to launch this version. Please search and install Java 7 manually, then re-search or import it under "Settings → Launch options → Game Java". + You need to install Java 7 to launch this version. Please search and install Java 7 manually, then re-search or import it under "Settings → Launch options → Game Java". + You need to install Java 8u141 ~ 8u320 to launch this version. Please search and install it manually, then re-search or import it under "Settings → Launch options → Game Java". + You need to install Java 8u141 or later to launch this version. Please search and install it manually, then re-search or import it under "Settings → Launch options → Game Java". \ No newline at end of file diff --git a/PCL.Core/App/Localization/Languages/zh-CN.xaml b/PCL.Core/App/Localization/Languages/zh-CN.xaml index 8a83518de..fb91f96bb 100644 --- a/PCL.Core/App/Localization/Languages/zh-CN.xaml +++ b/PCL.Core/App/Localization/Languages/zh-CN.xaml @@ -28,6 +28,7 @@ 默认 自动 自定义 + 我不知道 不再提示 {0}前 {0}后 @@ -748,7 +749,7 @@ 正在导出启动脚本 已完成 当前步骤 - 下载支持 + 下载支持 验证方式 正版验证 启动进度 @@ -1000,7 +1001,6 @@ 此皮肤为 Steve 模型(粗手臂)还是 Alex 模型(细手臂)? Steve 模型 Alex 模型 - 我不知道 请在皮肤下载页面确认皮肤种类后再使用此皮肤! @@ -1097,14 +1097,14 @@ 打开实例目录 设置 实例删除确认 - 永久 - 你确定要{0}删除实例 {1} 吗? + 你确定要删除实例 {0} 吗? + 你确定要永久删除实例 {0} 吗? 由于该实例开启了版本隔离,删除时该实例对应的存档、资源包、Mod 等文件也将被一并删除! 实例 {0} 已永久删除! 实例 {0} 已删除到回收站! - 该实例未被加载,请向作者反馈此问题 + 该实例未被加载,请向开发者反馈此问题 PCL 无法识别该版本的 MC 版本号 未找到实例 {0} PCL 没有对该文件夹的访问权限,请右键以管理员身份运行 PCL @@ -1216,11 +1216,10 @@ 该账号年龄不足,你需要先修改出生日期,然后才能登录。 该账号目前填写的年龄是否在 13 岁以上? 13 岁以上 12 岁以下 - 我不知道 请在打开的网页中修改账号的出生日期(至少改为 18 岁以上)。 在修改成功后等待一分钟,然后再回到 PCL,就可以正常登录了! 请在打开的网页中修改账号的出生日期(至少改为 18 岁以上)。 在修改成功后等待一分钟,然后再回到 PCL,就可以正常登录了! - $登录尝试太过频繁,请等待几分钟后再试! - $当前 IP 的登录尝试异常。 如果你使用了 VPN 或加速器,请把它们关掉或更换节点后再试! + 登录尝试太过频繁,请等待几分钟后再试! + 当前 IP 的登录尝试异常。 如果你使用了 VPN 或加速器,请把它们关掉或更换节点后再试! 暂时无法获取到此账户信息,此账户可能没有购买 Minecraft Java Edition 或者账户的 Xbox Game Pass 已过期 购买 Minecraft 请先创建 Minecraft 玩家档案,然后再重新登录。 diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs index b3bc30f86..ff9e7c66b 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.cs @@ -1121,7 +1121,7 @@ private static string[] MsLoginStep3(string XBLToken) if (result.Contains("2148916238")) { if (ModMain.MyMsgBox(Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.Message"), - Lang.Text("Minecraft.Launch.Login.Hint"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.AgeOver13"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.AgeUnder13"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.Unknown")) == 1) + Lang.Text("Minecraft.Launch.Login.Hint"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.AgeOver13"), Lang.Text("Minecraft.Launch.Login.Microsoft.Underage.AgeUnder13"), Lang.Text("Common.Option.IDontKnow")) == 1) { ModBase.OpenWebsite("https://account.live.com/editprof.aspx"); ModMain.MyMsgBox( diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs index 65d277e1a..174f2e02e 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.cs @@ -2466,7 +2466,7 @@ public static McSkinInfo McSkinSelect() } // 获取皮肤种类 - var IsSlim = ModMain.MyMsgBox(Lang.Text("Launch.Skin.Model.SelectMessage"), Lang.Text("Launch.Skin.Model.SelectTitle"), Lang.Text("Launch.Skin.Model.Steve"), Lang.Text("Launch.Skin.Model.Alex"), Lang.Text("Launch.Skin.Model.Unknown"), + var IsSlim = ModMain.MyMsgBox(Lang.Text("Launch.Skin.Model.SelectMessage"), Lang.Text("Launch.Skin.Model.SelectTitle"), Lang.Text("Launch.Skin.Model.Steve"), Lang.Text("Launch.Skin.Model.Alex"), Lang.Text("Common.Option.IDontKnow"), HighLight: false); if (IsSlim == 3) { diff --git a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml index f5e6222d7..203df5dc2 100644 --- a/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml +++ b/Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml @@ -111,7 +111,7 @@ - diff --git a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs index 06a9c6763..2a2bde181 100644 --- a/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs +++ b/Plain Craft Launcher 2/Pages/PageSelectRight.xaml.cs @@ -526,10 +526,13 @@ public static void DeleteVersion(MyListItem item, ModMinecraft.McInstance instan var IsShiftPressed = Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift); var IsHintIndie = instance.State != ModMinecraft.McInstanceState.Error && (instance.PathIndie ?? "") != (ModMinecraft.McFolderSelected ?? ""); - var permanentText = IsShiftPressed ? Lang.Text("Select.Instance.Delete.Permanent") : ""; - var confirmMsg = Lang.Text("Select.Instance.Delete.ConfirmMessage", permanentText, instance.Name); - var confirmFullMsg = confirmMsg + (IsHintIndie ? "\r\n" + Lang.Text("Select.Instance.Delete.IsolatedWarning") : ""); - switch (ModMain.MyMsgBox(confirmFullMsg, Lang.Text("Select.Instance.Delete.ConfirmTitle"), Button2: Lang.Text("Common.Action.Cancel"), IsWarn: true)) + var confirmMsg = IsShiftPressed + ? Lang.Text("Select.Instance.Delete.ConfirmPermanentMessage", instance.Name) + : Lang.Text("Select.Instance.Delete.ConfirmMessage", instance.Name); + var confirmFullMsg = confirmMsg + + (IsHintIndie ? "\r\n" + Lang.Text("Select.Instance.Delete.IsolatedWarning") : ""); + switch (ModMain.MyMsgBox(confirmFullMsg, Lang.Text("Select.Instance.Delete.ConfirmTitle"), + Button2: Lang.Text("Common.Action.Cancel"), IsWarn: true)) { case 1: { @@ -539,13 +542,15 @@ public static void DeleteVersion(MyListItem item, ModMinecraft.McInstance instan if (IsShiftPressed) { ModBase.DeleteDirectory(instance.PathInstance); - ModMain.Hint(Lang.Text("Select.Instance.Delete.PermanentSuccess", instance.Name), ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Select.Instance.Delete.PermanentSuccess", instance.Name), + ModMain.HintType.Finish); } else { FileSystem.DeleteDirectory(instance.PathInstance, UIOption.AllDialogs, RecycleOption.SendToRecycleBin); - ModMain.Hint(Lang.Text("Select.Instance.Delete.RecycleBinSuccess", instance.Name), ModMain.HintType.Finish); + ModMain.Hint(Lang.Text("Select.Instance.Delete.RecycleBinSuccess", instance.Name), + ModMain.HintType.Finish); } break;