Re: Windows Locales

[email protected] (Dave Rolsky)
Newsgroups perl.datetime
Message-ID <[email protected]>
On Mon, 27 Aug 2012, David E. Wheeler wrote:

> The code in question that sets the locale is:
>
>    $dt->set( locale => POSIX::setlocale( POSIX::LC_TIME() ) );

I'm not sure why you think this would work on Linux either. On my system 
here's what I get:

   perl  -MPOSIX -E 'say POSIX::setlocale(POSIX::LC_TIME())'
   en_US.UTF-8

That locale will not make DateTime::Locale happy either.

Of course, this one's relatively easy to make into something DateTime can 
handle, whereas the Windows one is _way_ off. Either way, I think you may 
need to rethink how you translate the user's locale for DateTime.

I'm not really sure what the best way to do it is besides presenting users 
with an explicit choice.

With Windows, someone might want to maintain a master translation list of 
Windows names to CLDR names, much like we currently translate timezone 
names.


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.