Mercurial > pub > Impl
annotate Lib/IMPL/Resources.pm @ 379:a471e8b77544
sync
| author | cin |
|---|---|
| date | Thu, 16 Jan 2014 18:10:50 +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; |
