comparison Lib/IMPL/Web/Handler/LocaleHandler.pm @ 395:212cc86e470b

Code cleanup DateTime locale support for HTTP requests
author sergey
date Thu, 20 Feb 2014 01:33:03 +0400
parents eff7f75a4408
children
comparison
equal deleted inserted replaced
394:2c14f66efa08 395:212cc86e470b
1 package IMPL::Web::Handler::LocaleHandler; 1 package IMPL::Web::Handler::LocaleHandler;
2 use strict; 2 use strict;
3 3
4 use IMPL::Const qw(:prop); 4 use IMPL::Const qw(:prop);
5 use DateTime;
5 use IMPL::declare { 6 use IMPL::declare {
6 require => { 7 require => {
7 Resources => 'IMPL::Resources' 8 Resources => 'IMPL::Resources'
8 }, 9 },
9 base => [ 10 base => [
54 } 55 }
55 56
56 $locale = $best->[0]; 57 $locale = $best->[0];
57 } 58 }
58 59
59 Resources->SetLocale($locale) if $locale; 60 if($locale) {
61 Resources->SetLocale($locale);
62 #$locale =~ tr/-/_/;
63 DateTime->DefaultLocale($locale);
64 }
60 65
61 return $nextHandler->($action); 66 return $nextHandler->($action);
62 } 67 }
63 68
64 1; 69 1;