Answered by:
Localizing validation messages for form input

Question
-
I have a simple form in my metro app, with some textboxes marked as required. Upon submitting the form with empty fields, the validation message "This is a required field" appears. However I could not find a way to display localized text, the validation message appears in English regardless if the app primary language is changed, or the OS language is changed.
Do I have to load my own localized strings for displaying localized text, or is there a simple way for localized validation messages to display based on app primary language?
JS Example
<inputtype="text"id="Name"required/>
Tuesday, June 26, 2012 11:01 PM
Answers
-
We ran into the same problem. In the Language section of the Control Panel, click on "Options" for that language and install the language pack, and the error messages should show up with the correct translations.Wednesday, June 27, 2012 10:14 PM
All replies
-
You can set up your strings in a resource file and localize them there. See How to prepare for localization for more information.
--Rob
Wednesday, June 27, 2012 12:25 AMModerator -
I'm not asking how to localize strings, because I know how to do that.
Form inputs has built in validation. I'm using default built-in validation, but the default built-in validation messages are not displayed in the correct language.
Example, Metro application primary language is set to qps-loc, but "This is a required field" message still appears in English.
Does the built-in validation by Metro/IE10 not support localization?
Wednesday, June 27, 2012 1:02 AM -
How are you setting up your custom error message?
PS: this should get you started: http://code.msdn.microsoft.com/ie/Form-controls-part-2-327288d9/sourcecode?fileId=59005&pathId=1418183922
Luis Abreu
- Edited by Luis Miguel Abreu Wednesday, June 27, 2012 10:18 AM
Wednesday, June 27, 2012 9:30 AM -
This is not a custom error message - this is a message generated by the framework when an "input" field has a "required" attribute. Do we have to create a custom error message to get the standard message localized? Seems like the system should generate the message matching the OS language...Wednesday, June 27, 2012 3:46 PM
-
We ran into the same problem. In the Language section of the Control Panel, click on "Options" for that language and install the language pack, and the error messages should show up with the correct translations.Wednesday, June 27, 2012 10:14 PM
-
Ah, you want to get default localized messages. Pjamestx suggestion should do it.
Luis Abreu
Wednesday, June 27, 2012 10:40 PM