Commit 2dff074c authored by dhruveshdtripathi's avatar dhruveshdtripathi Committed by NickWilde

Issue #2862100 by dhruveshdtripathi, hiramanpatil: $this->t() should be used...

Issue #2862100 by dhruveshdtripathi, hiramanpatil: $this->t() should be used instead of t() in PagerFields class
parent 8a9a8fde
......@@ -46,10 +46,10 @@ class PagerFields extends ViewsSlideshowWidgetBase {
// Add ability to choose which fields to show in the pager.
$form['views_slideshow_pager_fields_fields'] = [
'#type' => 'checkboxes',
'#title' => t('Pager fields'),
'#title' => $this->t('Pager fields'),
'#options' => $options,
'#default_value' => $this->getConfiguration()['views_slideshow_pager_fields_fields'],
'#description' => t('Choose the fields that will appear in the pager.'),
'#description' => $this->t('Choose the fields that will appear in the pager.'),
'#states' => [
'visible' => [
':input[name="' . $this->getConfiguration()['dependency'] . '[enable]"]' => ['checked' => TRUE],
......@@ -62,9 +62,9 @@ class PagerFields extends ViewsSlideshowWidgetBase {
// hover.
$form['views_slideshow_pager_fields_hover'] = [
'#type' => 'checkbox',
'#title' => t('Activate Slide and Pause on Pager Hover'),
'#title' => $this->t('Activate Slide and Pause on Pager Hover'),
'#default_value' => $this->getConfiguration()['views_slideshow_pager_fields_hover'],
'#description' => t('Should the slide be activated and paused when hovering over a pager item.'),
'#description' => $this->t('Should the slide be activated and paused when hovering over a pager item.'),
'#states' => [
'visible' => [
':input[name="' . $this->getConfiguration()['dependency'] . '[enable]"]' => ['checked' => TRUE],
......
......@@ -51,8 +51,8 @@ class Controls extends ViewsSlideshowWidgetTypeBase {
// Create the widget type field.
$form['type'] = [
'#type' => 'select',
'#title' => t('Controls Type'),
'#description' => t('Style of the controls'),
'#title' => $this->t('Controls Type'),
'#description' => $this->t('Style of the controls'),
'#default_value' => $this->getConfiguration()['type'],
'#options' => $options,
'#states' => [
......
......@@ -73,8 +73,8 @@ class Pager extends ViewsSlideshowWidgetTypeBase {
// Create the widget type field.
$form['type'] = [
'#type' => 'select',
'#title' => t('Pager Type'),
'#description' => t('Style of the pager'),
'#title' => $this->t('Pager Type'),
'#description' => $this->t('Style of the pager'),
'#default_value' => $this->getConfiguration()['type'],
'#options' => $widgets,
'#states' => [
......
......@@ -93,7 +93,7 @@ class Slideshow extends StylePluginBase {
// Skins.
$form['slideshow_skin_header'] = [
'#markup' => '<h2>' . t('Style') . '</h2>',
'#markup' => '<h2>' . $this->t('Style') . '</h2>',
];
/* @var \Drupal\Component\Plugin\PluginManagerInterface */
......@@ -109,15 +109,15 @@ class Slideshow extends StylePluginBase {
// Create the drop down box so users can choose an available skin.
$form['slideshow_skin'] = [
'#type' => 'select',
'#title' => t('Skin'),
'#title' => $this->t('Skin'),
'#options' => $skins,
'#default_value' => $this->options['slideshow_skin'],
'#description' => t('Select the skin to use for this display. Skins allow for easily swappable layouts of things like next/prev links and thumbnails. Note that not all skins support all widgets, so a combination of skins and widgets may lead to unpredictable results in layout.'),
'#description' => $this->t('Select the skin to use for this display. Skins allow for easily swappable layouts of things like next/prev links and thumbnails. Note that not all skins support all widgets, so a combination of skins and widgets may lead to unpredictable results in layout.'),
];
// Slides.
$form['slides_header'] = [
'#markup' => '<h2>' . t('Slides') . '</h2>',
'#markup' => '<h2>' . $this->t('Slides') . '</h2>',
];
// Get all slideshow types.
......@@ -134,7 +134,7 @@ class Slideshow extends StylePluginBase {
$form['slideshow_type'] = [
'#type' => 'select',
'#title' => t('Slideshow Type'),
'#title' => $this->t('Slideshow Type'),
'#options' => $slideshow_options,
'#default_value' => $this->options['slideshow_type'],
];
......@@ -149,7 +149,7 @@ class Slideshow extends StylePluginBase {
$form[$id] = [
'#type' => 'fieldset',
'#title' => t('@module options', ['@module' => $definition['label']]),
'#title' => $this->t('@module options', ['@module' => $definition['label']]),
'#collapsible' => TRUE,
'#attributes' => ['class' => [$id]],
'#states' => [
......@@ -164,23 +164,23 @@ class Slideshow extends StylePluginBase {
}
else {
$form['enable_module'] = [
'#markup' => t('There is no Views Slideshow plugin enabled. Go to the @modules and enable a Views Slideshow plugin module. For example Views Slideshow Cycle.', ['@modules' => Link::fromTextAndUrl(t('Modules Page'), Url::fromRoute('system.modules_list'))->toString()]),
'#markup' => $this->t('There is no Views Slideshow plugin enabled. Go to the @modules and enable a Views Slideshow plugin module. For example Views Slideshow Cycle.', ['@modules' => Link::fromTextAndUrl($this->t('Modules Page'), Url::fromRoute('system.modules_list'))->toString()]),
];
}
// Widgets.
// @todo: Improve the UX by using Ajax.
$form['widgets_header'] = [
'#markup' => '<h2>' . t('Widgets') . '</h2>',
'#markup' => '<h2>' . $this->t('Widgets') . '</h2>',
];
// Define the available locations.
$location = ['top' => t('Top'), 'bottom' => t('Bottom')];
$location = ['top' => $this->t('Top'), 'bottom' => $this->t('Bottom')];
// Loop through all locations so we can add header for each location.
foreach ($location as $location_id => $location_name) {
$form['widgets'][$location_id]['header'] = [
'#markup' => '<h3>' . t('@location Widgets', ['@location' => $location_name]) . '</h3>',
'#markup' => '<h3>' . $this->t('@location Widgets', ['@location' => $location_name]) . '</h3>',
];
}
......@@ -218,7 +218,7 @@ class Slideshow extends StylePluginBase {
'#type' => 'checkbox',
'#title' => $widget_info['label'],
'#default_value' => $this->options['widgets'][$location_id][$widget_id]['enable'],
'#description' => t('Should @name be rendered at the @location of the slides.', ['@name' => $widget_info['label'], '@location' => $location_name]),
'#description' => $this->t('Should @name be rendered at the @location of the slides.', ['@name' => $widget_info['label'], '@location' => $location_name]),
'#dependency' => [
'edit-style-options-slideshow-type' => $compatible_slideshows,
],
......@@ -239,10 +239,10 @@ class Slideshow extends StylePluginBase {
}
$form['widgets'][$location_id][$widget_id]['weight'] = [
'#type' => 'select',
'#title' => t('Weight of the @name', ['@name' => $widget_info['label']]),
'#title' => $this->t('Weight of the @name', ['@name' => $widget_info['label']]),
'#default_value' => $weight,
'#options' => $weights,
'#description' => t('Determines in what order the @name appears. A lower weight will cause the @name to be above higher weight items.', ['@name' => $widget_info['label']]),
'#description' => $this->t('Determines in what order the @name appears. A lower weight will cause the @name to be above higher weight items.', ['@name' => $widget_info['label']]),
'#prefix' => '<div class="vs-dependent">',
'#suffix' => '</div>',
'#states' => [
......
......@@ -36,9 +36,9 @@ abstract class ViewsSlideshowWidgetTypeBase extends PluginBase implements ViewsS
// one slide.
$form['hide_on_single_slide'] = [
'#type' => 'checkbox',
'#title' => t('Hide controls if there is only one slide'),
'#title' => $this->t('Hide controls if there is only one slide'),
'#default_value' => $this->getConfiguration()['hide_on_single_slide'],
'#description' => t('Should the controls be hidden if there is only one slide.'),
'#description' => $this->t('Should the controls be hidden if there is only one slide.'),
'#states' => [
'visible' => [
':input[name="' . $this->getConfiguration()['dependency'] . '[enable]"]' => ['checked' => TRUE],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment