From 864fa5ac4be8bd70fc7a73ba64d468b86c93846e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 5 Sep 2024 14:05:55 +0000 Subject: [PATCH] Bug 28453: (follow-up) Make pagination labels translatable This patch moves the English strings out of Output.pm and adds classes to the pagination markup which can be used as hooks for JavaScript. The global JS include is modified to look for these hooks and add text labels to the links. Signed-off-by: David Nind Signed-off-by: Jonathan Druart --- C4/Output.pm | 13 +++++-------- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 7 +++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index cba1e07b348..e1a28e10544 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -109,7 +109,7 @@ sub pagination_bar { # navigation bar useful only if more than one page to display ! if ( $nb_pages > 1 ) { - $pagination_bar = '
    '; + $pagination_bar = '
      '; # link to first page? if ( $current_page > 1 ) { @@ -120,7 +120,7 @@ sub pagination_bar { . $url . '1' . $url_suffix . '"rel="start">' - . ' First' + . ' ' . ''; } @@ -136,7 +136,7 @@ sub pagination_bar { . $previous . $url_suffix . '" rel="prev">' - . ' Previous' + . ' ' . ''; } @@ -189,9 +189,7 @@ sub pagination_bar { . $url . $next . $url_suffix - . '" rel="next">' - . 'Next ' - . ''; + . '" rel="next">'; } # link to last page? @@ -202,8 +200,7 @@ sub pagination_bar { . $nb_pages . $url_suffix . '" rel="last">' - . 'Last ' - . ''; + . ' '; } $pagination_bar .= "\n" . '
    '; diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 864239293e2..fec76c65751 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -431,6 +431,13 @@ $(document).ready(function () { if ($('[data-bs-toggle="tooltip"]').length) { $('[data-bs-toggle="tooltip"]').tooltip(); } + + if ($(".pagination.output").length > 0) { + $(".output.first").append(__("First")); + $(".output.previous").append(__("Previous")); + $(".output.next").prepend(__("Next")); + $(".output.last").prepend(__("Last")); + } }); function removeLastBorrower() { -- 2.39.5