The following things/behaviors are expected in multi lingual application.
- To pick up the correct resources for the logged in user’s language
- The string sort should happen according to user language (For example: in case of Swedish users, the Swedish alphabets should come after z in Order).
- The date time format validation should happen according to the user’s language. (For example: fr-FR users can enter dd/mm/yyyy and en-US users can enter mm/dd/yyyy)
- The decimal validation again should happen according to user’s language (For example: 12,5 is valid in French whereas 12.5 is invalid)
Now the question is what is the best way to handle this.
Approach 1:
- Set the page culture and page UICulture – so that the App_GlobalResources are picked up and decimal values in grid are correctly formatted.
- Write custom methods to fire validation for the following
- Datetime
- Decimal
- Write custom method to handle string sorting.
Approach 2:
- Set the current thread’s culture and let this handle the following { Does each user of the web app have their culture correctly set in this case?}
Approach 3:
Initialize the globalization attribute in web.config and letting the application pick culture based on the user’s browser culture
<globalization uiculture="auto" culture="auto" enableClientBasedCulture =”true”/>
Please let me know if there are better alternatives and how should we approach solving such problems or the pros and cons of the above approaches.