Skip Menu |

This queue is for tickets about the Genealogy-Gedcom-Date CPAN distribution.

Report information
The Basics
Id: 106703
Status: resolved
Priority: 0/
Queue: Genealogy-Gedcom-Date

People
Owner: Nobody in particular
Requestors: NHORNE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.12
Fixed in: 1.13



Subject: Doesn't handle locale
I can't work out how to get the module to set the locale of the DateTime object that pare_date_value() returns. Does G:G:D honour locales? If so, how do I make use of them?
Subject: Re: [rt.cpan.org #106703] Doesn't handle locale
Date: Fri, 28 Aug 2015 09:23:42 +1000
To: bug-Genealogy-Gedcom-Date [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Nigel On 28/08/15 05:15, Nigel Horne via RT wrote: Show quoted text
> Thu Aug 27 15:15:25 2015: Request 106703 was acted upon. > Transaction: Ticket created by NHORNE > Queue: Genealogy-Gedcom-Date > Subject: Doesn't handle locale > Broken in: 1.12 > Severity: Normal > Owner: Nobody > Requestors: NHORNE@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=106703 > > > > I can't work out how to get the module to set the locale of the DateTime object that pare_date_value() returns. Does G:G:D honour locales? If so, how do I make use of them?
Gasp! Someone's actually using the module? I've had so many identical test failures, such as http://www.cpantesters.org/cpan/report/76ac88e9-6c08-1014-a6d0-c6cd81a53374 which I can't reproduce that I was thinking of deleting the module from CPAN, but I won't do that now. As for locale, I did not ever take that into account. In my defence I should say the original defining doc for Gedcom, I sure there was no mention of locale. I've just uploaded the Gedcom standard doc: http://savage.net.au/misc/Ged551-5.pdf if you're interested, although I assume you already had it. Note: I can't display these days it in Chrome from some reason, only in FF. So, what to do? Frankly, I don't know. Any suggestions? -- Ron Savage - savage.net.au
Subject: Re: [rt.cpan.org #106703] Doesn't handle locale
Date: Thu, 27 Aug 2015 19:23:19 -0400
To: bug-Genealogy-Gedcom-Date [...] rt.cpan.org
From: Nigel Horne <njh [...] bandsman.co.uk>
Ron, Thanks for your quick response. I'm considering adding it to gedcal (https://github.com/nigelhorne/gedcal) and possibly gedgrave. It's not a Gedcom issue, it's an issue with passing the environment through to the DateTime constructor. I'll take a look at the source see if I can suggest a change. Regards, -Nigel
Subject: Re: [rt.cpan.org #106703] Doesn't handle locale
Date: Thu, 27 Aug 2015 19:45:26 -0400
To: bug-Genealogy-Gedcom-Date [...] rt.cpan.org
From: Nigel Horne <njh [...] bandsman.co.uk>
I think you want something like this. Change $$flags{"${which}_date"} = DateTime -> new(year => $field[2], month => $field[1], day => $field[0]); to if($ENV{'LANG'}) { $$flags{"${which}_date"} = DateTime -> new(locale => $ENV{'LANG'}, year => $field[2], month => $field[1], day => $field[0]); } else { $$flags{"${which}_date"} = DateTime -> new(year => $field[2], month => $field[1], day => $field[0]); } I haven't tried it, but it may be worth a shot. Regards, -Nigel
Subject: Re: [rt.cpan.org #106703] Doesn't handle locale
Date: Fri, 28 Aug 2015 11:27:16 +1000
To: bug-Genealogy-Gedcom-Date [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Nigel On 28/08/15 09:46, njh@bandsman.co.uk via RT wrote: Show quoted text
> Change > $$flags{"${which}_date"} = DateTime -> new(year => $field[2], > month => $field[1], day => $field[0]); > to > if($ENV{'LANG'}) { > $$flags{"${which}_date"} = DateTime -> new(locale => > $ENV{'LANG'}, year => $field[2], month => $field[1], day => $field[0]); > } else { > $$flags{"${which}_date"} = DateTime -> new(year => > $field[2], month => $field[1], day => $field[0]); > }
V 1.13 using this code is now on CPAN. Please let me know how it goes. Ohh. Also, congratulations on your new promotion as chief tester of this module! Hahaha. I do run 'prove -lv t' and 'prove -lv xt/author', so I'm your assistant. -- Ron Savage - savage.net.au
Subject: Re: [rt.cpan.org #106703] Doesn't handle locale
Date: Fri, 28 Aug 2015 11:14:49 -0400
To: <bug-Genealogy-Gedcom-Date [...] rt.cpan.org>
From: Nigel Horne <njh [...] bandsman.co.uk>
I've not done exhaustive testing, but so far 1.13 seems to have fixed the problem - thanks! -Nigel
Download smime.p7s
application/pkcs7-signature 4.1k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #106703] Doesn't handle locale
Date: Sat, 29 Aug 2015 08:53:04 +1000
To: bug-Genealogy-Gedcom-Date [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Nigel On 29/08/15 01:15, njh@bandsman.co.uk via RT wrote: Show quoted text
> Queue: Genealogy-Gedcom-Date > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=106703 > > > I've not done exhaustive testing, but so far 1.13 seems to have fixed > the problem - thanks!
Thanx for the good news. I'm just going out, but late today I'll release a fix for the other issue. -- Ron Savage - savage.net.au
All good now, thanks! -Nigel
Subject: Re: [rt.cpan.org #106703] Doesn't handle locale
Date: Mon, 31 Aug 2015 08:58:13 +1000
To: bug-Genealogy-Gedcom-Date [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Nigel On 31/08/15 05:00, Nigel Horne via RT wrote: Show quoted text
> Queue: Genealogy-Gedcom-Date > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=106703 > > > All good now, thanks!
Excellent news.... -- Ron Savage - savage.net.au