{"action":"created","issue":{"url":"https://api.github.com/repos/warrenbuckley/Umbraco-Validation-Attributes/issues/30","labels_url":"https://api.github.com/repos/warrenbuckley/Umbraco-Validation-Attributes/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/warrenbuckley/Umbraco-Validation-Attributes/issues/30/comments","events_url":"https://api.github.com/repos/warrenbuckley/Umbraco-Validation-Attributes/issues/30/events","html_url":"https://github.com/warrenbuckley/Umbraco-Validation-Attributes/issues/30","id":111764333,"number":30,"title":"Validation messages are locked to the language the form is first loaded in","user":{"login":"dominiquerolin","id":1299736,"avatar_url":"https://avatars.githubusercontent.com/u/1299736?v=3","gravatar_id":"","url":"https://api.github.com/users/dominiquerolin","html_url":"https://github.com/dominiquerolin","followers_url":"https://api.github.com/users/dominiquerolin/followers","following_url":"https://api.github.com/users/dominiquerolin/following{/other_user}","gists_url":"https://api.github.com/users/dominiquerolin/gists{/gist_id}","starred_url":"https://api.github.com/users/dominiquerolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dominiquerolin/subscriptions","organizations_url":"https://api.github.com/users/dominiquerolin/orgs","repos_url":"https://api.github.com/users/dominiquerolin/repos","events_url":"https://api.github.com/users/dominiquerolin/events{/privacy}","received_events_url":"https://api.github.com/users/dominiquerolin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-16T05:44:13Z","updated_at":"2015-10-19T08:42:15Z","closed_at":null,"body":"I am working on a multi lingual website using Umbraco 7.2.4. I have a form for each language nested under home nodes with their own culture:\r\n* Home (language selection)\r\n    * nl-BE\r\n        * some page\r\n        * some other page\r\n        * my form page\r\n    * fr-BE\r\n        * some page\r\n        * some other page\r\n        * my form page\r\n\r\n### Steps to reproduce\r\n- land on nl-BE/form\r\n    - field labels are shown in dutch (nl-BE)\r\n- submit invalid form\r\n    - validation messages are shown in dutch (nl-BE culture)\r\n- browse to fr-BE/form\r\n    - field labels are shown in french (fr-BE)\r\n- submit invalid form\r\n    - Expected behavior is: validation messages are shown in french (fr-BE culture)\r\n    - Actual behavior is: messages are still shown in dutch (data-val-required attribute is in dutch in the source of the page)\r\n\r\nThis is not a browser cache issue, it is reproducible across separate browsers, even separate computers: whoever is generating the form for the first time will lock the validation message culture. The only way to change the language of the validation messages is to recycle the Application Pool.\r\n\r\nI doubt that your helper class is the issue here but I'm out of ideas, so any insight is appreciated. \r\n\r\n(update: I originally thought this issue was restricted to the javascript unobtrusive validation, but after testing with javascript disabled to hit the mvc validation directly I got the same issue.)\r\n\r\n### Source code\r\nModel\r\n```c#\r\n    public class MyFormViewModel : RenderModel\r\n    {\r\n        public class PersonalDetails\r\n        {\r\n            [UmbracoDisplayName(\"FORMS_FIRST_NAME\")]\r\n            [UmbracoRequired(\"FORMS_FIELD_REQUIRED_ERROR\")]\r\n            public String FirstName { get; set; }\r\n        }\r\n}\r\n```\r\n\r\nView\r\n```html\r\n    using (Html.BeginUmbracoForm<MyFormController>(\"SubmitMyForm\", null, new {id = \"my-form\"}))\r\n    { \r\n            <h3>@LanguageHelper.GetDictionaryItem(\"FORMS_HEADER_PERSONAL_DETAILS\")</h3>\r\n            <div class=\"field-wrapper\">\r\n                @Html.LabelFor(m => model.PersonalDetails.FirstName)\r\n                <div class=\"input-wrapper\">\r\n                    @Html.TextBoxFor(m => model.PersonalDetails.FirstName)\r\n                    @Html.ValidationMessageFor(m => model.PersonalDetails.FirstName)\r\n                </div>\r\n            </div>\r\n```\r\nnote: I have used the native MVC Html.BeginForm method as well, same results.\r\n\r\n\r\nController\r\n```c#\r\n    public ActionResult SubmitFranchiseApplication(FranchiseFormViewModel viewModel)\r\n        {\r\n            TempData[\"FormModel\"] = viewModel;\r\n            TempData[\"Success\"] = ModelState.IsValid;\r\n            if (!ModelState.IsValid)\r\n            {\r\n                TempData[\"Message\"] = LanguageHelper.GetDictionaryItem(\"FORMS_VALIDATION_FAILED_MESSAGE\");\r\n                foreach (ModelState modelState in ViewData.ModelState.Values)\r\n                {\r\n                    foreach (ModelError error in modelState.Errors)\r\n                    {\r\n                        TempData[\"Message\"] += \"<br/>\" + error.ErrorMessage;\r\n                    }\r\n                }\r\n\r\n                return RedirectToCurrentUmbracoPage();\r\n            }\r\n    }\r\n```\r\n\t\t\r\nLanguageHelper\r\n```c#\r\n    public class LanguageHelper\r\n    {\r\n        public static string CurrentCulture\r\n        {\r\n            get\r\n            {\r\n                return UmbracoContext.Current.PublishedContentRequest.Culture.ToString();\r\n                // I also tried using the thread culture\r\n                return System.Threading.Thread.CurrentThread.CurrentCulture.ToString(); \r\n            }\r\n        }\r\n        public static string GetDictionaryItem(string key)\r\n        {\r\n            var value = library.GetDictionaryItem(key);\r\n            return string.IsNullOrEmpty(value) ? key : value;\r\n        }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/warrenbuckley/Umbraco-Validation-Attributes/issues/comments/149147178","html_url":"https://github.com/warrenbuckley/Umbraco-Validation-Attributes/issues/30#issuecomment-149147178","issue_url":"https://api.github.com/repos/warrenbuckley/Umbraco-Validation-Attributes/issues/30","id":149147178,"user":{"login":"warrenbuckley","id":1389894,"avatar_url":"https://avatars.githubusercontent.com/u/1389894?v=3","gravatar_id":"","url":"https://api.github.com/users/warrenbuckley","html_url":"https://github.com/warrenbuckley","followers_url":"https://api.github.com/users/warrenbuckley/followers","following_url":"https://api.github.com/users/warrenbuckley/following{/other_user}","gists_url":"https://api.github.com/users/warrenbuckley/gists{/gist_id}","starred_url":"https://api.github.com/users/warrenbuckley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warrenbuckley/subscriptions","organizations_url":"https://api.github.com/users/warrenbuckley/orgs","repos_url":"https://api.github.com/users/warrenbuckley/repos","events_url":"https://api.github.com/users/warrenbuckley/events{/privacy}","received_events_url":"https://api.github.com/users/warrenbuckley/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T08:42:15Z","updated_at":"2015-10-19T08:42:15Z","body":"Hello @dominiquerolin \r\nIs this something that should be added back to the project as a Pull Request?"}}