diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
index c3c89b6fa2..06909fbfc4 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc
@@ -39,18 +39,6 @@
[% IF ( related ) %]
(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])[% END %]
- [% SET more_less_labels = {} %]
- [% more_less_labels.Authors = { more = t("Show more authors"), less = t("Show fewer authors") } %]
- [% more_less_labels.Titles = { more = t("Show more titles"), less = t("Show fewer titles") } %]
- [% more_less_labels.Topics = { more = t("Show more topics"), less = t("Show fewer topics") } %]
- [% more_less_labels.Places = { more = t("Show more places"), less = t("Show fewer places") } %]
- [% more_less_labels.Series = { more = t("Show more series"), less = t("Show fewer series") } %]
- [% more_less_labels.ItemTypes = { more = t("Show more item types"), less = t("Show fewer item types") } %]
- [% more_less_labels.CollectionCodes = { more = t("Show more collections"), less = t("Show fewer collections") } %]
- [% more_less_labels.Language = { more = t("Show more languages"), less = t("Show fewer languages") } %]
- [% more_less_labels.HomeLibrary = { more = t("Show more home libraries"), less = t("Show fewer home libraries") } %]
- [% more_less_labels.HoldingLibrary = { more = t("Show more holding libraries"), less = t("Show fewer holding libraries") } %]
- [% more_less_labels.Location = { more = t("Show more locations"), less = t("Show fewer locations") } %]
[% FOREACH facets_loo IN facets_loop %]
[% IF facets_loo.facets.size > 0 %]
@@ -114,17 +102,63 @@
[% END %]
[% IF facets_loo.facets.size > 5 %]
- [% FOR label IN more_less_labels.keys %]
- [% IF facets_loo.item('type_label_' _ label) %]
- Show more
- [% END %]
+ [% SET aria_label = t("Show more") %]
+ [% SWITCH facets_loo.label %]
+ [% CASE 'Authors' %]
+ [% aria_label = t("Show more authors") %]
+ [% CASE 'Titles' %]
+ [% aria_label = t("Show more titles") %]
+ [% CASE 'Topics' %]
+ [% aria_label = t("Show more topics") %]
+ [% CASE 'Places' %]
+ [% aria_label = t("Show more places") %]
+ [% CASE 'Series' %]
+ [% aria_label = t("Show more series") %]
+ [% CASE 'ItemTypes' %]
+ [% aria_label = t("Show more item types") %]
+ [% CASE 'Home libraries' %]
+ [% aria_label = t("Show more home libraries") %]
+ [% CASE 'Holding libraries' %]
+ [% aria_label = t("Show more holding libraries") %]
+ [% CASE 'Location' %]
+ [% aria_label = t("Show more home locations") %]
+ [% CASE 'Collections' %]
+ [% aria_label = t("Show more home collections") %]
+ [% CASE 'Languages' %]
+ [% aria_label = t("Show more home languages") %]
[% END %]
+
+ Show more
- [% FOR label IN more_less_labels.keys %]
- [% IF facets_loo.item('type_label_' _ label) %]
- Show less
- [% END %]
+ [% SET aria_label = t("Show more") %]
+ [% SWITCH facets_loo.label %]
+ [% CASE 'Authors' %]
+ [% aria_label = t("Show fewer authors") %]
+ [% CASE 'Titles' %]
+ [% aria_label = t("Show fewer titles") %]
+ [% CASE 'Topics' %]
+ [% aria_label = t("Show fewer topics") %]
+ [% CASE 'Places' %]
+ [% aria_label = t("Show fewer places") %]
+ [% CASE 'Series' %]
+ [% aria_label = t("Show fewer series") %]
+ [% CASE 'ItemTypes' %]
+ [% aria_label = t("Show fewer item types") %]
+ [% CASE 'Home libraries' %]
+ [% aria_label = t("Show fewer home libraries") %]
+ [% CASE 'Holding libraries' %]
+ [% aria_label = t("Show fewer holding libraries") %]
+ [% CASE 'Location' %]
+ [% aria_label = t("Show fewer home locations") %]
+ [% CASE 'Collections' %]
+ [% aria_label = t("Show fewer home collections") %]
+ [% CASE 'Languages' %]
+ [% aria_label = t("Show fewer home languages") %]
+ [% END %]
+
+ [% IF aria_label %]
+ Show less
[% END %]
[% END %]
diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t
index b3e1c77de6..4939b846fe 100755
--- a/t/db_dependent/Search.t
+++ b/t/db_dependent/Search.t
@@ -825,9 +825,9 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
my $facets_info = C4::Search::_get_facets_info( $facets );
my $expected_facets_info_marc21 = {
'au' => { 'label_value' => "Authors" },
- 'ccode' => { 'label_value' => "CollectionCodes" },
- 'holdingbranch' => { 'label_value' => "HoldingLibrary" },
- 'itype' => { 'label_value' => "ItemTypes" },
+ 'ccode' => { 'label_value' => "Collections" },
+ 'holdingbranch' => { 'label_value' => "Holding libraries" },
+ 'itype' => { 'label_value' => "Item types" },
'location' => { 'label_value' => "Location" },
'se' => { 'label_value' => "Series" },
'su-geo' => { 'label_value' => "Places" },
@@ -925,8 +925,8 @@ sub run_unimarc_search_tests {
my $facets_info = C4::Search::_get_facets_info( $facets );
my $expected_facets_info_unimarc = {
'au' => { 'label_value' => "Authors" },
- 'ccode' => { 'label_value' => "CollectionCodes" },
- 'holdingbranch' => { 'label_value' => "HoldingLibrary" },
+ 'ccode' => { 'label_value' => "Collections" },
+ 'holdingbranch' => { 'label_value' => "Holding libraries" },
'location' => { 'label_value' => "Location" },
'se' => { 'label_value' => "Series" },
'su-geo' => { 'label_value' => "Places" },