locale support?
- Posted by Jeremy Cowgar <jeremy at c??gar.com> May 02, 2008
- 828 views
I finished documenting datetime.e: http://jeremy.cowgar.com/euphoria/lib_dtm.htm And it has a format function that allows you to:
d = new(2008, 5, 2, 12, 58, 32) s = format(d, "%A, %B %d '%y %H:%M%p") -- s is "Friday, May 2 '08 12:58PM"
So, the problem is not that the format function cannot support other languages (because it can), but how to deal with locale support. Right now, in datetime.e there are a few sequences titled things like: month_names, month_abbrs, day_names, day_abbrs. Those are global sequences that format() uses to populate the resulting string with. If you do not speak English, you can easily change the content of those global sequences and format will happily use your language to format the date/time. However, do we need a greater support? i.e. should I introduce a locale.e or something? For instance, the GNU C locale support has abilities for dates, times, numbers, money, etc... -- Jeremy Cowgar http://jeremy.cowgar.com