mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
TextField validation localization: Translating the display name of the field as well on model validation error.
This commit is contained in:
@@ -67,7 +67,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
|
||||
if(updater.TryUpdateModel(viewModel, GetPrefix(field, part), null, null)) {
|
||||
if (viewModel.Settings.Required && string.IsNullOrWhiteSpace(viewModel.Text)) {
|
||||
updater.AddModelError("Text", T("The field {0} is mandatory", field.DisplayName));
|
||||
updater.AddModelError("Text", T("The field {0} is mandatory", T(field.DisplayName)));
|
||||
return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part),
|
||||
() => shapeHelper.EditorTemplate(TemplateName: "Fields.Common.Text.Edit", Model: viewModel, Prefix: GetPrefix(field, part)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user