I'd love a real answer to this question - in the meantime, here is my workaround.
Even though I have developed a Locale aware Required Attribute, I had to duplicate the functionality of this in my model (I have a custom resource provider that only delivers Global Resources so this doesn't work with the current MVC localisation scheme for attributes :-((( )
Using the localised message from my model I manually added the data-val attributes :-(((
Here is the editor template:
@model DropDownValues
@{
string initial = null;
if (Model != null && !string.IsNullOrWhiteSpace(Model.InitialValue))
{
initial = Model.InitialValue;
}
object attrributes;
}
@{if (Model != null && Model.Items != null && Model.Items.Count() > 0)
{
if (Model.Required)
{
attrributes = new
{
data_val_required = Model.RequiredValidationMessage,
data_val = "true"
};
}
else
{
attrributes = null;
}
@Html.DropDownListFor(x => x.SelectedValue,
new SelectList(Model.Items, "Value", "Text"), initial, attrributes)
}
}