X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1465da30be12244675541d59b22e94a0f90e0b33..c6f47607c5b8d926ca7abb222606e90313b7aaea:/SL/Template/Plugin/T8.pm diff --git a/SL/Template/Plugin/T8.pm b/SL/Template/Plugin/T8.pm new file mode 100644 index 000000000..79fab96bb --- /dev/null +++ b/SL/Template/Plugin/T8.pm @@ -0,0 +1,24 @@ +package SL::Template::Plugin::T8; + +use Template::Plugin::Filter; +use base qw( Template::Plugin::Filter ); + +my $locale = undef; + +sub init { + my $self = shift; + + $locale ||= Locale->new($main::myconfig{countrycode}, 'all'); + + # first arg can specify filter name + $self->install_filter($self->{ _ARGS }->[0] || 'T8'); + + return $self; +} + +sub filter { + my ($self, $text, $args) = @_; + return $locale->text($text, @{ $args || [] }); +} + +return 'SL::Template::Plugin::T8';