From b8b34e45b23124282409117d27e8f84350871bb3 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 17 Jul 2017 16:43:48 -0400 Subject: [PATCH] Fixed missing translations in Channels interface. --- languages/en.ini | 1 + module/VuFind/src/VuFind/ChannelProvider/Facets.php | 5 ++++- themes/bootstrap3/templates/channels/channelList.phtml | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/languages/en.ini b/languages/en.ini index 5f326bd9d3b..c7d9c55e5cd 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -175,6 +175,7 @@ channel_add_more = "Add more channels like this" channel_expand = "Explore related channels" channel_explore = "Explore Channels" channel_search = "Show items as search results" +channel_searchbox_label = "Search for more channels:" Check Hold = "Check Hold" Check Recall = "Check Recall" Checked Out = "Checked Out" diff --git a/module/VuFind/src/VuFind/ChannelProvider/Facets.php b/module/VuFind/src/VuFind/ChannelProvider/Facets.php index 6fe9e3e40d9..ba027d7e947 100644 --- a/module/VuFind/src/VuFind/ChannelProvider/Facets.php +++ b/module/VuFind/src/VuFind/ChannelProvider/Facets.php @@ -26,6 +26,7 @@ * @link https://vufind.org/wiki/development Wiki */ namespace VuFind\ChannelProvider; +use VuFind\I18n\Translator\TranslatorAwareInterface; use VuFind\RecordDriver\AbstractBase as RecordDriver; use VuFind\Search\Base\Params, VuFind\Search\Base\Results; use VuFind\Search\Results\PluginManager as ResultsManager; @@ -41,7 +42,9 @@ use Zend\Mvc\Controller\Plugin\Url; * @link https://vufind.org/wiki/development Wiki */ class Facets extends AbstractChannelProvider + implements TranslatorAwareInterface { + use \VuFind\I18n\Translator\TranslatorAwareTrait; /** * Facet fields to use (field name => description). * @@ -311,7 +314,7 @@ class Facets extends AbstractChannelProvider return $this->buildChannel( $results, "$field:{$value['value']}", - "{$this->fields[$field]}: {$value['displayText']}", + $this->translate($this->fields[$field]) . ": {$value['displayText']}", $tokenOnly ); } diff --git a/themes/bootstrap3/templates/channels/channelList.phtml b/themes/bootstrap3/templates/channels/channelList.phtml index b1dcfc1ecae..e79e2111784 100644 --- a/themes/bootstrap3/templates/channels/channelList.phtml +++ b/themes/bootstrap3/templates/channels/channelList.phtml @@ -12,9 +12,9 @@ <? if (empty($token)): ?> <form action="<?=$this->url('channels-search')?>" class="form-inline"> - Search for more channels: + <?=$this->transEsc('channel_searchbox_label')?> <input type="text" name="lookfor" class="form-control" value="<?=$this->escapeHtmlAttr($this->lookfor) ?>"/> - <input type="submit" class="btn btn-default" /> + <input type="submit" value="<?=$this->escapeHtmlAttr($this->translate('Submit'))?>" class="btn btn-default" /> </form> <? endif; ?> -- GitLab