From 8e43f84c7cdf60010d4710f29de07f1bbdfc9d22 Mon Sep 17 00:00:00 2001 From: Kyle Huynh Date: Wed, 7 Jun 2023 10:58:55 -0400 Subject: [PATCH] Fixed code standard for t() --- src/Form/AdvancedSearchForm.php | 2 +- src/Form/SearchForm.php | 4 ++-- src/Plugin/Block/SearchResultsPagerBlock.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Form/AdvancedSearchForm.php b/src/Form/AdvancedSearchForm.php index 587df40..1dc20c0 100644 --- a/src/Form/AdvancedSearchForm.php +++ b/src/Form/AdvancedSearchForm.php @@ -273,7 +273,7 @@ class AdvancedSearchForm extends FormBase { ], ]; - $options = (self::getEdismaxSearch() && self::getSearchAllFields()) ? ["all" => $this->t("@", self::getEdismaxSearchLabel())] + $this->fieldOptions($fields) : $this->fieldOptions($fields); + $options = (self::getEdismaxSearch() && self::getSearchAllFields()) ? ["all" => $this->t("@label", ["@label" => self::getEdismaxSearchLabel()])] + $this->fieldOptions($fields) : $this->fieldOptions($fields); $term_default_values = $this->defaultTermValues($options); [$recursive, $term_values] = $this->processInput($form_state, $term_default_values); $i = 0; diff --git a/src/Form/SearchForm.php b/src/Form/SearchForm.php index d1a547f..c038ffa 100644 --- a/src/Form/SearchForm.php +++ b/src/Form/SearchForm.php @@ -82,8 +82,8 @@ class SearchForm extends FormBase { '#type' => 'textfield', '#title' => (!empty($settings['search_textfield_label']) ? $settings['search_textfield_label'] : ''), '#attributes' => [ - 'placeholder' => isset($settings['search_placeholder']) ? $this->t("@", $settings['search_placeholder']) : $this->t("Search collections"), - 'aria-label' => (isset($settings['search_textfield_label']) ? $this->t("@", $settings['search_textfield_label']) : $this->t('Enter Keyword')), + 'placeholder' => isset($settings['search_placeholder']) ? $this->t("@placeholder", ["@placeholder" => $settings['search_placeholder']]) : $this->t("Search collections"), + 'aria-label' => (isset($settings['search_textfield_label']) ? $this->t("@label", ["@label" => $settings['search_textfield_label']]) : $this->t('Enter Keyword')), ], '#theme_wrappers' => [], ]; diff --git a/src/Plugin/Block/SearchResultsPagerBlock.php b/src/Plugin/Block/SearchResultsPagerBlock.php index caa8626..687822d 100644 --- a/src/Plugin/Block/SearchResultsPagerBlock.php +++ b/src/Plugin/Block/SearchResultsPagerBlock.php @@ -186,7 +186,7 @@ class SearchResultsPagerBlock extends BlockBase implements ContainerFactoryPlugi '#url' => $url, '#title' => $items_per_page, '#attributes' => [ - 'aria-label' => $this->t("@ items per page", $items_per_page), + 'aria-label' => $this->t("@item items per page", ["@item" => $items_per_page]), 'class' => $active ? ['pager__link', 'pager__link--is-active', 'pager__itemsperpage'] : ['pager__link', 'pager__itemsperpage'], @@ -250,7 +250,7 @@ class SearchResultsPagerBlock extends BlockBase implements ContainerFactoryPlugi 'class' => $active ? ['pager__link', 'pager__link--is-active', 'pager__display'] : ['pager__link', 'pager__display'], - 'aria-label' => $this->t("Display as @", Markup::create($text)), + 'aria-label' => $this->t("Display as @link", ["@link" => Markup::create($text)]), ], '#wrapper_attributes' => [ 'class' => $active ? ['pager__item', 'is-active'] : ['pager__item'],