From 5ac6c0d4980c5a473e97a9593d22674ae881b708 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 20 Mar 2024 11:56:24 +0000 Subject: [PATCH] Bug 36357: Tidy I18N.pm Signed-off-by: Kyle M Hall Signed-off-by: Victor Grousset/tuxayo --- Koha/Template/Filters/I18N.pm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Koha/Template/Filters/I18N.pm b/Koha/Template/Filters/I18N.pm index 6fdee9a1af..9f6a5806c8 100644 --- a/Koha/Template/Filters/I18N.pm +++ b/Koha/Template/Filters/I18N.pm @@ -10,8 +10,8 @@ our $STATIC_FILTERS = { }; our $DYNAMIC_FILTERS = { - tx => \&tx_factory, - tn => \&tn_factory, + tx => \&tx_factory, + tn => \&tn_factory, tnx => \&tnx_factory, # i18n functions that takes a context argument (tp, tpx, tnp, tnpx) @@ -27,22 +27,22 @@ our $DYNAMIC_FILTERS = { }; sub fetch { - my ($self, $name, $args, $context) = @_; + my ( $self, $name, $args, $context ) = @_; return $STATIC_FILTERS->{$name} if $STATIC_FILTERS->{$name}; - if (my $factory = $DYNAMIC_FILTERS->{$name}) { - return $factory->($context, $args ? @$args : ()); + if ( my $factory = $DYNAMIC_FILTERS->{$name} ) { + return $factory->( $context, $args ? @$args : () ); } - return (undef, Template::Constants::STATUS_DECLINED); + return ( undef, Template::Constants::STATUS_DECLINED ); } # This sub is never called in theory as Template::Filters::store is called # first and accept all filters. # We declare it anyway, just in case the order of filter providers is changed sub store { - return (undef, Template::Constants::STATUS_DECLINED); + return ( undef, Template::Constants::STATUS_DECLINED ); } sub t { @@ -52,32 +52,32 @@ sub t { } sub tx_factory { - my ($context, $vars) = @_; + my ( $context, $vars ) = @_; return sub { my ($msgid) = @_; - return __x($msgid, $vars ? %$vars : ()); + return __x( $msgid, $vars ? %$vars : () ); } } sub tn_factory { - my ($context, $msgid_plural, $count) = @_; + my ( $context, $msgid_plural, $count ) = @_; return sub { my ($msgid) = @_; - return __n($msgid, $msgid_plural, $count); + return __n( $msgid, $msgid_plural, $count ); } } sub tnx_factory { - my ($context, $msgid_plural, $count, $vars) = @_; + my ( $context, $msgid_plural, $count, $vars ) = @_; return sub { my ($msgid) = @_; - return __nx($msgid, $msgid_plural, $count, $vars ? %$vars : ()); + return __nx( $msgid, $msgid_plural, $count, $vars ? %$vars : () ); } } -- 2.45.2