Bug 21789: Example usage of I18N Template::Toolkit plugin
authorJulian Maurice <julian.maurice@biblibre.com>
Wed, 16 Dec 2015 00:25:44 +0000 (01:25 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 3 Jan 2019 14:20:26 +0000 (14:20 +0000)
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 727f33d858e50d26dfb60cec516533d0c4107d2a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Search.pm
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt

index 6e81497..fac04b0 100644 (file)
@@ -2259,7 +2259,6 @@ sub searchResults {
             }
         }
         $oldbiblio->{norequests} = 1 unless $can_place_holds;
-        $oldbiblio->{itemsplural}          = 1 if $items_count > 1;
         $oldbiblio->{items_count}          = $items_count;
         $oldbiblio->{available_items_loop} = \@available_items_loop;
         $oldbiblio->{onloan_items_loop}    = \@onloan_items_loop;
index 7c722b6..e264573 100644 (file)
@@ -3,6 +3,7 @@
 [% USE Koha %]
 [% USE Biblio %]
 [% USE KohaDates %]
+[% PROCESS 'i18n.inc' %]
 [% SET footerjs = 1 %]
 [% USE AuthorisedValues %]
 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
                                                 <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
                                             [% END %]
 
-                                            [% SEARCH_RESULT.items_count | html %] [% IF ( SEARCH_RESULT.itemsplural ) %]items[% ELSE %]item[% END %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] available:[% ELSE %], None available[% END %]
+                                            [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] available:[% ELSE %], None available[% END %]
 
                                             [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
                                                 </span>