Mercurial > pub > Impl
annotate Lib/IMPL/Resources.pm @ 387:4cc6cc370fb2
DOM refactoring
author | sergey |
---|---|
date | Tue, 11 Feb 2014 01:13:47 +0400 |
parents | 2eed076cb944 |
children |
rev | line source |
---|---|
49 | 1 package IMPL::Resources; |
2 use strict; | |
3 | |
318 | 4 our $CurrentLocale ||= 'default'; |
49 | 5 |
319 | 6 sub currentLocale { |
318 | 7 $CurrentLocale; |
49 | 8 } |
9 | |
318 | 10 sub SetLocale { |
11 my ($self,$locale) = @_; | |
49 | 12 |
360 | 13 $locale =~ tr/\-/_/; |
14 | |
318 | 15 $CurrentLocale = $locale; |
16 } | |
17 | |
18 sub InvokeInLocale { | |
19 my ($this,$locale,$code) = @_; | |
20 | |
360 | 21 local $CurrentLocale; |
22 $this->SetLocale($locale); | |
378 | 23 |
24 &$code() | |
25 if $code; | |
49 | 26 } |
27 | |
28 1; |