Loading CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx joshi.rohit100, baikho, valthebald: Drupal 9 compatibility fixes. #3124039 by Grayle: Migration plugins alter does not check for presence of migration_tags. #3124042 by Neslee Canil Pinto: t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead. Metatag 8.x-1.12, 2020-03-30 Loading metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php +4 −1 Original line number Diff line number Diff line Loading @@ -5,12 +5,15 @@ namespace Drupal\metatag_hreflang\Plugin\Derivative; use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Create a new hreflang tag plugin for each enabled language. */ class HreflangDeriver extends DeriverBase { use StringTranslationTrait; /** * {@inheritdoc} */ Loading Loading @@ -40,7 +43,7 @@ class HreflangDeriver extends DeriverBase { // The 'name' value is used as the value of the 'hreflang' attribute on // the HTML tag. $derivative['name'] = $langcode; $derivative['label'] = t("URL for a version of this page in %langcode", ['%langcode' => $language->getName()]); $derivative['label'] = $this->t("URL for a version of this page in %langcode", ['%langcode' => $language->getName()]); $derivative['description'] = ''; // Reference derivatives based on their UUID instead of the record ID. Loading metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php +11 −8 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * The Twitter Cards Type-tag. Loading @@ -21,6 +22,8 @@ use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; */ class TwitterCardsType extends MetaNameBase { use StringTranslationTrait; /** * {@inheritdoc} */ Loading @@ -30,15 +33,15 @@ class TwitterCardsType extends MetaNameBase { '#title' => $this->label(), '#description' => $this->description(), '#options' => [ 'summary' => t('Summary Card'), 'summary_large_image' => t('Summary Card with large image'), 'photo' => t('Photo Card'), 'gallery' => t('Gallery Card'), 'app' => t('App Card'), 'player' => t('Player Card'), 'product' => t('Product Card'), 'summary' => $this->t('Summary Card'), 'summary_large_image' => $this->t('Summary Card with large image'), 'photo' => $this->t('Photo Card'), 'gallery' => $this->t('Gallery Card'), 'app' => $this->t('App Card'), 'player' => $this->t('Player Card'), 'product' => $this->t('Product Card'), ], '#empty_option' => t('- None -'), '#empty_option' => $this->t('- None -'), '#empty_value' => '', '#default_value' => $this->value(), '#required' => isset($element['#required']) ? $element['#required'] : FALSE, Loading metatag_views/src/Form/MetatagViewsTranslationForm.php +4 −2 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\metatag\MetatagToken; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\language\ConfigurableLanguageManagerInterface; use Drupal\metatag_views\MetatagViewsValuesCleanerTrait; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Class MetatagViewsEditForm. Loading @@ -20,6 +21,7 @@ use Drupal\metatag_views\MetatagViewsValuesCleanerTrait; class MetatagViewsTranslationForm extends FormBase { use MetatagViewsValuesCleanerTrait; use StringTranslationTrait; /** * Drupal\metatag\MetatagManager definition. Loading Loading @@ -177,12 +179,12 @@ class MetatagViewsTranslationForm extends FormBase { ]); $form['metatags'] = $this->form($form, $this->prepareValues()); $form['metatags']['#title'] = t('Metatags'); $form['metatags']['#title'] = $this->t('Metatags'); $form['metatags']['#type'] = 'fieldset'; $form['submit'] = [ '#type' => 'submit', '#value' => t('Submit'), '#value' => $this->t('Submit'), ]; return $form; Loading metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php +7 −4 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\metatag_views\Plugin\views\display_extender; use Drupal\Core\Form\FormStateInterface; use Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Metatag display extender plugin. Loading @@ -20,6 +21,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class MetatagDisplayExtender extends DisplayExtenderPluginBase { use StringTranslationTrait; /** * The metatag manager. * Loading Loading @@ -52,7 +55,7 @@ class MetatagDisplayExtender extends DisplayExtenderPluginBase { public function buildOptionsForm(&$form, FormStateInterface $form_state) { if ($form_state->get('section') == 'metatags') { $form['#title'] .= t('The meta tags for this display'); $form['#title'] .= $this->t('The meta tags for this display'); $metatags = $this->getMetatags(); // Build/inject the Metatag form. Loading Loading @@ -106,13 +109,13 @@ class MetatagDisplayExtender extends DisplayExtenderPluginBase { */ public function optionsSummary(&$categories, &$options) { $categories['metatags'] = [ 'title' => t('Meta tags'), 'title' => $this->t('Meta tags'), 'column' => 'second', ]; $options['metatags'] = [ 'category' => 'metatags', 'title' => t('Meta tags'), 'value' => $this->hasMetatags() ? t('Overridden') : t('Using defaults'), 'title' => $this->t('Meta tags'), 'value' => $this->hasMetatags() ? $this->t('Overridden') : $this->t('Using defaults'), ]; } Loading Loading
CHANGELOG.txt +2 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx joshi.rohit100, baikho, valthebald: Drupal 9 compatibility fixes. #3124039 by Grayle: Migration plugins alter does not check for presence of migration_tags. #3124042 by Neslee Canil Pinto: t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead. Metatag 8.x-1.12, 2020-03-30 Loading
metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php +4 −1 Original line number Diff line number Diff line Loading @@ -5,12 +5,15 @@ namespace Drupal\metatag_hreflang\Plugin\Derivative; use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Create a new hreflang tag plugin for each enabled language. */ class HreflangDeriver extends DeriverBase { use StringTranslationTrait; /** * {@inheritdoc} */ Loading Loading @@ -40,7 +43,7 @@ class HreflangDeriver extends DeriverBase { // The 'name' value is used as the value of the 'hreflang' attribute on // the HTML tag. $derivative['name'] = $langcode; $derivative['label'] = t("URL for a version of this page in %langcode", ['%langcode' => $language->getName()]); $derivative['label'] = $this->t("URL for a version of this page in %langcode", ['%langcode' => $language->getName()]); $derivative['description'] = ''; // Reference derivatives based on their UUID instead of the record ID. Loading
metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsType.php +11 −8 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\metatag_twitter_cards\Plugin\metatag\Tag; use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * The Twitter Cards Type-tag. Loading @@ -21,6 +22,8 @@ use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase; */ class TwitterCardsType extends MetaNameBase { use StringTranslationTrait; /** * {@inheritdoc} */ Loading @@ -30,15 +33,15 @@ class TwitterCardsType extends MetaNameBase { '#title' => $this->label(), '#description' => $this->description(), '#options' => [ 'summary' => t('Summary Card'), 'summary_large_image' => t('Summary Card with large image'), 'photo' => t('Photo Card'), 'gallery' => t('Gallery Card'), 'app' => t('App Card'), 'player' => t('Player Card'), 'product' => t('Product Card'), 'summary' => $this->t('Summary Card'), 'summary_large_image' => $this->t('Summary Card with large image'), 'photo' => $this->t('Photo Card'), 'gallery' => $this->t('Gallery Card'), 'app' => $this->t('App Card'), 'player' => $this->t('Player Card'), 'product' => $this->t('Product Card'), ], '#empty_option' => t('- None -'), '#empty_option' => $this->t('- None -'), '#empty_value' => '', '#default_value' => $this->value(), '#required' => isset($element['#required']) ? $element['#required'] : FALSE, Loading
metatag_views/src/Form/MetatagViewsTranslationForm.php +4 −2 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Drupal\metatag\MetatagToken; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\language\ConfigurableLanguageManagerInterface; use Drupal\metatag_views\MetatagViewsValuesCleanerTrait; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Class MetatagViewsEditForm. Loading @@ -20,6 +21,7 @@ use Drupal\metatag_views\MetatagViewsValuesCleanerTrait; class MetatagViewsTranslationForm extends FormBase { use MetatagViewsValuesCleanerTrait; use StringTranslationTrait; /** * Drupal\metatag\MetatagManager definition. Loading Loading @@ -177,12 +179,12 @@ class MetatagViewsTranslationForm extends FormBase { ]); $form['metatags'] = $this->form($form, $this->prepareValues()); $form['metatags']['#title'] = t('Metatags'); $form['metatags']['#title'] = $this->t('Metatags'); $form['metatags']['#type'] = 'fieldset'; $form['submit'] = [ '#type' => 'submit', '#value' => t('Submit'), '#value' => $this->t('Submit'), ]; return $form; Loading
metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php +7 −4 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\metatag_views\Plugin\views\display_extender; use Drupal\Core\Form\FormStateInterface; use Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Metatag display extender plugin. Loading @@ -20,6 +21,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class MetatagDisplayExtender extends DisplayExtenderPluginBase { use StringTranslationTrait; /** * The metatag manager. * Loading Loading @@ -52,7 +55,7 @@ class MetatagDisplayExtender extends DisplayExtenderPluginBase { public function buildOptionsForm(&$form, FormStateInterface $form_state) { if ($form_state->get('section') == 'metatags') { $form['#title'] .= t('The meta tags for this display'); $form['#title'] .= $this->t('The meta tags for this display'); $metatags = $this->getMetatags(); // Build/inject the Metatag form. Loading Loading @@ -106,13 +109,13 @@ class MetatagDisplayExtender extends DisplayExtenderPluginBase { */ public function optionsSummary(&$categories, &$options) { $categories['metatags'] = [ 'title' => t('Meta tags'), 'title' => $this->t('Meta tags'), 'column' => 'second', ]; $options['metatags'] = [ 'category' => 'metatags', 'title' => t('Meta tags'), 'value' => $this->hasMetatags() ? t('Overridden') : t('Using defaults'), 'title' => $this->t('Meta tags'), 'value' => $this->hasMetatags() ? $this->t('Overridden') : $this->t('Using defaults'), ]; } Loading