view Lib/IMPL/Resources.pm @ 388:648dfaf642e0

DOM refactoring, removed inflators from DOM Schema, DOM validation - in progress
author cin
date Tue, 11 Feb 2014 20:22:01 +0400
parents 2eed076cb944
children
line wrap: on
line source

package IMPL::Resources;
use strict;

our $CurrentLocale ||= 'default';

sub currentLocale {
    $CurrentLocale;
}

sub SetLocale {
    my ($self,$locale) = @_;
    
    $locale =~ tr/\-/_/;
    
    $CurrentLocale = $locale;
}

sub InvokeInLocale {
    my ($this,$locale,$code) = @_;

    local $CurrentLocale;
    $this->SetLocale($locale);    
    
    &$code()
		if $code;
}

1;