view Lib/IMPL/Resources.pm @ 353:feeb3bc4a818

corrected error handling while loading templates corrected variables lookup in controls updated handles to use the new view features
author cin
date Fri, 11 Oct 2013 15:49:04 +0400
parents d485467eca92
children 39842eedd923
line wrap: on
line source

package IMPL::Resources;
use strict;

our $CurrentLocale ||= 'default';

sub currentLocale {
    $CurrentLocale;
}

sub SetLocale {
    my ($self,$locale) = @_;
    
    $CurrentLocale = $locale;
}

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

    local $CurrentLocale = $locale;    
    eval {
        &$code()
            if $code;
    };
    die $@
        if $@;
}

1;