T8 Filter für Templates und Anwendungsbeispiel _payments
[kivitendo-erp.git] / SL / Template / Plugin / T8.pm
1 package SL::Template::Plugin::T8;
2
3 use Template::Plugin::Filter;
4 use base qw( Template::Plugin::Filter );
5
6 my $locale = undef;
7
8 sub init {
9     my $self = shift;
10
11     $locale ||= Locale->new($main::myconfig{countrycode}, 'all');
12
13     # first arg can specify filter name
14     $self->install_filter($self->{ _ARGS }->[0] || 'T8');
15
16     return $self;
17 }
18
19 sub filter {
20     my ($self, $text, $args) = @_;
21     return $locale->text($text, @{ $args || [] });
22 }
23
24 return 'SL::Template::Plugin::T8';