comparison Lib/IMPL/Resources.pm @ 360:39842eedd923

language detection from request
author sergey
date Tue, 26 Nov 2013 03:22:44 +0400
parents d485467eca92
children 2eed076cb944
comparison
equal deleted inserted replaced
359:833e663796c4 360:39842eedd923
8 } 8 }
9 9
10 sub SetLocale { 10 sub SetLocale {
11 my ($self,$locale) = @_; 11 my ($self,$locale) = @_;
12 12
13 $locale =~ tr/\-/_/;
14
13 $CurrentLocale = $locale; 15 $CurrentLocale = $locale;
14 } 16 }
15 17
16 sub InvokeInLocale { 18 sub InvokeInLocale {
17 my ($this,$locale,$code) = @_; 19 my ($this,$locale,$code) = @_;
18 20
19 local $CurrentLocale = $locale; 21 local $CurrentLocale;
22 $this->SetLocale($locale);
20 eval { 23 eval {
21 &$code() 24 &$code()
22 if $code; 25 if $code;
23 }; 26 };
24 die $@ 27 die $@