Re: The default datetime format for the object’s locale

2012-10-25 Thread Dave Rolsky

On Thu, 25 Oct 2012, N Heinrichs wrote:


If the locale's definitions for the 'medium' formats are
wrong/outdated (see http://cldr.unicode.org/index/downloads) you could
propose an update to the locale class itself, but I am unsure of the
official way to do this.


Note that DateTime::Locale is quite behind the CLDR data these days. 
Fixing this is kind of a pain in the ass, since the LDML data keeps 
changing (sometimes changing internal structure) and the DateTime::Locale 
code does a completely half-assed job of parsing the LDML documents.


What I really want to do is write a proper Perl interface to libicu _or_ 
reimplement libicu in Perl, but that's a fairly big project.



-dave

/*
http://VegGuide.org   http://blog.urth.org
Your guide to all that's veg  House Absolute(ly Pointless)
*/


Re: The default datetime format for the object’s locale

2012-10-24 Thread N Heinrichs
Short answer: As of DateTime v0.72 on my local machine, %c is not
directly configurable.

A little more info:

%c is hardcoded to use the locale's `datetime_format_default` (search
for strftime_patterns in DateTime.pm)

DateTime::Locale::ko does not override 'datetime_format_default'. Nor
does it override 'default_date_format_length', or
'default_time_format_length', both of which default to 'medium' (see
DateTime::Locale::root.)

DT:Loc:ko's medium date/time formats are \.\ M\.\ d\. and a\
h\:mm\:ss, which is why you get the output below.

So without modifying/overriding DateTime::Locale::ko, or dropping your
use of %c in favor of a custom formatter, it may be difficult to fix
your problem.

If the locale's definitions for the 'medium' formats are
wrong/outdated (see http://cldr.unicode.org/index/downloads) you could
propose an update to the locale class itself, but I am unsure of the
official way to do this.

-Nate

On Wed, Oct 24, 2012 at 2:36 AM, Bill Moseley mose...@hank.org wrote:
 We have been using formats %c, %x and %X for localizing dates based on
 Locale.   Mostly works ok, but for Korean we are getting this:

 2012. 10. 18. 오후 4:09:05


 where (I've been told) we would like this format:

 2012년 10월 22일 월요일 오후 01:44 PDT


 Is this formatting done in DateTime?   I'm wondering how we can set the
 default format used by %c for a given locale.

 In a web app what we are currently doing is
 setting DateTime-DefaultLocale() per request.  The DateTime objects are
 inflated from database rows with DBIC.

 --
 Bill Moseley
 mose...@hank.org


The default datetime format for the object’s locale

2012-10-23 Thread Bill Moseley
We have been using formats %c, %x and %X for localizing dates based on
Locale.   Mostly works ok, but for Korean we are getting this:

2012. 10. 18. 오후 4:09:05


where (I've been told) we would like this format:

2012년 10월 22일 월요일 오후 01:44 PDT


Is this formatting done in DateTime?   I'm wondering how we can set the
default format used by %c for a given locale.

In a web app what we are currently doing is
setting DateTime-DefaultLocale() per request.  The DateTime objects are
inflated from database rows with DBIC.

-- 
Bill Moseley
mose...@hank.org