Mercurial > pub > Impl
comparison lib/IMPL/Resources.pm @ 407:c6e90e02dd17 ref20150831
renamed Lib->lib
| author | cin | 
|---|---|
| date | Fri, 04 Sep 2015 19:40:23 +0300 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 406:f23fcb19d3c1 | 407:c6e90e02dd17 | 
|---|---|
| 1 package IMPL::Resources; | |
| 2 use strict; | |
| 3 | |
| 4 our $CurrentLocale ||= 'default'; | |
| 5 | |
| 6 sub currentLocale { | |
| 7 $CurrentLocale; | |
| 8 } | |
| 9 | |
| 10 sub SetLocale { | |
| 11 my ($self,$locale) = @_; | |
| 12 | |
| 13 $locale =~ tr/\-/_/; | |
| 14 | |
| 15 $CurrentLocale = $locale; | |
| 16 } | |
| 17 | |
| 18 sub InvokeInLocale { | |
| 19 my ($this,$locale,$code) = @_; | |
| 20 | |
| 21 local $CurrentLocale; | |
| 22 $this->SetLocale($locale); | |
| 23 | |
| 24 &$code() | |
| 25 if $code; | |
| 26 } | |
| 27 | |
| 28 1; | 
