Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Support localizing [DisplayAttribute] via IStringLocalizer #3518

@NTaylorMullen

Description

@NTaylorMullen

Today we only localize validation based data annotations. We should expand this outside of the realm of validation (especially since you do a services.AddDataAnnotationsLocalization which says nothing about only adding validation based data annotations.

Having support like this would enable scenarios such as:

Model:

public class User
{
    [Display(Name = "Last Name")]
    public string LastName { get; set; }
}

Page

@model User
@addTagHelper *, Microsoft.AspNet.Mvc.TagHelpers

<label asp-for="LastName" /> <!-- Label would be localizable -->

This issue is for more than just [Display] but this data annotation is the one that showed itself during my sign off activities.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions