Validation Error Messages for Internationalization
Posted: Tue 28 Feb 2017 16:12
Hi
I'm using Database First to create my model with the template 'DbContext'. I want to translate the Error Message provides by the context when i'm calling the 'GetValidationErrors()' (in EF6)
After research, I have seen that i could change messages return by this method in the template by changing the 'Validation Error Messages'. Unfortunately, I don't understand how it works. If i'm writing what I want in the field (for example : Required Message = 'hello') the hello error message is not returned by the method and it's always the 'hard coded error message'.
So can you show me an example on how to change this validation error message for another language ? I will make my program in Multi Language so could you please (if it's not too much) explain me an example for multi language.
Thanks for your helps,
Regards,
Pierre.
I'm using Database First to create my model with the template 'DbContext'. I want to translate the Error Message provides by the context when i'm calling the 'GetValidationErrors()' (in EF6)
After research, I have seen that i could change messages return by this method in the template by changing the 'Validation Error Messages'. Unfortunately, I don't understand how it works. If i'm writing what I want in the field (for example : Required Message = 'hello') the hello error message is not returned by the method and it's always the 'hard coded error message'.
So can you show me an example on how to change this validation error message for another language ? I will make my program in Multi Language so could you please (if it's not too much) explain me an example for multi language.
Thanks for your helps,
Regards,
Pierre.