[LON-CAPA-dev] I18N and dates

Gerd Kortemeyer lon-capa-dev@mail.lon-capa.org
Mon, 22 Sep 2003 17:41:37 -0400


Hi Jeremy,

On Monday, September 22, 2003, at 01:01  PM, Jeremy Bowers wrote:

> I don't see anything in Locale::Maketext about dates. What's the state 
> of the art on dates?

I do not exactly know, but I believe somehow magically "localtime" is 
supposed to take care of that, I just don't know how to tell 
"localtime" (or all of Perl) which locale to use.

>
> For instance, the Navmap returns due dates and such. For the 
> "humanTime" function that converts dates into "1 hour and 49 minutes 
> from now", I'd like my first internationalization cut to be "If 
> English, use current function, if not English, just display the date 
> in the correct Locale format." but I don't know how to do that last 
> bit.

As a very very first cut, check out the code I already put into 
"humanTime" to either use your code (in case that the language starts 
with "en") or "localtime" else.

- Gerd.