projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ClientJS: Funktionen zum Hinzufügen und Entfernen generischer Eventhandler
[kivitendo-erp.git]
/
SL
/
Template
/
Plugin
/
T8.pm
diff --git
a/SL/Template/Plugin/T8.pm
b/SL/Template/Plugin/T8.pm
index
79fab96
..
aff4401
100644
(file)
--- a/
SL/Template/Plugin/T8.pm
+++ b/
SL/Template/Plugin/T8.pm
@@
-1,24
+1,27
@@
package SL::Template::Plugin::T8;
package SL::Template::Plugin::T8;
-use
Template::Plugin::Filter
;
-use
base
qw( Template::Plugin::Filter );
+use
strict
;
+use
parent
qw( Template::Plugin::Filter );
-my $
locale = undef
;
+my $
cached_instance
;
-sub init {
- my $self = shift;
+sub new {
+ my $class = shift;
+
+ return $cached_instance ||= $class->SUPER::new(@_);
+}
- $locale ||= Locale->new($main::myconfig{countrycode}, 'all');
+sub init {
+ my $self = shift;
- # first arg can specify filter name
- $self->install_filter($self->{ _ARGS }->[0] || 'T8');
+ $self->install_filter($self->{ _ARGS }->[0] || 'T8');
-
return $self;
+ return $self;
}
sub filter {
}
sub filter {
-
my ($self, $text, $args) = @_;
-
return $locale->text($text, @{ $args || [] })
;
+ my ($self, $text, $args) = @_;
+
return $::locale->text($text, @{ $args || [] }) || $text
;
}
return 'SL::Template::Plugin::T8';
}
return 'SL::Template::Plugin::T8';