5

I'm looking for ways to implement internationalization in our web-based software. Of course, I'm not asking for a specific implementation, just a simple example that should guide me to the right (if there's such a thing) direction.

One thing that worries me, for instance, is DateTime handling. When users input Dates in a textbox, how should I validate that entry based on the current language settings (mm/dd/yyyy x dd/mm/yyyy)?

What about the text itself, where should I store it. Of course I can create my own structures, but is there something ready to use? How to create it? And how to retrieve in runtime?

Adriano Carneiro
  • 57,693
  • 12
  • 90
  • 123

3 Answers3

4

http://wiki.asp.net/page.aspx/55/internationalization/

Roy Dictus
  • 32,551
  • 8
  • 60
  • 76
0

There is a wealth of information on the asp.net wiki that details how to structure your resources and includes plenty of examples. Dates based on current cultureinfo also shouldn't pose too much of a problem.

Fishcake
  • 10,496
  • 7
  • 44
  • 72
0

I just want to point out that depending on you languages support, validating date and times might not be as easy as simple regular expression based on localized date pattern.

There are quite a few strategies here: you may decided to use JQuery UI DatePicker solely (with appropriate regional script), you may decide on to provide separate combo boxes for selection (not very easy to use idea) - year, month, day. Otherwise you may put free-form text field and validate on the server side (you could just as well perform Ajax call).

What about support for non-Gregorian calendar systems?

As you can see there are so many things to consider... And I focused just on such a simple case as obtaining Date/Time references from user...

Paweł Dyda
  • 18,366
  • 7
  • 57
  • 79