Skip Menu |

This queue is for tickets about the DateTime-Format-Baby CPAN distribution.

Report information
The Basics
Id: 69844
Status: resolved
Priority: 0/
Queue: DateTime-Format-Baby

People
Owner: Nobody in particular
Requestors: J2N-FORGET [...] orange.fr
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.0100
Fixed in: 1.0200



Subject: Spelling mistakes
A few spelling mistakes. Fixed by comparing with Abigail's Acme::Time::Baby. And now, the output is in utf-8. See the attached patch. This patch also fixes a warning about assigning 1 to $[ (ticket 69841) and a warning by perldoc about a forgotten "=back" directive (ticket 69842).
Subject: dt-f-baby.patch
diff -ur DateTime-Format-Baby-1.01/Changes DateTime-Format-Baby-1.02/Changes --- DateTime-Format-Baby-1.01/Changes 2003-06-28 10:34:35.000000000 +0200 +++ DateTime-Format-Baby-1.02/Changes 2011-07-27 20:17:52.855514792 +0200 @@ -54,3 +54,8 @@ returning 7:60 rather then 8:00, which used to work but doesn't anymore!) +1.0200 ??? + - Prevent warnings about assignments to $[ + - POD fix + - convert to utf-8 + - fix some spelling mistakes, following Abgail's Acme::Time::Baby 2010090301. diff -ur DateTime-Format-Baby-1.01/lib/DateTime/Format/Baby.pm DateTime-Format-Baby-1.02/lib/DateTime/Format/Baby.pm --- DateTime-Format-Baby-1.01/lib/DateTime/Format/Baby.pm 2003-06-28 10:23:20.000000000 +0200 +++ DateTime-Format-Baby-1.02/lib/DateTime/Format/Baby.pm 2011-07-27 20:14:42.503874351 +0200 @@ -5,7 +5,7 @@ use DateTime; use Carp; -$VERSION = '0.15.3'; +$VERSION = '1.0200'; my %languages = ( 'en' => {numbers => [qw /one two three four five six seven @@ -15,17 +15,17 @@ big => [qw/big long large minute/], little => [qw/little small short hour/]}, - 'br' => {numbers => [qw /um dois trÍs quatro cinco seis + 'br' => {numbers => [qw /um dois três quatro cinco seis sete oito nove dez onze doze/], - format => "O ponteiro grande est· no %s " . - "e o ponteiro pequeno est· no %s"}, + format => "O ponteiro grande está no %s " . + "e o ponteiro pequeno está no %s"}, - 'de' => {numbers => [qw /Eins Zwei Drei Vier F¸nf Sechs Sieben - Acht Neun Zehn Elf Zw–lf/], - format => "Der gro\xDFe Zeiger ist auf der %s " . + 'de' => {numbers => [qw /Eins Zwei Drei Vier Fünf Sechs Sieben + Acht Neun Zehn Elf Zwölf/], + format => "Der große Zeiger ist auf der %s " . "und der kleine Zeiger ist auf der %s", - big => [qw/groß lang groß Minute/], - little => [qw/wenig klein Kurzschluß Stunde/]}, + big => [qw/groß lang groß Minute/], + little => [qw/wenig klein Kurzschluß Stunde/]}, 'du' => {numbers => [qw /een twee drie vier vijf zes zeven acht negen tien elf twaalf/], @@ -34,18 +34,18 @@ 'es' => {numbers => [qw /uno dos tres cuatro cinco seis siete ocho nueve diez once doce/], - format => "La manecilla grande est· sobre el %s " . - "y la manecilla pequeÒa est· sobre el %s", + format => "La manecilla grande está sobre el %s " . + "y la manecilla pequeña está sobre el %s", big => [qw/grande grande minuto/, 'de largo'], - little => [qw/poco pequeño cortocircuito hora/]}, + little => [qw/poco pequeño cortocircuito hora/]}, 'fr' => {numbers => [qw /un deux trois quatre cinq six sept huit neuf dix onze douze/], format => "La grande aiguille est sur le %s " . "et la petite aiguille est sur le %s", - big => [qw/grand longtemps grand minute/], - little => [qw/peu petit short heure/]}, + big => [qw/grand long grand minute/], + little => [qw/peu petit court heure/]}, 'it' => {numbers => ['a una', 'e due', 'e tre', 'e quattro', 'e cinque', 'e sei', 'e sette', @@ -57,14 +57,14 @@ little => [qw/piccolo piccolo short ora/]}, 'no' => {numbers => [qw /en to tre fire fem seks syv - Âtte ni ti elleve tolv/], - format => "Den store viseren er p %s " . - "og den lille viseren er p %s"}, - - 'se' => {numbers => [qw /ett tv tre fyra fem sex sju - Âtta nio tio elva tolv/], - format => "Den stora visaren ”r p %s " . - "och den lilla visaren ”r p %s"}, + Ã¥tte ni ti elleve tolv/], + format => "Den store viseren er pÃ¥ %s " . + "og den lille viseren er pÃ¥ %s"}, + + 'se' => {numbers => [qw /ett tv tre fyra fem sex sju + Âtta nio tio elva tolv/], + format => "Den stora visaren är pÃ¥ %s " . + "och den lilla visaren är pÃ¥ %s"}, 'swedish chef' => {numbers => [qw /one tvu three ffuoor ffeefe six @@ -189,8 +189,7 @@ $minutes = sprintf "%.0f" => $minutes / 5; $minutes ||= 12; - local $[ = 1; - return sprintf $self->{format} => @{$self->{numbers}} [$minutes, $hours]; + return sprintf $self->{format} => @{$self->{numbers}} [$minutes -1, $hours -1]; } sub format_duration { @@ -254,6 +253,8 @@ This method return a list of known languages. +=back + =head1 SUPPORT Support for this module is provided via the datetime@perl.org email
On 2011-07-27 15:39:31, JFORGET wrote: Show quoted text
> A few spelling mistakes. Fixed by comparing with Abigail's > Acme::Time::Baby. And now, the output is in utf-8. > See the attached patch.
Shouldn't the patch also include a "use utf8;"?
Subject: Re: [rt.cpan.org #69844] Spelling mistakes
Date: Thu, 22 May 2014 20:31:02 +0200
To: bug-DateTime-Format-Baby [...] rt.cpan.org
From: Jean Forget <J2N-FORGET [...] orange.fr>
Le jeudi 22 mai 2014 à 03:13 -0400, Slaven_Rezic via RT a écrit : Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=69844 > > > On 2011-07-27 15:39:31, JFORGET wrote:
> > A few spelling mistakes. Fixed by comparing with Abigail's > > Acme::Time::Baby. And now, the output is in utf-8. > > See the attached patch.
> > Shouldn't the patch also include a "use utf8;"? >
Actually, I never quite understood the use of this pragma. The patched version of DT::F::Baby on my home computer does *not* include "use utf8;" and yet, it gives me proper strings. My version of perl is 5.16.3. By the way, the POD for utf8 contains: Show quoted text
> When UTF-8 becomes the standard source format, this pragma will > effectively become a no-op.
Maybe this time has come. Maybe the pragma is now a no-op. In the Perl scripts I write, I usually include # -*- encoding: utf8 -*- (for Emacs) but not use utf8; (for Perl). And I have no problems with that. On which versions have you checked the module? Which versions gave you wrongly-formed strings? Jean Forget
Le Jeu 22 Mai 2014 20:31:13, JFORGET a écrit : Show quoted text
> Le jeudi 22 mai 2014 à 03:13 -0400, Slaven_Rezic via RT a écrit :
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=69844 > > > > > On 2011-07-27 15:39:31, JFORGET wrote:
> > > A few spelling mistakes. Fixed by comparing with Abigail's > > > Acme::Time::Baby. And now, the output is in utf-8. > > > See the attached patch.
> > > > Shouldn't the patch also include a "use utf8;"? > >
> > Actually, I never quite understood the use of this pragma. > The patched version of DT::F::Baby on my home computer > does *not* include "use utf8;" and yet, it gives me > proper strings. My version of perl is 5.16.3. > By the way, the POD for utf8 contains: >
> > When UTF-8 becomes the standard source format, this pragma will > > effectively become a no-op.
> > Maybe this time has come. Maybe the pragma is now a no-op. > In the Perl scripts I write, I usually include > # -*- encoding: utf8 -*- > (for Emacs) but not > use utf8; > (for Perl). And I have no problems with that. > > On which versions have you checked the module? Which versions > gave you wrongly-formed strings? > > Jean Forget >
Slaven is right and in May 2014 I was wrong. The pragma utf8 is still necessary. See my RT ticket for DT::C::FrenchRevolutionary https://rt.cpan.org/Ticket/Display.html?id=100311 in November 2014 (explanations in French at : http://paris.mongueurs.net/meetings/2014/1112.html#l) So yes, the patch should add "use utf8;"