diff --git a/local/config/vufind/facets.ini b/local/config/vufind/facets.ini index 5b40659817517ee7b9d9716eca2ddb861f223375..fdf7ccf912b6d48609842ec039ab4ce7251325aa 100644 --- a/local/config/vufind/facets.ini +++ b/local/config/vufind/facets.ini @@ -239,3 +239,15 @@ hide_facets = "genre_facet,era_facet,geographic_facet" ; Special facets sorted alphabetically. [SortedByIndex] ;index[] = format + +; Special terms (key), which can't / shouldn't be translated but marked as other language (value) for BARF reasons +[LanguageTags] +De Gruyter Journals / Social Sciences and Humanities = "en" +Free = "en" +JSTOR Music Archive = "en" +Local = "en" +Microform = "en" +Open Access = "en" +Online = "en" +Proceeding = "en" +Répertoire International des Sources Musicales = "fr" diff --git a/local/languages/de.ini b/local/languages/de.ini index b257ab271cbbbf0aba982fd9af093519c8487ff9..927519966e559d8298bde1ab8fd38b68bb99d06d 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -1803,11 +1803,12 @@ footer_ezb = "Elektronische Zeitschriftenbibliothek (EZB)" footer_kvk = "Karlsruher Virtueller Katalog (KVK)" footer_dbis = "Datenbankinformationssystem (DBIS)" footer_nwb = "nwb-Datenbank" +Footer-Powered-By-Text = "Betrieben mit" ; Powered by alt and title tags -vufind-logo_alt = "VuFind" +vufind-logo_alt = "VuFind-Software" vufind-logo_title = "Weitere Informationen in englischer Sprache finden Sie auf VuFind.org" -finc-logo_alt = "finc" +finc-logo_alt = "finc-Software" finc-logo_title = "Weitere Informationen zu 'finc' finden Sie in unserem finc-Blog" ; source providers diff --git a/local/languages/en.ini b/local/languages/en.ini index a4cb46bf4b95a77e2b4f17edcbcb02e68f6345b7..e91a899716ebf85b56d1f43a1454561f868f036b 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -1921,11 +1921,12 @@ footer_ezb = "Electronic Journals Library (EZB)" footer_kvk = "Karlsruhe Virtual Catalog (KVK)" footer_dbis = "Database Information System (DBIS)" footer_nwb = "Database nwb" +Footer-Powered-By-Text = "Powered by" ; Powered by alt and title tags -vufind-logo_alt = "VuFind" +vufind-logo_alt = "VuFind software" vufind-logo_title = "For further informationen please visit VuFind.org" -finc-logo_alt = "finc" +finc-logo_alt = "finc software" finc-logo_title = "For further informationen in German on 'finc' please visit our finc-Blog" ; Tab to Close-text for closing FNDTN ToolTips diff --git a/module/finc/src/finc/View/Helper/Root/SideFacet.php b/module/finc/src/finc/View/Helper/Root/SideFacet.php index 240b5abd29b89c68c0424847ccf0df155a639a4c..f1c12ba4e8a4c9e08d44b573cb44ec195a26e338 100644 --- a/module/finc/src/finc/View/Helper/Root/SideFacet.php +++ b/module/finc/src/finc/View/Helper/Root/SideFacet.php @@ -89,4 +89,24 @@ class SideFacet extends AbstractHelper } return $sideFacets; } + + /** + * Get term with corresponding language tag within html element + * + * @param string $term translation to decorate with language tag + * @param string $element wrapping html element + * @param string $language current language + * + * @return string + */ + public function getLanguageTag(string $term, string $element, string $language) + { + $retval = $term; + + if (isset($this->config->LanguageTags[$term]) && $this->config->LanguageTags[$term] !== $language) { + $retval = "<$element " . 'lang="' . $this->config->LanguageTags[$term] . '">' . "$term</$element>"; + } + + return $retval; + } } diff --git a/themes/finc/templates/Recommend/SideFacets/filter-list.phtml b/themes/finc/templates/Recommend/SideFacets/filter-list.phtml new file mode 100644 index 0000000000000000000000000000000000000000..480226de44316a89b2c8f2472b64ceb7bd3608a0 --- /dev/null +++ b/themes/finc/templates/Recommend/SideFacets/filter-list.phtml @@ -0,0 +1,33 @@ +<!-- finc - Recommend - SideFacets - filter-list.phtml --> +<?php /* #18509 copied from bootstrap for adding language tags to displayText */ ?> +<div class="facet-group active-filters"> + <div class="title"><?=$this->transEsc('Remove Filters')?></div> + <?php foreach ($filterList as $field => $filters): ?> + <?php foreach ($filters as $i => $filter): ?> + <?php + $index = isset($filter['field']) ? array_search($filter['field'], $collapsedFacets) : false; + if ($index !== false) { + unset($collapsedFacets[$index]); // Open if we have a match + } + if (isset($filter['specialType']) && $filter['specialType'] == 'keyword') { + $removeLink = $this->currentPath() . $results->getUrlQuery()->replaceTerm($filter['value'], ''); + } else { + $removeLink = $this->currentPath() . $results->getUrlQuery()->removeFacet($filter['field'], $filter['value'], $filter['operator']); + } + if ($filter['displayText'] == '[* TO *]') { + $filter['displayText'] = $this->translate('filter_wildcard'); + } + ?> + <a class="facet" href="<?=$removeLink ?>" title="<?=$this->transEsc('clear_tag_filter') ?>"> + <span class="sr-only"><?=$this->transEsc('clear_tag_filter') ?></span> + <span class="text"> + <?php if ($filter['operator'] == 'NOT'): ?><?=$this->transEsc('NOT') ?><?php endif; ?> + <?php if ($filter['operator'] == 'OR' && $i > 0): ?><?=$this->transEsc('OR') ?><?php endif; ?> + <?=$this->transEsc($field) ?>: <?=$this->sideFacet()->getLanguageTag($this->escapeHtml($filter['displayText']), 'span', $this->layout()->userLang) ?> + </span> + <span class="status"><i class="fa fa-times" aria-hidden="true"></i></span> + </a> + <?php endforeach; ?> + <?php endforeach; ?> +</div> +<!-- finc - Recommend - SideFacets - filter-list.phtml - END --> diff --git a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml index 58b71027afa3d45a1526d6942dabac89ac2457af..bedb8055591bb54649d1295fab44e0d0510c0d48 100644 --- a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml +++ b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml @@ -21,6 +21,9 @@ $displayText = $this->escapeHtml($this->facet['value']); } + // #18509 decorate special untranslated terms with language tags + $displayText = $this->sideFacet()->getLanguageTag($displayText, 'span', $this->layout()->userLang); + if ($this->facet['operator'] == 'OR') { $displayText = '<i class="fa ' . ($this->facet['isApplied'] ? 'fa-check-square-o' : 'fa-square-o') . '" aria-hidden="true"></i> ' diff --git a/themes/finc/templates/footer.phtml b/themes/finc/templates/footer.phtml index 926350450de85245ddf54ca6dff4990dd7694093..b39d33f6adef441e6b1a61844b7c4a6b7531d49c 100644 --- a/themes/finc/templates/footer.phtml +++ b/themes/finc/templates/footer.phtml @@ -34,14 +34,11 @@ <hr> <div class="footer-container powered-by"> <div class="footer-column"> - <?=$this->layout()->poweredBy?> - <span lang="en">Powered by</span> - <a href="https://vufind.org/" title="<?=$this->transEsc('vufind-logo_title')?>" target="_blank"> - <img src="<?=$this->imageLink('vufind_logo.png')?>" alt="<?=$this->transEsc('vufind-logo_alt')?>"/> - </a> - <a href="http://blog.finc.info" title="<?=$this->transEsc('finc-logo_title')?>" target="_blank"> - <img src="<?=$this->imageLink('finc_logo.png')?>" alt="<?=$this->transEsc('finc-logo_alt')?>"/> - </a> + <span> + <?= $this->transEsc("Footer-Powered-By-Text") ?> + </span> + <?= $this->externalLink("https://vufind.org", '<img src="' . $this->imageLink('vufind_logo.png') . '" alt="' . $this->translate('vufind-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('vufind-logo_title')]) ?> + <?= $this->externalLink("http://blog.finc.info", '<img src="' . $this->imageLink('finc_logo.png') . '" alt="' . $this->translate('finc-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('finc-logo_title'), 'aria-hidden' => 'true']) ?> </div> </div> </footer>