Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* fixed t/date.t to look for locales with different file suffixes,

  as Template::Plugin::Date now does


git-svn-id: svn://svn.tt2.org/tt/Template2/trunk@537 d5a88997-0a34-4036-9ed2-92fb5d660d91
  • Loading branch information...
commit f231acb6558be7768769b38052c08fde14cee0ea 1 parent 7431aa3
@abw authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 t/date.t
View
10 t/date.t
@@ -53,7 +53,15 @@ my $params = {
},
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;
Please sign in to comment.
Something went wrong with that request. Please try again.