On Thu, Aug 15, 2002 at 02:37:12PM -0400, Vivek Khera wrote:
> expect: [In English, today's day is: Thursday
In French, today's day is: Thursday]
> output: [In English, today's day is: Thursday
In French, today's day is: Jeudi]
Ah yes. I applied a patch to the Date plugin which does a better job
of finding locale files than it did before. I hadn't updated the test
to do the same.
The patch below should fix it (committed to CVS), but it's nothing
to worry about for now. It's a broken test, not a broken tookit. :-)
A
--- date.t 2002/07/08 11:06:17 2.7
+++ date.t 2002/08/16 07:19:26 2.8
@@ -11,7 +11,7 @@
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
-# $Id: date.t,v 2.7 2002/07/08 11:06:17 abw Exp $
+# $Id: date.t,v 2.8 2002/08/16 07:19:26 abw Exp $
#
#========================================================================
@@ -53,7 +53,15 @@
},
nowloc => sub { my ($time, $format, $locale) = @_;
my $old_locale = &POSIX::setlocale(&POSIX::LC_ALL);
- &POSIX::setlocale(&POSIX::LC_ALL, $locale);
+
+ # some systems expect locales to have a particular suffix
+ for my $suffix ('', @Template::Plugin::Date::LOCALE_SUFFIX) {
+ my $try_locale = $locale.$suffix;
+ if ($try_locale eq &POSIX::setlocale(&POSIX::LC_ALL, $try_locale)) {
+ $locale = $try_locale;
+ last;
+ }
+ }
my $datestr = &POSIX::strftime($format, localtime($time));
&POSIX::setlocale(&POSIX::LC_ALL, $old_locale);
return $datestr;
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates