From 65a35f5bad79789dc253097a562860bb52314d64 Mon Sep 17 00:00:00 2001 From: Sunny Date: Mon, 23 Dec 2024 22:49:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=B8=A4=E5=A4=84?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Forms/UIEditForm.cs | 2 +- SunnyUI/Forms/UIInputForm.cs | 2 +- SunnyUI/Style/UBuiltInResources.cs | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SunnyUI/Forms/UIEditForm.cs b/SunnyUI/Forms/UIEditForm.cs index dffa12a0..1c3fe442 100644 --- a/SunnyUI/Forms/UIEditForm.cs +++ b/SunnyUI/Forms/UIEditForm.cs @@ -453,7 +453,7 @@ namespace Sunny.UI if (info.CheckEmpty && edit.Text.IsNullOrEmpty()) { - this.ShowWarningTip(edit, info.Text + "不能为空"); + this.ShowWarningTip(edit, info.Text + Environment.NewLine + UIStyles.CurrentResources.EditorCantEmpty); edit.Focus(); return false; } diff --git a/SunnyUI/Forms/UIInputForm.cs b/SunnyUI/Forms/UIInputForm.cs index 1309ab39..012d2874 100644 --- a/SunnyUI/Forms/UIInputForm.cs +++ b/SunnyUI/Forms/UIInputForm.cs @@ -51,7 +51,7 @@ namespace Sunny.UI if (CheckInputEmpty) { bool result = edit.Text.IsValid(); - if (!result) this.ShowWarningDialog("编辑框内容不能为空。"); + if (!result) this.ShowWarningDialog(UIStyles.CurrentResources.EditorCantEmpty); return result; } diff --git a/SunnyUI/Style/UBuiltInResources.cs b/SunnyUI/Style/UBuiltInResources.cs index f07acb79..988d2181 100644 --- a/SunnyUI/Style/UBuiltInResources.cs +++ b/SunnyUI/Style/UBuiltInResources.cs @@ -75,6 +75,7 @@ namespace Sunny.UI public override string Open { get; set; } = "Open"; public override string Save { get; set; } = "Save"; public override string All { get; set; } = "All"; + public override string EditorCantEmpty { get; set; } = "The editor content cannot be empty."; } /// @@ -288,5 +289,7 @@ namespace Sunny.UI public virtual string Save { get; set; } = "保存"; public virtual string All { get; set; } = "全部"; + + public virtual string EditorCantEmpty { get; set; } = "编辑框内容不能为空。"; } } \ No newline at end of file