From 5fdea2e3e9907da810374268502b1b2b1e2526e0 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 18 Aug 2013 20:11:22 -0700 Subject: [PATCH] TextField validation localization: Translating the display name of the field as well on model validation error. --- src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs b/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs index 2a994f238..7d6668644 100644 --- a/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs @@ -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))); }