1

Possible Duplicate:
Localization of DisplayNameAttribute

[Serializable]
public class Foo
{

    [DisplayName("??")]
    [Required]
    public string Name { get; set; }

}

What is the best solution for localising this property?

Community
  • 1
  • 1
MikeW
  • 4,659
  • 9
  • 39
  • 79
  • Take a look at [this question and answers](http://stackoverflow.com/questions/356464/localization-of-displaynameattribute) – Patryk Ćwiek Jun 11 '12 at 08:01

1 Answers1

1

You will have to use GlobalResources, check the example below

Resource1.resx

|Name|Name|

|....|....|

|....|....|

Resource1.da.DK

|Name|Navn|

|....|....|

|....|....|

    [Required(ErrorMessageResourceType = typeof(Resources.Resource1), ErrorMessageResourceName  = "Name")]
    public virtual string Name
    {
        get;
        set;
    }
Yasser Shaikh
  • 45,616
  • 44
  • 197
  • 276