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