annotate Lib/IMPL/Resources.pm @ 320:28eba7e0c592

*web application action: added method to access HTTP request header.
author sergey
date Thu, 16 May 2013 17:16:41 +0400
parents d485467eca92
children 39842eedd923
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
1 package IMPL::Resources;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
3
318
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
4 our $CurrentLocale ||= 'default';
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
5
319
d485467eca92 small fixes
cin
parents: 318
diff changeset
6 sub currentLocale {
318
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
7 $CurrentLocale;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
8 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
9
318
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
10 sub SetLocale {
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
11 my ($self,$locale) = @_;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
12
318
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
13 $CurrentLocale = $locale;
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
14 }
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
15
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
16 sub InvokeInLocale {
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
17 my ($this,$locale,$code) = @_;
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
18
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
19 local $CurrentLocale = $locale;
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
20 eval {
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
21 &$code()
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
22 if $code;
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
23 };
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
24 die $@
1838bdb4d238 corrected support of resources localization
cin
parents: 49
diff changeset
25 if $@;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
26 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
27
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 0
diff changeset
28 1;