Bugzilla – Attachment 163523 Details for
Bug 36357
Add Template::Toolkit filters for internationalization (I18N)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36357: Tidy I18N.pm
Bug-36357-Tidy-I18Npm.patch (text/plain), 2.61 KB, created by
Kyle M Hall (khall)
on 2024-03-20 12:11:05 UTC
(
hide
)
Description:
Bug 36357: Tidy I18N.pm
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-03-20 12:11:05 UTC
Size:
2.61 KB
patch
obsolete
>From 0e43b31c250aae67aae835b1ff9d804d1e3354f2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 20 Mar 2024 11:56:24 +0000 >Subject: [PATCH] Bug 36357: Tidy I18N.pm > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > 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 6fdee9a1af0..9f6a5806c81 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.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36357
:
163380
|
163381
|
163521
|
163522
|
163523
|
163524
|
163597
|
168955
|
168956
|
168957
|
168958
|
168959
|
168962
|
168963