I'm having trouble declaring a resource in the Account.CS file. Here's my code:
[Required(ErrorMessageResourceName= typeof @DbRes.T("Account", "EmailAddress")]
[Required(ErrorMessageResourceName = (@DbRes.T("EmailAddress", "Account")))]
[DataType(DataType.EmailAddress)]
[Display(Name = DbRes.T("EmailAddress", "Account"))]
public string EmailAddress { get; set; }
You can definitely use Westwind.Globalization with MVC and on validation attributes. MVC validation relies on strongly typed resources and type mapping so in order to get this to work you have export strongly typed resources from your dbResource file. This will create a custom strongly typed class for each ResourceSet in your db resources.
A strongly typed resource class looks like this:
This is very similar to standard .Resx strongly typed classes, except that you can access various different kinds of resources using the same class (DbRes ResourceManager, dbRes ASP.NET ResourceProvider or plain Resx.
You can then reference the strongly typed resources the same way you would reference standard Resx strongly typed resources in your ASP.NET MVC model validation attributes:
There's an example in the sample project - open the Models folder to see the model and ModelAttributesFromResources.cshtml view that uses that view with localized values.
There's a topic on the wiki that describes this as well:
https://github.com/RickStrahl/Westwind.Globalization/wiki/Model-Validation-Message-for-ASP.NET-and-EntityFramework