{"action":"reopened","issue":{"url":"https://api.github.com/repos/aspnet/Localization/issues/271","repository_url":"https://api.github.com/repos/aspnet/Localization","labels_url":"https://api.github.com/repos/aspnet/Localization/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Localization/issues/271/comments","events_url":"https://api.github.com/repos/aspnet/Localization/issues/271/events","html_url":"https://github.com/aspnet/Localization/issues/271","id":169118922,"number":271,"title":"Localization for default (entityframework) validators","user":{"login":"stefanhendriks","id":1332066,"avatar_url":"https://avatars.githubusercontent.com/u/1332066?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanhendriks","html_url":"https://github.com/stefanhendriks","followers_url":"https://api.github.com/users/stefanhendriks/followers","following_url":"https://api.github.com/users/stefanhendriks/following{/other_user}","gists_url":"https://api.github.com/users/stefanhendriks/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanhendriks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanhendriks/subscriptions","organizations_url":"https://api.github.com/users/stefanhendriks/orgs","repos_url":"https://api.github.com/users/stefanhendriks/repos","events_url":"https://api.github.com/users/stefanhendriks/events{/privacy}","received_events_url":"https://api.github.com/users/stefanhendriks/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Localization/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aspnet/Localization/milestones/10","html_url":"https://github.com/aspnet/Localization/milestones/Discussions","labels_url":"https://api.github.com/repos/aspnet/Localization/milestones/10/labels","id":1921451,"number":10,"title":"Discussions","description":null,"creator":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-08-03T17:04:54Z","updated_at":"2016-08-03T20:17:17Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-08-03T12:25:18Z","updated_at":"2016-08-03T20:17:17Z","closed_at":null,"body":"At the moment I have a working situation for localizing my custom (and default) attributes.\r\n\r\nIn general I do it like this:\r\n```\r\n[OnlyValidCharacters] // my own validator\r\n[MaxLength(40, ErrorMessageResourceName = \"MaxLength\", ErrorMessageResourceType = typeof(MyProject))]\r\npublic string LastName { get; set; }\r\n```\r\n\r\n```\r\n// my custom validator sets ErrorMessage like so (in its constructor)\r\npublic static readonly string InvalidCharacters = @\"<>!@#$%^&*()\";\r\n...\r\nErrorMessage = string.Format(MyProject.FormInvalidCharacters, InvalidCharacters);\r\n```\r\nI have a `myproject.en.resx` and a `myproject.resx` file (with an equivalent `MyProject.Designer.cs` file. \r\n\r\nHowever, I feel that for the default validators (like `MaxLength`) it should be easier to override their default translation.\r\n\r\nI would expect my code to be like this:\r\n```\r\n[OnlyValidCharacters] // my own validator\r\n[MaxLength(40)] // do not use my own 'maxLength' thing but the default key 'MaxLengthAttribute_ValidationError'\r\npublic string LastName { get; set; }\r\n```\r\n\r\nAnd let the default key for validating being overridden in my project. (in this case, the key is `MaxLengthAttribute_ValidationError`).\r\n\r\nI found a `resources.resx` [file](https://github.com/aspnet/EntityFramework6/blob/602bc779baa598fecf6f1ad9b94d76e8d30a9c15/src/EntityFramework/Properties/Resources.resx#L995) in the EntityFramework project and I tried to override the key `MaxLengthAttribute_ValidationError`.\r\n\r\nI have tried to override this as following (non where successful):\r\n- add `MaxLengthAttribute_ValidationError` to my own resource file (`myproject.en.resx`)\r\n- create a file `resources.resx` in my project (root level), add MaxLengthAttribute_ValidationError` to override\r\n- tried also with filename `resource.resx` - since a few MVC 4/5 projects where referring to such a filenaming structure.\r\n\r\nNone of this seems to work.\r\n\r\nI feel this ought to be fairly easy to override. I can't seem to find anything using my google voodoo (neither on github, wiki's, asp.net documentation, etc). So perhaps anyone can enlight me?"}}
{"actor":{"display_login":"Eilon"}}