Mercurial > pub > Impl
annotate Lib/IMPL/Resources.pm @ 383:2f16f13b000c
DOM localization
author | cin |
---|---|
date | Thu, 23 Jan 2014 17:26:34 +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; |