From 9abdc5945b937dd7a7d9888c63654c35a67c2675 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Nov 2019 17:26:52 +0100 Subject: [PATCH] Bug 24068: Fix I18 plugin - tnpx must call __npx Test plan: Use the following code to test this change [% PROCESS 'i18n.inc' %] [% SET nb_stuffs = 1 %] [% tnpx('context', 'There is one stuff.', 'There are {count} stuffs.', nb_stuffs, { count = nb_stuffs }) | $raw %] [% SET nb_stuffs = 42 %] [% tnpx('context', 'There is one stuff.', 'There are {count} stuffs.', nb_stuffs, { count = nb_stuffs }) | $raw %] Compare with and without the patch Signed-off-by: Martin Renvoize --- Koha/Template/Plugin/I18N.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/Template/Plugin/I18N.pm b/Koha/Template/Plugin/I18N.pm index 976c13927f..37ef1ea5ec 100644 --- a/Koha/Template/Plugin/I18N.pm +++ b/Koha/Template/Plugin/I18N.pm @@ -117,7 +117,7 @@ sub tpx { =head2 tnp - [% I18N.tnp("context", "item", "items") %] + [% I18N.tnp("context", "item", "items", count) %] =cut @@ -128,13 +128,13 @@ sub tnp { =head2 tnpx - [% I18N.tnpx("context", "{count} item", "{count} items", { count = count }) %] + [% I18N.tnpx("context", "{count} item", "{count} items", count, { count = count }) %] =cut sub tnpx { my ($self, $msgctxt, $msgid, $msgid_plural, $count, $vars) = @_; - return __np($msgctxt, $msgid, $msgid_plural, $count, %$vars); + return __npx($msgctxt, $msgid, $msgid_plural, $count, %$vars); } 1; -- 2.39.5