Revision f393137f
Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt
SL/Template/Plugin/T8.pm | ||
---|---|---|
6 | 6 |
my $locale = undef; |
7 | 7 |
|
8 | 8 |
sub init { |
9 |
my $self = shift;
|
|
9 |
my $self = shift; |
|
10 | 10 |
|
11 |
$locale ||= Locale->new($main::myconfig{countrycode}, 'all');
|
|
11 |
$locale ||= Locale->new($main::myconfig{countrycode}, 'all'); |
|
12 | 12 |
|
13 |
# first arg can specify filter name
|
|
14 |
$self->install_filter($self->{ _ARGS }->[0] || 'T8');
|
|
13 |
# first arg can specify filter name |
|
14 |
$self->install_filter($self->{ _ARGS }->[0] || 'T8'); |
|
15 | 15 |
|
16 |
return $self;
|
|
16 |
return $self; |
|
17 | 17 |
} |
18 | 18 |
|
19 | 19 |
sub filter { |
20 |
my ($self, $text, $args) = @_;
|
|
21 |
return $locale->text($text, @{ $args || [] });
|
|
20 |
my ($self, $text, $args) = @_; |
|
21 |
return $locale->text($text, @{ $args || [] }); |
|
22 | 22 |
} |
23 | 23 |
|
24 | 24 |
return 'SL::Template::Plugin::T8'; |
Auch abrufbar als: Unified diff
Kosmetik: wir verwenden zwei Leerzeichen für Einrückung