',
@@ -1650,25 +1650,25 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#tree' => TRUE,
);
$form['style']['type'] = array(
- '#title' => t('Style'),
+ '#title' => $this->t('Style'),
'#title_display' => 'invisible',
'#type' => 'radios',
'#options' => Views::fetchPluginNames('style', $this->getType(), array($this->view->storage->get('base_table'))),
'#default_value' => $style_plugin->definition['id'],
- '#description' => t('If the style you choose has settings, be sure to click the settings button that will appear next to it in the View summary.'),
+ '#description' => $this->t('If the style you choose has settings, be sure to click the settings button that will appear next to it in the View summary.'),
);
if ($style_plugin->usesOptions()) {
$form['markup'] = array(
'#prefix' => '
',
- '#markup' => t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))),
+ '#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))),
);
}
break;
case 'style_options':
- $form['#title'] .= t('Style options');
+ $form['#title'] .= $this->t('Style options');
$style = TRUE;
$style_plugin = $this->getOption('style');
$name = $style_plugin['type'];
@@ -1680,7 +1680,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
}
// if row, $style will be empty.
if (empty($style)) {
- $form['#title'] .= t('Row style options');
+ $form['#title'] .= $this->t('Row style options');
}
$plugin = $this->getPlugin(empty($style) ? 'row' : 'style', $name);
if ($plugin) {
@@ -1691,7 +1691,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
}
break;
case 'row':
- $form['#title'] .= t('How should each row in this view be styled');
+ $form['#title'] .= $this->t('How should each row in this view be styled');
$row_plugin_instance = $this->getPlugin('row');
$form['row'] = array(
'#prefix' => '
',
@@ -1699,7 +1699,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#tree' => TRUE,
);
$form['row']['type'] = array(
- '#title' => t('Row'),
+ '#title' => $this->t('Row'),
'#title_display' => 'invisible',
'#type' => 'radios',
'#options' => Views::fetchPluginNames('row', $this->getType(), array($this->view->storage->get('base_table'))),
@@ -1710,13 +1710,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '
',
'#suffix' => '
',
- '#markup' => t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))),
+ '#markup' => $this->t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))),
);
}
break;
case 'link_display':
- $form['#title'] .= t('Which display to use for path');
+ $form['#title'] .= $this->t('Which display to use for path');
$options = array(FALSE => $this->t('None'), 'custom_url' => $this->t('Custom URL'));
foreach ($this->view->storage->get('display') as $display_id => $display) {
@@ -1728,22 +1728,22 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_display'] = array(
'#type' => 'radios',
'#options' => $options,
- '#description' => t("Which display to use to get this display's path for things like summary links, rss feed links, more links, etc."),
+ '#description' => $this->t("Which display to use to get this display's path for things like summary links, rss feed links, more links, etc."),
'#default_value' => $this->getOption('link_display'),
);
$options = array();
$count = 0; // This lets us prepare the key as we want it printed.
foreach ($this->view->display_handler->getHandlers('argument') as $handler) {
- $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel()));
- $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel()));
+ $options[t('Arguments')]['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel()));
+ $options[t('Arguments')]['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel()));
}
// Default text.
// We have some options, so make a list.
$output = '';
if (!empty($options)) {
- $output = t('
The following tokens are available for this link.
');
+ $output = $this->t('
The following tokens are available for this link.
');
foreach (array_keys($options) as $type) {
if (!empty($options[$type])) {
$items = array();
@@ -1762,9 +1762,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_url'] = array(
'#type' => 'textfield',
- '#title' => t('Custom URL'),
+ '#title' => $this->t('Custom URL'),
'#default_value' => $this->getOption('link_url'),
- '#description' => t('A Drupal path or external URL the more link will point to. Note that this will override the link display setting above.') . $output,
+ '#description' => $this->t('A Drupal path or external URL the more link will point to. Note that this will override the link display setting above.') . $output,
'#states' => array(
'visible' => array(
':input[name="link_display"]' => array('value' => 'custom_url'),
@@ -1773,18 +1773,18 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
break;
case 'exposed_block':
- $form['#title'] .= t('Put the exposed form in a block');
+ $form['#title'] .= $this->t('Put the exposed form in a block');
$form['description'] = array(
- '#markup' => '
' . t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '
',
+ '#markup' => '
' . $this->t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '
',
);
$form['exposed_block'] = array(
'#type' => 'radios',
- '#options' => array(1 => t('Yes'), 0 => t('No')),
+ '#options' => array(1 => $this->t('Yes'), 0 => $this->t('No')),
'#default_value' => $this->getOption('exposed_block') ? 1 : 0,
);
break;
case 'exposed_form':
- $form['#title'] .= t('Exposed Form');
+ $form['#title'] .= $this->t('Exposed Form');
$form['exposed_form'] = array(
'#prefix' => '
',
'#suffix' => '
',
@@ -1793,7 +1793,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$exposed_form = $this->getOption('exposed_form');
$form['exposed_form']['type'] = array(
- '#title' => t('Exposed form'),
+ '#title' => $this->t('Exposed form'),
'#title_display' => 'invisible',
'#type' => 'radios',
'#options' => Views::fetchPluginNames('exposed_form', $this->getType(), array($this->view->storage->get('base_table'))),
@@ -1805,13 +1805,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '
',
'#suffix' => '
',
- '#markup' => t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'exposed_form_options'))),
+ '#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'exposed_form_options'))),
);
}
break;
case 'exposed_form_options':
$plugin = $this->getPlugin('exposed_form');
- $form['#title'] .= t('Exposed form options');
+ $form['#title'] .= $this->t('Exposed form options');
if ($plugin) {
$form['exposed_form_options'] = array(
'#tree' => TRUE,
@@ -1820,7 +1820,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
}
break;
case 'pager':
- $form['#title'] .= t('Select which pager, if any, to use for this view');
+ $form['#title'] .= $this->t('Select which pager, if any, to use for this view');
$form['pager'] = array(
'#prefix' => '
',
'#suffix' => '
',
@@ -1829,7 +1829,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$pager = $this->getOption('pager');
$form['pager']['type'] = array(
- '#title' => t('Pager'),
+ '#title' => $this->t('Pager'),
'#title_display' => 'invisible',
'#type' => 'radios',
'#options' => Views::fetchPluginNames('pager', !$this->usesPager() ? 'basic' : NULL, array($this->view->storage->get('base_table'))),
@@ -1841,14 +1841,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['markup'] = array(
'#prefix' => '
',
'#suffix' => '
',
- '#markup' => t('You may also adjust the !settings for the currently selected pager.', array('!settings' => $this->optionLink(t('settings'), 'pager_options'))),
+ '#markup' => $this->t('You may also adjust the !settings for the currently selected pager.', array('!settings' => $this->optionLink(t('settings'), 'pager_options'))),
);
}
break;
case 'pager_options':
$plugin = $this->getPlugin('pager');
- $form['#title'] .= t('Pager options');
+ $form['#title'] .= $this->t('Pager options');
if ($plugin) {
$form['pager_options'] = array(
'#tree' => TRUE,
@@ -1871,24 +1871,24 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
switch ($section) {
case 'display_title':
if ($form_state->isValueEmpty('display_title')) {
- $form_state->setError($form['display_title'], t('Display title may not be empty.'));
+ $form_state->setError($form['display_title'], $this->t('Display title may not be empty.'));
}
break;
case 'css_class':
$css_class = $form_state->getValue('css_class');
if (preg_match('/[^a-zA-Z0-9-_ ]/', $css_class)) {
- $form_state->setError($form['css_class'], t('CSS classes must be alphanumeric or dashes only.'));
+ $form_state->setError($form['css_class'], $this->t('CSS classes must be alphanumeric or dashes only.'));
}
break;
case 'display_id':
if ($form_state->getValue('display_id')) {
if (preg_match('/[^a-z0-9_]/', $form_state->getValue('display_id'))) {
- $form_state->setError($form['display_id'], t('Display name must be letters, numbers, or underscores only.'));
+ $form_state->setError($form['display_id'], $this->t('Display name must be letters, numbers, or underscores only.'));
}
foreach ($this->view->displayHandlers as $id => $display) {
if ($id != $this->view->current_display && ($form_state->getValue('display_id') == $id || (isset($display->new_id) && $form_state->getValue('display_id') == $display->new_id))) {
- $form_state->setError($form['display_id'], t('Display id should be unique.'));
+ $form_state->setError($form['display_id'], $this->t('Display id should be unique.'));
}
}
}
@@ -2337,18 +2337,18 @@ public function validate() {
}
if (!$fields) {
- $errors[] = t('Display "@display" uses fields but there are none defined for it or all are excluded.', array('@display' => $this->display['display_title']));
+ $errors[] = $this->t('Display "@display" uses fields but there are none defined for it or all are excluded.', array('@display' => $this->display['display_title']));
}
}
if ($this->hasPath() && !$this->getOption('path')) {
- $errors[] = t('Display "@display" uses a path but the path is undefined.', array('@display' => $this->display['display_title']));
+ $errors[] = $this->t('Display "@display" uses a path but the path is undefined.', array('@display' => $this->display['display_title']));
}
// Validate style plugin
$style = $this->getPlugin('style');
if (empty($style)) {
- $errors[] = t('Display "@display" has an invalid style plugin.', array('@display' => $this->display['display_title']));
+ $errors[] = $this->t('Display "@display" has an invalid style plugin.', array('@display' => $this->display['display_title']));
}
else {
$result = $style->validate();
@@ -2459,7 +2459,7 @@ public function getSpecialBlocks() {
if ($this->usesExposedFormInBlock()) {
$delta = '-exp-' . $this->view->storage->id() . '-' . $this->display['id'];
- $desc = t('Exposed form: @view-@display_id', array('@view' => $this->view->storage->id(), '@display_id' => $this->display['id']));
+ $desc = $this->t('Exposed form: @view-@display_id', array('@view' => $this->view->storage->id(), '@display_id' => $this->display['id']));
$blocks[$delta] = array(
'info' => $desc,
@@ -2502,9 +2502,9 @@ public function viewExposedFormBlocks() {
*/
public function getArgumentText() {
return array(
- 'filter value not present' => t('When the filter value is
NOT available'),
- 'filter value present' => t('When the filter value
IS available or a default is provided'),
- 'description' => t("This display does not have a source for contextual filters, so no contextual filter value will be available unless you select 'Provide default'."),
+ 'filter value not present' => $this->t('When the filter value is
NOT available'),
+ 'filter value present' => $this->t('When the filter value
IS available or a default is provided'),
+ 'description' => $this->t("This display does not have a source for contextual filters, so no contextual filter value will be available unless you select 'Provide default'."),
);
}
@@ -2516,8 +2516,8 @@ public function getArgumentText() {
*/
public function getPagerText() {
return array(
- 'items per page title' => t('Items to display'),
- 'items per page description' => t('Enter 0 for no limit.')
+ 'items per page title' => $this->t('Items to display'),
+ 'items per page description' => $this->t('Enter 0 for no limit.')
);
}
diff --git a/core/modules/views/src/Plugin/views/display/Feed.php b/core/modules/views/src/Plugin/views/display/Feed.php
index cf556e1..8c1a89a 100644
--- a/core/modules/views/src/Plugin/views/display/Feed.php
+++ b/core/modules/views/src/Plugin/views/display/Feed.php
@@ -157,7 +157,7 @@ public function optionsSummary(&$categories, &$options) {
// Since we're childing off the 'path' type, we'll still *call* our
// category 'page' but let's override it so it says feed settings.
$categories['page'] = array(
- 'title' => t('Feed settings'),
+ 'title' => $this->t('Feed settings'),
'column' => 'second',
'build' => array(
'#weight' => -10,
@@ -165,12 +165,12 @@ public function optionsSummary(&$categories, &$options) {
);
if ($this->getOption('sitename_title')) {
- $options['title']['value'] = t('Using the site name');
+ $options['title']['value'] = $this->t('Using the site name');
}
$displays = array_filter($this->getOption('displays'));
if (count($displays) > 1) {
- $attach_to = t('Multiple displays');
+ $attach_to = $this->t('Multiple displays');
}
elseif (count($displays) == 1) {
$display = array_shift($displays);
@@ -181,12 +181,12 @@ public function optionsSummary(&$categories, &$options) {
}
if (!isset($attach_to)) {
- $attach_to = t('None');
+ $attach_to = $this->t('None');
}
$options['displays'] = array(
'category' => 'page',
- 'title' => t('Attach to'),
+ 'title' => $this->t('Attach to'),
'value' => $attach_to,
);
}
@@ -205,7 +205,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
unset($form['title']);
$form['sitename_title'] = array(
'#type' => 'checkbox',
- '#title' => t('Use the site name for the title'),
+ '#title' => $this->t('Use the site name for the title'),
'#default_value' => $this->getOption('sitename_title'),
);
$form['title'] = $title;
@@ -216,7 +216,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
break;
case 'displays':
- $form['#title'] .= t('Attach to');
+ $form['#title'] .= $this->t('Attach to');
$displays = array();
foreach ($this->view->storage->get('display') as $display_id => $display) {
// @todo The display plugin should have display_title and id as well.
@@ -225,15 +225,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
}
}
$form['displays'] = array(
- '#title' => t('Displays'),
+ '#title' => $this->t('Displays'),
'#type' => 'checkboxes',
- '#description' => t('The feed icon will be available only to the selected displays.'),
+ '#description' => $this->t('The feed icon will be available only to the selected displays.'),
'#options' => $displays,
'#default_value' => $this->getOption('displays'),
);
break;
case 'path':
- $form['path']['#description'] = t('This view will be displayed by visiting this path on your site. It is recommended that the path be something like "path/%/%/feed" or "path/%/%/rss.xml", putting one % in the path for each contextual filter you have defined in the view.');
+ $form['path']['#description'] = $this->t('This view will be displayed by visiting this path on your site. It is recommended that the path be something like "path/%/%/feed" or "path/%/%/rss.xml", putting one % in the path for each contextual filter you have defined in the view.');
}
}
diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php
index cd06df0..08da0a2 100644
--- a/core/modules/views/src/Plugin/views/display/Page.php
+++ b/core/modules/views/src/Plugin/views/display/Page.php
@@ -122,28 +122,28 @@ public function optionsSummary(&$categories, &$options) {
switch ($menu['type']) {
case 'none':
default:
- $menu_str = t('No menu');
+ $menu_str = $this->t('No menu');
break;
case 'normal':
- $menu_str = t('Normal: @title', array('@title' => $menu['title']));
+ $menu_str = $this->t('Normal: @title', array('@title' => $menu['title']));
break;
case 'tab':
case 'default tab':
- $menu_str = t('Tab: @title', array('@title' => $menu['title']));
+ $menu_str = $this->t('Tab: @title', array('@title' => $menu['title']));
break;
}
$options['menu'] = array(
'category' => 'page',
- 'title' => t('Menu'),
+ 'title' => $this->t('Menu'),
'value' => views_ui_truncate($menu_str, 24),
);
// This adds a 'Settings' link to the style_options setting if the style
// has options.
if ($menu['type'] == 'default tab') {
- $options['menu']['setting'] = t('Parent menu item');
- $options['menu']['links']['tab_options'] = t('Change settings for the parent menu');
+ $options['menu']['setting'] = $this->t('Parent menu item');
+ $options['menu']['links']['tab_options'] = $this->t('Change settings for the parent menu');
}
}
@@ -155,7 +155,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
switch ($form_state->get('section')) {
case 'menu':
- $form['#title'] .= t('Menu item entry');
+ $form['#title'] .= $this->t('Menu item entry');
$form['menu'] = array(
'#prefix' => '
',
'#suffix' => '
',
@@ -168,20 +168,20 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['menu']['type'] = array(
'#prefix' => '
',
'#suffix' => '
',
- '#title' => t('Type'),
+ '#title' => $this->t('Type'),
'#type' => 'radios',
'#options' => array(
- 'none' => t('No menu entry'),
- 'normal' => t('Normal menu entry'),
- 'tab' => t('Menu tab'),
- 'default tab' => t('Default menu tab')
+ 'none' => $this->t('No menu entry'),
+ 'normal' => $this->t('Normal menu entry'),
+ 'tab' => $this->t('Menu tab'),
+ 'default tab' => $this->t('Default menu tab')
),
'#default_value' => $menu['type'],
);
$form['menu']['title'] = array(
'#prefix' => '
',
- '#title' => t('Menu link title'),
+ '#title' => $this->t('Menu link title'),
'#type' => 'textfield',
'#default_value' => $menu['title'],
'#states' => array(
@@ -199,10 +199,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['menu']['description'] = array(
- '#title' => t('Description'),
+ '#title' => $this->t('Description'),
'#type' => 'textfield',
'#default_value' => $menu['description'],
- '#description' => t("Shown when hovering over the menu link."),
+ '#description' => $this->t("Shown when hovering over the menu link."),
'#states' => array(
'visible' => array(
array(
@@ -244,14 +244,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#value' => $menu_parent,
);
$form['menu']['markup'] = array(
- '#markup' => t('Menu selection requires the activation of Menu UI module.'),
+ '#markup' => $this->t('Menu selection requires the activation of Menu UI module.'),
);
}
$form['menu']['weight'] = array(
- '#title' => t('Weight'),
+ '#title' => $this->t('Weight'),
'#type' => 'textfield',
'#default_value' => isset($menu['weight']) ? $menu['weight'] : 0,
- '#description' => t('In the menu, the heavier links will sink and the lighter links will be positioned nearer the top.'),
+ '#description' => $this->t('In the menu, the heavier links will sink and the lighter links will be positioned nearer the top.'),
'#states' => array(
'visible' => array(
array(
@@ -267,11 +267,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['menu']['context'] = array(
- '#title' => t('Context'),
+ '#title' => $this->t('Context'),
'#suffix' => '
',
'#type' => 'checkbox',
'#default_value' => !empty($menu['context']),
- '#description' => t('Displays the link in contextual links'),
+ '#description' => $this->t('Displays the link in contextual links'),
'#states' => array(
'visible' => array(
':input[name="menu[type]"]' => array('value' => 'tab'),
@@ -280,14 +280,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
break;
case 'tab_options':
- $form['#title'] .= t('Default tab options');
+ $form['#title'] .= $this->t('Default tab options');
$tab_options = $this->getOption('tab_options');
if (empty($tab_options)) {
$tab_options = array('type' => 'none', 'title' => '', 'weight' => 0);
}
$form['tab_markup'] = array(
- '#markup' => '
' . t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is foo/bar/baz, the parent path would be foo/bar.') . '
',
+ '#markup' => '
' . $this->t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is foo/bar/baz, the parent path would be foo/bar.') . '
',
);
$form['tab_options'] = array(
@@ -298,17 +298,17 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['tab_options']['type'] = array(
'#prefix' => '
',
'#suffix' => '
',
- '#title' => t('Parent menu item'),
+ '#title' => $this->t('Parent menu item'),
'#type' => 'radios',
- '#options' => array('none' => t('Already exists'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')),
+ '#options' => array('none' => $this->t('Already exists'), 'normal' => $this->t('Normal menu item'), 'tab' => $this->t('Menu tab')),
'#default_value' => $tab_options['type'],
);
$form['tab_options']['title'] = array(
'#prefix' => '
',
- '#title' => t('Title'),
+ '#title' => $this->t('Title'),
'#type' => 'textfield',
'#default_value' => $tab_options['title'],
- '#description' => t('If creating a parent menu item, enter the title of the item.'),
+ '#description' => $this->t('If creating a parent menu item, enter the title of the item.'),
'#states' => array(
'visible' => array(
array(
@@ -321,10 +321,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['tab_options']['description'] = array(
- '#title' => t('Description'),
+ '#title' => $this->t('Description'),
'#type' => 'textfield',
'#default_value' => $tab_options['description'],
- '#description' => t('If creating a parent menu item, enter the description of the item.'),
+ '#description' => $this->t('If creating a parent menu item, enter the description of the item.'),
'#states' => array(
'visible' => array(
array(
@@ -339,11 +339,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
// Only display the menu selector if Menu UI module is enabled.
if (\Drupal::moduleHandler()->moduleExists('menu_ui')) {
$form['tab_options']['name'] = array(
- '#title' => t('Menu'),
+ '#title' => $this->t('Menu'),
'#type' => 'select',
'#options' => menu_ui_get_menus(),
'#default_value' => $tab_options['name'],
- '#description' => t('Insert item into an available menu.'),
+ '#description' => $this->t('Insert item into an available menu.'),
'#states' => array(
'visible' => array(
':input[name="tab_options[type]"]' => array('value' => 'normal'),
@@ -357,16 +357,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#value' => $tab_options['menu_name'],
);
$form['tab_options']['markup'] = array(
- '#markup' => t('Menu selection requires the activation of Menu UI module.'),
+ '#markup' => $this->t('Menu selection requires the activation of Menu UI module.'),
);
}
$form['tab_options']['weight'] = array(
'#suffix' => '
',
- '#title' => t('Tab weight'),
+ '#title' => $this->t('Tab weight'),
'#type' => 'textfield',
'#default_value' => $tab_options['weight'],
'#size' => 5,
- '#description' => t('If the parent menu item is a tab, enter the weight of the tab. Heavier tabs will sink and the lighter tabs will be positioned nearer to the first menu item.'),
+ '#description' => $this->t('If the parent menu item is a tab, enter the weight of the tab. Heavier tabs will sink and the lighter tabs will be positioned nearer to the first menu item.'),
'#states' => array(
'visible' => array(
':input[name="tab_options[type]"]' => array('value' => 'tab'),
@@ -387,19 +387,19 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
$path = $this->getOption('path');
$menu_type = $form_state->getValue(array('menu', 'type'));
if ($menu_type == 'normal' && strpos($path, '%') !== FALSE) {
- $form_state->setError($form['menu']['type'], t('Views cannot create normal menu items for paths with a % in them.'));
+ $form_state->setError($form['menu']['type'], $this->t('Views cannot create normal menu items for paths with a % in them.'));
}
if ($menu_type == 'default tab' || $menu_type == 'tab') {
$bits = explode('/', $path);
$last = array_pop($bits);
if ($last == '%') {
- $form_state->setError($form['menu']['type'], t('A display whose path ends with a % cannot be a tab.'));
+ $form_state->setError($form['menu']['type'], $this->t('A display whose path ends with a % cannot be a tab.'));
}
}
if ($menu_type != 'none' && $form_state->isValueEmpty(array('menu', 'title'))) {
- $form_state->setError($form['menu']['title'], t('Title is required for this menu type.'));
+ $form_state->setError($form['menu']['title'], $this->t('Title is required for this menu type.'));
}
}
}
@@ -434,13 +434,13 @@ public function validate() {
$menu = $this->getOption('menu');
if (!empty($menu['type']) && $menu['type'] != 'none' && empty($menu['title'])) {
- $errors[] = t('Display @display is set to use a menu but the menu link text is not set.', array('@display' => $this->display['display_title']));
+ $errors[] = $this->t('Display @display is set to use a menu but the menu link text is not set.', array('@display' => $this->display['display_title']));
}
if ($menu['type'] == 'default tab') {
$tab_options = $this->getOption('tab_options');
if (!empty($tab_options['type']) && $tab_options['type'] != 'none' && empty($tab_options['title'])) {
- $errors[] = t('Display @display is set to use a parent menu but the parent menu link text is not set.', array('@display' => $this->display['display_title']));
+ $errors[] = $this->t('Display @display is set to use a parent menu but the parent menu link text is not set.', array('@display' => $this->display['display_title']));
}
}
@@ -452,9 +452,9 @@ public function validate() {
*/
public function getArgumentText() {
return array(
- 'filter value not present' => t('When the filter value is
NOT in the URL'),
- 'filter value present' => t('When the filter value
IS in the URL or a default is provided'),
- 'description' => t('The contextual filter values is provided by the URL.'),
+ 'filter value not present' => $this->t('When the filter value is
NOT in the URL'),
+ 'filter value present' => $this->t('When the filter value
IS in the URL or a default is provided'),
+ 'description' => $this->t('The contextual filter values is provided by the URL.'),
);
}
@@ -463,8 +463,8 @@ public function getArgumentText() {
*/
public function getPagerText() {
return array(
- 'items per page title' => t('Items per page'),
- 'items per page description' => t('The number of items to display per page. Enter 0 for no limit.')
+ 'items per page title' => $this->t('Items per page'),
+ 'items per page description' => $this->t('The number of items to display per page. Enter 0 for no limit.')
);
}
diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
index 2400ac0..1fe0a35 100644
--- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
@@ -356,7 +356,7 @@ public function optionsSummary(&$categories, &$options) {
parent::optionsSummary($categories, $options);
$categories['page'] = array(
- 'title' => t('Page settings'),
+ 'title' => $this->t('Page settings'),
'column' => 'second',
'build' => array(
'#weight' => -10,
@@ -366,7 +366,7 @@ public function optionsSummary(&$categories, &$options) {
$path = strip_tags($this->getOption('path'));
if (empty($path)) {
- $path = t('No path is set');
+ $path = $this->t('No path is set');
}
else {
$path = '/' . $path;
@@ -374,7 +374,7 @@ public function optionsSummary(&$categories, &$options) {
$options['path'] = array(
'category' => 'page',
- 'title' => t('Path'),
+ 'title' => $this->t('Path'),
'value' => views_ui_truncate($path, 24),
);
}
@@ -387,11 +387,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
switch ($form_state->get('section')) {
case 'path':
- $form['#title'] .= t('The menu path or URL of this view');
+ $form['#title'] .= $this->t('The menu path or URL of this view');
$form['path'] = array(
'#type' => 'textfield',
- '#title' => t('Path'),
- '#description' => t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for contextual filters: For example, "node/%/feed". If needed you can even specify named route parameters like taxonomy/term/%taxonomy_term'),
+ '#title' => $this->t('Path'),
+ '#description' => $this->t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for contextual filters: For example, "node/%/feed". If needed you can even specify named route parameters like taxonomy/term/%taxonomy_term'),
'#default_value' => $this->getOption('path'),
'#field_prefix' => '
' . url(NULL, array('absolute' => TRUE)),
'#field_suffix' => '',
diff --git a/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php b/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php
index 121fb94..e7aa591 100644
--- a/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php
+++ b/core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php
@@ -57,21 +57,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['submit_button'] = array(
'#type' => 'textfield',
- '#title' => t('Submit button text'),
+ '#title' => $this->t('Submit button text'),
'#default_value' => $this->options['submit_button'],
'#required' => TRUE,
);
$form['reset_button'] = array(
'#type' => 'checkbox',
- '#title' => t('Include reset button (resets all applied exposed filters)'),
+ '#title' => $this->t('Include reset button (resets all applied exposed filters)'),
'#default_value' => $this->options['reset_button'],
);
$form['reset_button_label'] = array(
'#type' => 'textfield',
- '#title' => t('Reset button label'),
- '#description' => t('Text to display in the reset button of the exposed form.'),
+ '#title' => $this->t('Reset button label'),
+ '#description' => $this->t('Text to display in the reset button of the exposed form.'),
'#default_value' => $this->options['reset_button_label'],
'#required' => TRUE,
'#states' => array(
@@ -83,21 +83,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['exposed_sorts_label'] = array(
'#type' => 'textfield',
- '#title' => t('Exposed sorts label'),
+ '#title' => $this->t('Exposed sorts label'),
'#default_value' => $this->options['exposed_sorts_label'],
'#required' => TRUE,
);
$form['expose_sort_order'] = array(
'#type' => 'checkbox',
- '#title' => t('Allow people to choose the sort order'),
- '#description' => t('If sort order is not exposed, the sort criteria settings for each sort will determine its order.'),
+ '#title' => $this->t('Allow people to choose the sort order'),
+ '#description' => $this->t('If sort order is not exposed, the sort criteria settings for each sort will determine its order.'),
'#default_value' => $this->options['expose_sort_order'],
);
$form['sort_asc_label'] = array(
'#type' => 'textfield',
- '#title' => t('Label for ascending sort'),
+ '#title' => $this->t('Label for ascending sort'),
'#default_value' => $this->options['sort_asc_label'],
'#required' => TRUE,
'#states' => array(
@@ -109,7 +109,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['sort_desc_label'] = array(
'#type' => 'textfield',
- '#title' => t('Label for descending sort'),
+ '#title' => $this->t('Label for descending sort'),
'#default_value' => $this->options['sort_desc_label'],
'#required' => TRUE,
'#states' => array(
@@ -244,7 +244,7 @@ public function exposedFormAlter(&$form, FormStateInterface $form_state) {
$form['sort_order'] = array(
'#type' => 'select',
'#options' => $sort_order,
- '#title' => t('Order', array(), array('context' => 'Sort order')),
+ '#title' => $this->t('Order', array(), array('context' => 'Sort order')),
'#default_value' => $default_sort_order,
);
}
diff --git a/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php b/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
index 4fb14f0..03709fa 100644
--- a/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
+++ b/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
@@ -36,8 +36,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['text_input_required'] = array(
'#type' => 'text_format',
- '#title' => t('Text on demand'),
- '#description' => t('Text to display instead of results until the user selects and applies an exposed filter.'),
+ '#title' => $this->t('Text on demand'),
+ '#description' => $this->t('Text to display instead of results until the user selects and applies an exposed filter.'),
'#default_value' => $this->options['text_input_required'],
'#format' => isset($this->options['text_input_required_format']) ? $this->options['text_input_required_format'] : filter_default_format(),
'#editor' => FALSE,
diff --git a/core/modules/views/src/Plugin/views/field/Boolean.php b/core/modules/views/src/Plugin/views/field/Boolean.php
index 13b5858..0aaec01 100644
--- a/core/modules/views/src/Plugin/views/field/Boolean.php
+++ b/core/modules/views/src/Plugin/views/field/Boolean.php
@@ -50,10 +50,10 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
parent::init($view, $display, $options);
$default_formats = array(
- 'yes-no' => array(t('Yes'), t('No')),
- 'true-false' => array(t('True'), t('False')),
- 'on-off' => array(t('On'), t('Off')),
- 'enabled-disabled' => array(t('Enabled'), t('Disabled')),
+ 'yes-no' => array(t('Yes'), $this->t('No')),
+ 'true-false' => array(t('True'), $this->t('False')),
+ 'on-off' => array(t('On'), $this->t('Off')),
+ 'enabled-disabled' => array(t('Enabled'), $this->t('Disabled')),
'boolean' => array(1, 0),
'unicode-yes-no' => array('✔', '✖'),
);
@@ -69,13 +69,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['type'] = array(
'#type' => 'select',
- '#title' => t('Output format'),
+ '#title' => $this->t('Output format'),
'#options' => $options,
'#default_value' => $this->options['type'],
);
$form['type_custom_true'] = array(
'#type' => 'textfield',
- '#title' => t('Custom output for TRUE'),
+ '#title' => $this->t('Custom output for TRUE'),
'#default_value' => $this->options['type_custom_true'],
'#states' => array(
'visible' => array(
@@ -85,7 +85,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['type_custom_false'] = array(
'#type' => 'textfield',
- '#title' => t('Custom output for FALSE'),
+ '#title' => $this->t('Custom output for FALSE'),
'#default_value' => $this->options['type_custom_false'],
'#states' => array(
'visible' => array(
@@ -95,8 +95,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['not'] = array(
'#type' => 'checkbox',
- '#title' => t('Reverse'),
- '#description' => t('If checked, true will be displayed as false.'),
+ '#title' => $this->t('Reverse'),
+ '#description' => $this->t('If checked, true will be displayed as false.'),
'#default_value' => $this->options['not'],
);
parent::buildOptionsForm($form, $form_state);
diff --git a/core/modules/views/src/Plugin/views/field/Counter.php b/core/modules/views/src/Plugin/views/field/Counter.php
index 62b2580..cfd5d1e 100644
--- a/core/modules/views/src/Plugin/views/field/Counter.php
+++ b/core/modules/views/src/Plugin/views/field/Counter.php
@@ -36,9 +36,9 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['counter_start'] = array(
'#type' => 'textfield',
- '#title' => t('Starting value'),
+ '#title' => $this->t('Starting value'),
'#default_value' => $this->options['counter_start'],
- '#description' => t('Specify the number the counter should start at.'),
+ '#description' => $this->t('Specify the number the counter should start at.'),
'#size' => 2,
);
diff --git a/core/modules/views/src/Plugin/views/field/Date.php b/core/modules/views/src/Plugin/views/field/Date.php
index c1a47c3..c25a200 100644
--- a/core/modules/views/src/Plugin/views/field/Date.php
+++ b/core/modules/views/src/Plugin/views/field/Date.php
@@ -84,28 +84,28 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$date_formats = array();
foreach ($this->dateFormatStorage->loadMultiple() as $machine_name => $value) {
- $date_formats[$machine_name] = t('@name format: @date', array('@name' => $value->label(), '@date' => $this->dateFormatter->format(REQUEST_TIME, $machine_name)));
+ $date_formats[$machine_name] = $this->t('@name format: @date', array('@name' => $value->label(), '@date' => $this->dateFormatter->format(REQUEST_TIME, $machine_name)));
}
$form['date_format'] = array(
'#type' => 'select',
- '#title' => t('Date format'),
+ '#title' => $this->t('Date format'),
'#options' => $date_formats + array(
- 'custom' => t('Custom'),
- 'raw time ago' => t('Time ago'),
- 'time ago' => t('Time ago (with "ago" appended)'),
- 'raw time hence' => t('Time hence'),
- 'time hence' => t('Time hence (with "hence" appended)'),
- 'raw time span' => t('Time span (future dates have "-" prepended)'),
- 'inverse time span' => t('Time span (past dates have "-" prepended)'),
- 'time span' => t('Time span (with "ago/hence" appended)'),
+ 'custom' => $this->t('Custom'),
+ 'raw time ago' => $this->t('Time ago'),
+ 'time ago' => $this->t('Time ago (with "ago" appended)'),
+ 'raw time hence' => $this->t('Time hence'),
+ 'time hence' => $this->t('Time hence (with "hence" appended)'),
+ 'raw time span' => $this->t('Time span (future dates have "-" prepended)'),
+ 'inverse time span' => $this->t('Time span (past dates have "-" prepended)'),
+ 'time span' => $this->t('Time span (with "ago/hence" appended)'),
),
'#default_value' => isset($this->options['date_format']) ? $this->options['date_format'] : 'small',
);
$form['custom_date_format'] = array(
'#type' => 'textfield',
- '#title' => t('Custom date format'),
- '#description' => t('If "Custom", see
the PHP docs for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.'),
+ '#title' => $this->t('Custom date format'),
+ '#description' => $this->t('If "Custom", see
the PHP docs for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.'),
'#default_value' => isset($this->options['custom_date_format']) ? $this->options['custom_date_format'] : '',
);
// Setup #states for all possible date_formats on the custom_date_format form element.
@@ -116,9 +116,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
}
$form['timezone'] = array(
'#type' => 'select',
- '#title' => t('Timezone'),
- '#description' => t('Timezone to be used for date output.'),
- '#options' => array('' => t('- Default site/user timezone -')) + system_time_zones(FALSE),
+ '#title' => $this->t('Timezone'),
+ '#description' => $this->t('Timezone to be used for date output.'),
+ '#options' => array('' => $this->t('- Default site/user timezone -')) + system_time_zones(FALSE),
'#default_value' => $this->options['timezone'],
);
foreach (array_merge(array('custom'), array_keys($date_formats)) as $timezone_date_formats) {
@@ -147,17 +147,17 @@ public function render(ResultRow $values) {
case 'raw time ago':
return $this->dateFormatter->formatInterval($time_diff, is_numeric($custom_format) ? $custom_format : 2);
case 'time ago':
- return t('%time ago', array('%time' => $this->dateFormatter->formatInterval($time_diff, is_numeric($custom_format) ? $custom_format : 2)));
+ return $this->t('%time ago', array('%time' => $this->dateFormatter->formatInterval($time_diff, is_numeric($custom_format) ? $custom_format : 2)));
case 'raw time hence':
return $this->dateFormatter->formatInterval(-$time_diff, is_numeric($custom_format) ? $custom_format : 2);
case 'time hence':
- return t('%time hence', array('%time' => $this->dateFormatter->formatInterval(-$time_diff, is_numeric($custom_format) ? $custom_format : 2)));
+ return $this->t('%time hence', array('%time' => $this->dateFormatter->formatInterval(-$time_diff, is_numeric($custom_format) ? $custom_format : 2)));
case 'raw time span':
return ($time_diff < 0 ? '-' : '') . $this->dateFormatter->formatInterval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2);
case 'inverse time span':
return ($time_diff > 0 ? '-' : '') . $this->dateFormatter->formatInterval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2);
case 'time span':
- return t(($time_diff < 0 ? '%time hence' : '%time ago'), array('%time' => $this->dateFormatter->formatInterval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)));
+ return $this->t(($time_diff < 0 ? '%time hence' : '%time ago'), array('%time' => $this->dateFormatter->formatInterval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)));
case 'custom':
if ($custom_format == 'r') {
return format_date($value, $format, $custom_format, $timezone, 'en');
diff --git a/core/modules/views/src/Plugin/views/field/EntityLabel.php b/core/modules/views/src/Plugin/views/field/EntityLabel.php
index 376c497..8b39f56 100644
--- a/core/modules/views/src/Plugin/views/field/EntityLabel.php
+++ b/core/modules/views/src/Plugin/views/field/EntityLabel.php
@@ -88,8 +88,8 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_entity'] = array(
- '#title' => t('Link to entity'),
- '#description' => t('Make entity label a link to entity page.'),
+ '#title' => $this->t('Link to entity'),
+ '#description' => $this->t('Make entity label a link to entity page.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_entity']),
);
diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
index 51eebc4..3466e55 100644
--- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -294,8 +294,8 @@ public function getElements() {
if (!isset($elements)) {
// @todo Add possible html5 elements.
$elements = array(
- '' => t(' - Use default -'),
- '0' => t('- None -')
+ '' => $this->t(' - Use default -'),
+ '0' => $this->t('- None -')
);
$elements += \Drupal::config('views.settings')->get('field_rewrite_elements');
}
@@ -522,13 +522,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$label = $this->label();
$form['custom_label'] = array(
'#type' => 'checkbox',
- '#title' => t('Create a label'),
+ '#title' => $this->t('Create a label'),
'#default_value' => $label !== '',
'#weight' => -103,
);
$form['label'] = array(
'#type' => 'textfield',
- '#title' => t('Label'),
+ '#title' => $this->t('Label'),
'#default_value' => $label,
'#states' => array(
'visible' => array(
@@ -539,7 +539,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['element_label_colon'] = array(
'#type' => 'checkbox',
- '#title' => t('Place a colon after the label'),
+ '#title' => $this->t('Place a colon after the label'),
'#default_value' => $this->options['element_label_colon'],
'#states' => array(
'visible' => array(
@@ -551,30 +551,30 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['exclude'] = array(
'#type' => 'checkbox',
- '#title' => t('Exclude from display'),
+ '#title' => $this->t('Exclude from display'),
'#default_value' => $this->options['exclude'],
- '#description' => t('Enable to load this field as hidden. Often used to group fields, or to use as token in another field.'),
+ '#description' => $this->t('Enable to load this field as hidden. Often used to group fields, or to use as token in another field.'),
'#weight' => -100,
);
$form['style_settings'] = array(
'#type' => 'details',
- '#title' => t('Style settings'),
+ '#title' => $this->t('Style settings'),
'#weight' => 99,
);
$form['element_type_enable'] = array(
'#type' => 'checkbox',
- '#title' => t('Customize field HTML'),
+ '#title' => $this->t('Customize field HTML'),
'#default_value' => !empty($this->options['element_type']) || (string) $this->options['element_type'] == '0' || !empty($this->options['element_class']) || (string) $this->options['element_class'] == '0',
'#fieldset' => 'style_settings',
);
$form['element_type'] = array(
- '#title' => t('HTML element'),
+ '#title' => $this->t('HTML element'),
'#options' => $this->getElements(),
'#type' => 'select',
'#default_value' => $this->options['element_type'],
- '#description' => t('Choose the HTML element to wrap around this field, e.g. H1, H2, etc.'),
+ '#description' => $this->t('Choose the HTML element to wrap around this field, e.g. H1, H2, etc.'),
'#states' => array(
'visible' => array(
':input[name="options[element_type_enable]"]' => array('checked' => TRUE),
@@ -585,7 +585,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['element_class_enable'] = array(
'#type' => 'checkbox',
- '#title' => t('Create a CSS class'),
+ '#title' => $this->t('Create a CSS class'),
'#states' => array(
'visible' => array(
':input[name="options[element_type_enable]"]' => array('checked' => TRUE),
@@ -595,8 +595,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#fieldset' => 'style_settings',
);
$form['element_class'] = array(
- '#title' => t('CSS class'),
- '#description' => t('You may use token substitutions from the rewriting section in this class.'),
+ '#title' => $this->t('CSS class'),
+ '#description' => $this->t('You may use token substitutions from the rewriting section in this class.'),
'#type' => 'textfield',
'#default_value' => $this->options['element_class'],
'#states' => array(
@@ -610,16 +610,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['element_label_type_enable'] = array(
'#type' => 'checkbox',
- '#title' => t('Customize label HTML'),
+ '#title' => $this->t('Customize label HTML'),
'#default_value' => !empty($this->options['element_label_type']) || (string) $this->options['element_label_type'] == '0' || !empty($this->options['element_label_class']) || (string) $this->options['element_label_class'] == '0',
'#fieldset' => 'style_settings',
);
$form['element_label_type'] = array(
- '#title' => t('Label HTML element'),
+ '#title' => $this->t('Label HTML element'),
'#options' => $this->getElements(FALSE),
'#type' => 'select',
'#default_value' => $this->options['element_label_type'],
- '#description' => t('Choose the HTML element to wrap around this label, e.g. H1, H2, etc.'),
+ '#description' => $this->t('Choose the HTML element to wrap around this label, e.g. H1, H2, etc.'),
'#states' => array(
'visible' => array(
':input[name="options[element_label_type_enable]"]' => array('checked' => TRUE),
@@ -629,7 +629,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['element_label_class_enable'] = array(
'#type' => 'checkbox',
- '#title' => t('Create a CSS class'),
+ '#title' => $this->t('Create a CSS class'),
'#states' => array(
'visible' => array(
':input[name="options[element_label_type_enable]"]' => array('checked' => TRUE),
@@ -639,8 +639,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#fieldset' => 'style_settings',
);
$form['element_label_class'] = array(
- '#title' => t('CSS class'),
- '#description' => t('You may use token substitutions from the rewriting section in this class.'),
+ '#title' => $this->t('CSS class'),
+ '#description' => $this->t('You may use token substitutions from the rewriting section in this class.'),
'#type' => 'textfield',
'#default_value' => $this->options['element_label_class'],
'#states' => array(
@@ -654,16 +654,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['element_wrapper_type_enable'] = array(
'#type' => 'checkbox',
- '#title' => t('Customize field and label wrapper HTML'),
+ '#title' => $this->t('Customize field and label wrapper HTML'),
'#default_value' => !empty($this->options['element_wrapper_type']) || (string) $this->options['element_wrapper_type'] == '0' || !empty($this->options['element_wrapper_class']) || (string) $this->options['element_wrapper_class'] == '0',
'#fieldset' => 'style_settings',
);
$form['element_wrapper_type'] = array(
- '#title' => t('Wrapper HTML element'),
+ '#title' => $this->t('Wrapper HTML element'),
'#options' => $this->getElements(FALSE),
'#type' => 'select',
'#default_value' => $this->options['element_wrapper_type'],
- '#description' => t('Choose the HTML element to wrap around this field and label, e.g. H1, H2, etc. This may not be used if the field and label are not rendered together, such as with a table.'),
+ '#description' => $this->t('Choose the HTML element to wrap around this field and label, e.g. H1, H2, etc. This may not be used if the field and label are not rendered together, such as with a table.'),
'#states' => array(
'visible' => array(
':input[name="options[element_wrapper_type_enable]"]' => array('checked' => TRUE),
@@ -674,7 +674,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['element_wrapper_class_enable'] = array(
'#type' => 'checkbox',
- '#title' => t('Create a CSS class'),
+ '#title' => $this->t('Create a CSS class'),
'#states' => array(
'visible' => array(
':input[name="options[element_wrapper_type_enable]"]' => array('checked' => TRUE),
@@ -684,8 +684,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#fieldset' => 'style_settings',
);
$form['element_wrapper_class'] = array(
- '#title' => t('CSS class'),
- '#description' => t('You may use token substitutions from the rewriting section in this class.'),
+ '#title' => $this->t('CSS class'),
+ '#description' => $this->t('You may use token substitutions from the rewriting section in this class.'),
'#type' => 'textfield',
'#default_value' => $this->options['element_wrapper_class'],
'#states' => array(
@@ -699,14 +699,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['element_default_classes'] = array(
'#type' => 'checkbox',
- '#title' => t('Add default classes'),
+ '#title' => $this->t('Add default classes'),
'#default_value' => $this->options['element_default_classes'],
- '#description' => t('Use default Views classes to identify the field, field label and field content.'),
+ '#description' => $this->t('Use default Views classes to identify the field, field label and field content.'),
'#fieldset' => 'style_settings',
);
$form['alter'] = array(
- '#title' => t('Rewrite results'),
+ '#title' => $this->t('Rewrite results'),
'#type' => 'details',
'#weight' => 100,
);
@@ -715,15 +715,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['#tree'] = TRUE;
$form['alter']['alter_text'] = array(
'#type' => 'checkbox',
- '#title' => t('Override the output of this field with custom text'),
+ '#title' => $this->t('Override the output of this field with custom text'),
'#default_value' => $this->options['alter']['alter_text'],
);
$form['alter']['text'] = array(
- '#title' => t('Text'),
+ '#title' => $this->t('Text'),
'#type' => 'textarea',
'#default_value' => $this->options['alter']['text'],
- '#description' => t('The text to display for this field. You may include HTML. You may enter data from this view as per the "Replacement patterns" below.'),
+ '#description' => $this->t('The text to display for this field. You may include HTML. You may enter data from this view as per the "Replacement patterns" below.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][alter_text]"]' => array('checked' => TRUE),
@@ -733,14 +733,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['make_link'] = array(
'#type' => 'checkbox',
- '#title' => t('Output this field as a custom link'),
+ '#title' => $this->t('Output this field as a custom link'),
'#default_value' => $this->options['alter']['make_link'],
);
$form['alter']['path'] = array(
- '#title' => t('Link path'),
+ '#title' => $this->t('Link path'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['path'],
- '#description' => t('The Drupal path or absolute URL for this link. You may enter data from this view as per the "Replacement patterns" below.'),
+ '#description' => $this->t('The Drupal path or absolute URL for this link. You may enter data from this view as per the "Replacement patterns" below.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -750,7 +750,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['alter']['absolute'] = array(
'#type' => 'checkbox',
- '#title' => t('Use absolute path'),
+ '#title' => $this->t('Use absolute path'),
'#default_value' => $this->options['alter']['absolute'],
'#states' => array(
'visible' => array(
@@ -760,7 +760,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['alter']['replace_spaces'] = array(
'#type' => 'checkbox',
- '#title' => t('Replace spaces with dashes'),
+ '#title' => $this->t('Replace spaces with dashes'),
'#default_value' => $this->options['alter']['replace_spaces'],
'#states' => array(
'visible' => array(
@@ -770,9 +770,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['alter']['external'] = array(
'#type' => 'checkbox',
- '#title' => t('External server URL'),
+ '#title' => $this->t('External server URL'),
'#default_value' => $this->options['alter']['external'],
- '#description' => t("Links to an external server using a full URL: e.g. 'http://www.example.com' or 'www.example.com'."),
+ '#description' => $this->t("Links to an external server using a full URL: e.g. 'http://www.example.com' or 'www.example.com'."),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -781,27 +781,27 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['alter']['path_case'] = array(
'#type' => 'select',
- '#title' => t('Transform the case'),
- '#description' => t('When printing url paths, how to transform the case of the filter value.'),
+ '#title' => $this->t('Transform the case'),
+ '#description' => $this->t('When printing url paths, how to transform the case of the filter value.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
),
),
'#options' => array(
- 'none' => t('No transform'),
- 'upper' => t('Upper case'),
- 'lower' => t('Lower case'),
- 'ucfirst' => t('Capitalize first letter'),
- 'ucwords' => t('Capitalize each word'),
+ 'none' => $this->t('No transform'),
+ 'upper' => $this->t('Upper case'),
+ 'lower' => $this->t('Lower case'),
+ 'ucfirst' => $this->t('Capitalize first letter'),
+ 'ucwords' => $this->t('Capitalize each word'),
),
'#default_value' => $this->options['alter']['path_case'],
);
$form['alter']['link_class'] = array(
- '#title' => t('Link class'),
+ '#title' => $this->t('Link class'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['link_class'],
- '#description' => t('The CSS class to apply to the link.'),
+ '#description' => $this->t('The CSS class to apply to the link.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -809,10 +809,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['alter']['alt'] = array(
- '#title' => t('Title text'),
+ '#title' => $this->t('Title text'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['alt'],
- '#description' => t('Text to place as "title" text which most browsers display as a tooltip when hovering over the link.'),
+ '#description' => $this->t('Text to place as "title" text which most browsers display as a tooltip when hovering over the link.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -820,10 +820,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['alter']['rel'] = array(
- '#title' => t('Rel Text'),
+ '#title' => $this->t('Rel Text'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['rel'],
- '#description' => t('Include Rel attribute for use in lightbox2 or other javascript utility.'),
+ '#description' => $this->t('Include Rel attribute for use in lightbox2 or other javascript utility.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -831,10 +831,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['alter']['prefix'] = array(
- '#title' => t('Prefix text'),
+ '#title' => $this->t('Prefix text'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['prefix'],
- '#description' => t('Any text to display before this link. You may include HTML.'),
+ '#description' => $this->t('Any text to display before this link. You may include HTML.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -842,10 +842,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['alter']['suffix'] = array(
- '#title' => t('Suffix text'),
+ '#title' => $this->t('Suffix text'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['suffix'],
- '#description' => t('Any text to display after this link. You may include HTML.'),
+ '#description' => $this->t('Any text to display after this link. You may include HTML.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -853,10 +853,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['alter']['target'] = array(
- '#title' => t('Target'),
+ '#title' => $this->t('Target'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['target'],
- '#description' => t("Target of the link, such as _blank, _parent or an iframe's name. This field is rarely used."),
+ '#description' => $this->t("Target of the link, such as _blank, _parent or an iframe's name. This field is rarely used."),
'#states' => array(
'visible' => array(
':input[name="options[alter][make_link]"]' => array('checked' => TRUE),
@@ -877,17 +877,17 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$count = 0; // This lets us prepare the key as we want it printed.
foreach ($this->view->display_handler->getHandlers('argument') as $arg => $handler) {
- $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel()));
- $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel()));
+ $options[t('Arguments')]['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel()));
+ $options[t('Arguments')]['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel()));
}
$this->documentSelfTokens($options[t('Fields')]);
// Default text.
- $output = '
' . t('You must add some additional fields to this display before using this field. These fields may be marked as Exclude from display if you prefer. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields.') . '
';
+ $output = '
' . $this->t('You must add some additional fields to this display before using this field. These fields may be marked as Exclude from display if you prefer. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields.') . '
';
// We have some options, so make a list.
if (!empty($options)) {
- $output = '
' . t("The following tokens are available for this field. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields. If you would like to have the characters '[' and ']' use the html entity codes '%5B' or '%5D' or they will get replaced with empty space.") . '
';
+ $output = '
' . $this->t("The following tokens are available for this field. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields. If you would like to have the characters '[' and ']' use the html entity codes '%5B' or '%5D' or they will get replaced with empty space.") . '
';
foreach (array_keys($options) as $type) {
if (!empty($options[$type])) {
$items = array();
@@ -909,7 +909,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
// make this work.
$form['alter']['help'] = array(
'#type' => 'details',
- '#title' => t('Replacement patterns'),
+ '#title' => $this->t('Replacement patterns'),
'#value' => SafeMarkup::set($output),
'#states' => array(
'visible' => array(
@@ -928,12 +928,12 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['trim'] = array(
'#type' => 'checkbox',
- '#title' => t('Trim this field to a maximum number of characters'),
+ '#title' => $this->t('Trim this field to a maximum number of characters'),
'#default_value' => $this->options['alter']['trim'],
);
$form['alter']['max_length'] = array(
- '#title' => t('Maximum number of characters'),
+ '#title' => $this->t('Maximum number of characters'),
'#type' => 'textfield',
'#default_value' => $this->options['alter']['max_length'],
'#states' => array(
@@ -945,8 +945,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['word_boundary'] = array(
'#type' => 'checkbox',
- '#title' => t('Trim only on a word boundary'),
- '#description' => t('If checked, this field be trimmed only on a word boundary. This is guaranteed to be the maximum characters stated or less. If there are no word boundaries this could trim a field to nothing.'),
+ '#title' => $this->t('Trim only on a word boundary'),
+ '#description' => $this->t('If checked, this field be trimmed only on a word boundary. This is guaranteed to be the maximum characters stated or less. If there are no word boundaries this could trim a field to nothing.'),
'#default_value' => $this->options['alter']['word_boundary'],
'#states' => array(
'visible' => array(
@@ -957,7 +957,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['ellipsis'] = array(
'#type' => 'checkbox',
- '#title' => t('Add "…" at the end of trimmed text'),
+ '#title' => $this->t('Add "…" at the end of trimmed text'),
'#default_value' => $this->options['alter']['ellipsis'],
'#states' => array(
'visible' => array(
@@ -968,7 +968,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['more_link'] = array(
'#type' => 'checkbox',
- '#title' => t('Add a read-more link if output is trimmed'),
+ '#title' => $this->t('Add a read-more link if output is trimmed'),
'#default_value' => $this->options['alter']['more_link'],
'#states' => array(
'visible' => array(
@@ -979,9 +979,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['more_link_text'] = array(
'#type' => 'textfield',
- '#title' => t('More link label'),
+ '#title' => $this->t('More link label'),
'#default_value' => $this->options['alter']['more_link_text'],
- '#description' => t('You may use the "Replacement patterns" above.'),
+ '#description' => $this->t('You may use the "Replacement patterns" above.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][trim]"]' => array('checked' => TRUE),
@@ -991,9 +991,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['alter']['more_link_path'] = array(
'#type' => 'textfield',
- '#title' => t('More link path'),
+ '#title' => $this->t('More link path'),
'#default_value' => $this->options['alter']['more_link_path'],
- '#description' => t('This can be an internal Drupal path such as node/add or an external URL such as "http://drupal.org". You may use the "Replacement patterns" above.'),
+ '#description' => $this->t('This can be an internal Drupal path such as node/add or an external URL such as "http://drupal.org". You may use the "Replacement patterns" above.'),
'#states' => array(
'visible' => array(
':input[name="options[alter][trim]"]' => array('checked' => TRUE),
@@ -1004,8 +1004,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['html'] = array(
'#type' => 'checkbox',
- '#title' => t('Field can contain HTML'),
- '#description' => t('An HTML corrector will be run to ensure HTML tags are properly closed after trimming.'),
+ '#title' => $this->t('Field can contain HTML'),
+ '#description' => $this->t('An HTML corrector will be run to ensure HTML tags are properly closed after trimming.'),
'#default_value' => $this->options['alter']['html'],
'#states' => array(
'visible' => array(
@@ -1016,14 +1016,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['strip_tags'] = array(
'#type' => 'checkbox',
- '#title' => t('Strip HTML tags'),
+ '#title' => $this->t('Strip HTML tags'),
'#default_value' => $this->options['alter']['strip_tags'],
);
$form['alter']['preserve_tags'] = array(
'#type' => 'textfield',
- '#title' => t('Preserve certain tags'),
- '#description' => t('List the tags that need to be preserved during the stripping process. example "<p> <br>" which will preserve all p and br elements'),
+ '#title' => $this->t('Preserve certain tags'),
+ '#description' => $this->t('List the tags that need to be preserved during the stripping process. example "<p> <br>" which will preserve all p and br elements'),
'#default_value' => $this->options['alter']['preserve_tags'],
'#states' => array(
'visible' => array(
@@ -1034,52 +1034,52 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['alter']['trim_whitespace'] = array(
'#type' => 'checkbox',
- '#title' => t('Remove whitespace'),
+ '#title' => $this->t('Remove whitespace'),
'#default_value' => $this->options['alter']['trim_whitespace'],
);
$form['alter']['nl2br'] = array(
'#type' => 'checkbox',
- '#title' => t('Convert newlines to HTML <br> tags'),
+ '#title' => $this->t('Convert newlines to HTML <br> tags'),
'#default_value' => $this->options['alter']['nl2br'],
);
}
$form['empty_field_behavior'] = array(
'#type' => 'details',
- '#title' => t('No results behavior'),
+ '#title' => $this->t('No results behavior'),
'#weight' => 100,
);
$form['empty'] = array(
'#type' => 'textarea',
- '#title' => t('No results text'),
+ '#title' => $this->t('No results text'),
'#default_value' => $this->options['empty'],
- '#description' => t('Provide text to display if this field contains an empty result. You may include HTML. You may enter data from this view as per the "Replacement patterns" in the "Rewrite Results" section below.'),
+ '#description' => $this->t('Provide text to display if this field contains an empty result. You may include HTML. You may enter data from this view as per the "Replacement patterns" in the "Rewrite Results" section below.'),
'#fieldset' => 'empty_field_behavior',
);
$form['empty_zero'] = array(
'#type' => 'checkbox',
- '#title' => t('Count the number 0 as empty'),
+ '#title' => $this->t('Count the number 0 as empty'),
'#default_value' => $this->options['empty_zero'],
- '#description' => t('Enable to display the "no results text" if the field contains the number 0.'),
+ '#description' => $this->t('Enable to display the "no results text" if the field contains the number 0.'),
'#fieldset' => 'empty_field_behavior',
);
$form['hide_empty'] = array(
'#type' => 'checkbox',
- '#title' => t('Hide if empty'),
+ '#title' => $this->t('Hide if empty'),
'#default_value' => $this->options['hide_empty'],
- '#description' => t('Enable to hide this field if it is empty. Note that the field label or rewritten output may still be displayed. To hide labels, check the style or row style settings for empty fields. To hide rewritten content, check the "Hide rewriting if empty" checkbox.'),
+ '#description' => $this->t('Enable to hide this field if it is empty. Note that the field label or rewritten output may still be displayed. To hide labels, check the style or row style settings for empty fields. To hide rewritten content, check the "Hide rewriting if empty" checkbox.'),
'#fieldset' => 'empty_field_behavior',
);
$form['hide_alter_empty'] = array(
'#type' => 'checkbox',
- '#title' => t('Hide rewriting if empty'),
+ '#title' => $this->t('Hide rewriting if empty'),
'#default_value' => $this->options['hide_alter_empty'],
- '#description' => t('Do not display rewritten content if this field is empty.'),
+ '#description' => $this->t('Do not display rewritten content if this field is empty.'),
'#fieldset' => 'empty_field_behavior',
);
}
@@ -1272,7 +1272,7 @@ public function renderText($alter) {
$value = $this->renderTrimText($alter, $value);
if ($this->options['alter']['more_link'] && strlen($value) < $length) {
$tokens = $this->getRenderTokens($alter);
- $more_link_text = $this->options['alter']['more_link_text'] ? $this->options['alter']['more_link_text'] : t('more');
+ $more_link_text = $this->options['alter']['more_link_text'] ? $this->options['alter']['more_link_text'] : $this->t('more');
$more_link_text = strtr(Xss::filterAdmin($more_link_text), $tokens);
$more_link_path = $this->options['alter']['more_link_path'];
$more_link_path = strip_tags(decode_entities(strtr($more_link_path, $tokens)));
diff --git a/core/modules/views/src/Plugin/views/field/FileSize.php b/core/modules/views/src/Plugin/views/field/FileSize.php
index 57bd1bb..a899525 100644
--- a/core/modules/views/src/Plugin/views/field/FileSize.php
+++ b/core/modules/views/src/Plugin/views/field/FileSize.php
@@ -30,11 +30,11 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['file_size_display'] = array(
- '#title' => t('File size display'),
+ '#title' => $this->t('File size display'),
'#type' => 'select',
'#options' => array(
- 'formatted' => t('Formatted (in KB or MB)'),
- 'bytes' => t('Raw bytes'),
+ 'formatted' => $this->t('Formatted (in KB or MB)'),
+ 'bytes' => $this->t('Raw bytes'),
),
);
}
diff --git a/core/modules/views/src/Plugin/views/field/LanguageField.php b/core/modules/views/src/Plugin/views/field/LanguageField.php
index 3878e6c..67e8bd7 100644
--- a/core/modules/views/src/Plugin/views/field/LanguageField.php
+++ b/core/modules/views/src/Plugin/views/field/LanguageField.php
@@ -29,10 +29,10 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['native_language'] = array(
- '#title' => t('Native language'),
+ '#title' => $this->t('Native language'),
'#type' => 'checkbox',
'#default_value' => $this->options['native_language'],
- '#description' => t('If enabled, the native name of the language will be displayed'),
+ '#description' => $this->t('If enabled, the native name of the language will be displayed'),
);
}
diff --git a/core/modules/views/src/Plugin/views/field/Links.php b/core/modules/views/src/Plugin/views/field/Links.php
index 1d6a82a..7f699f7 100644
--- a/core/modules/views/src/Plugin/views/field/Links.php
+++ b/core/modules/views/src/Plugin/views/field/Links.php
@@ -44,15 +44,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$field_options = $this->getPreviousFieldLabels();
$form['fields'] = array(
'#type' => 'checkboxes',
- '#title' => t('Fields'),
- '#description' => t('Fields to be included as links.'),
+ '#title' => $this->t('Fields'),
+ '#description' => $this->t('Fields to be included as links.'),
'#options' => $field_options,
'#default_value' => $this->options['fields'],
);
$form['destination'] = array(
'#type' => 'checkbox',
- '#title' => t('Include destination'),
- '#description' => t('Include a "destination" parameter in the link to return the user to the original view upon completing the link action.'),
+ '#title' => $this->t('Include destination'),
+ '#description' => $this->t('Include a "destination" parameter in the link to return the user to the original view upon completing the link action.'),
'#default_value' => $this->options['destination'],
);
}
diff --git a/core/modules/views/src/Plugin/views/field/MachineName.php b/core/modules/views/src/Plugin/views/field/MachineName.php
index 4b3521b..aff5a51 100644
--- a/core/modules/views/src/Plugin/views/field/MachineName.php
+++ b/core/modules/views/src/Plugin/views/field/MachineName.php
@@ -57,8 +57,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['machine_name'] = array(
- '#title' => t('Output machine name'),
- '#description' => t('Display field as machine name.'),
+ '#title' => $this->t('Output machine name'),
+ '#description' => $this->t('Display field as machine name.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['machine_name']),
);
diff --git a/core/modules/views/src/Plugin/views/field/Numeric.php b/core/modules/views/src/Plugin/views/field/Numeric.php
index df9343b..1e38a85 100644
--- a/core/modules/views/src/Plugin/views/field/Numeric.php
+++ b/core/modules/views/src/Plugin/views/field/Numeric.php
@@ -43,15 +43,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
if (!empty($this->definition['float'])) {
$form['set_precision'] = array(
'#type' => 'checkbox',
- '#title' => t('Round'),
- '#description' => t('If checked, the number will be rounded.'),
+ '#title' => $this->t('Round'),
+ '#description' => $this->t('If checked, the number will be rounded.'),
'#default_value' => $this->options['set_precision'],
);
$form['precision'] = array(
'#type' => 'textfield',
- '#title' => t('Precision'),
+ '#title' => $this->t('Precision'),
'#default_value' => $this->options['precision'],
- '#description' => t('Specify how many digits to print after the decimal point.'),
+ '#description' => $this->t('Specify how many digits to print after the decimal point.'),
'#states' => array(
'visible' => array(
':input[name="options[set_precision]"]' => array('checked' => TRUE),
@@ -61,37 +61,37 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['decimal'] = array(
'#type' => 'textfield',
- '#title' => t('Decimal point'),
+ '#title' => $this->t('Decimal point'),
'#default_value' => $this->options['decimal'],
- '#description' => t('What single character to use as a decimal point.'),
+ '#description' => $this->t('What single character to use as a decimal point.'),
'#size' => 2,
);
}
$form['separator'] = array(
'#type' => 'select',
- '#title' => t('Thousands marker'),
+ '#title' => $this->t('Thousands marker'),
'#options' => array(
- '' => t('- None -'),
- ',' => t('Comma'),
- ' ' => t('Space'),
- '.' => t('Decimal'),
- '\'' => t('Apostrophe'),
+ '' => $this->t('- None -'),
+ ',' => $this->t('Comma'),
+ ' ' => $this->t('Space'),
+ '.' => $this->t('Decimal'),
+ '\'' => $this->t('Apostrophe'),
),
'#default_value' => $this->options['separator'],
- '#description' => t('What single character to use as the thousands separator.'),
+ '#description' => $this->t('What single character to use as the thousands separator.'),
'#size' => 2,
);
$form['format_plural'] = array(
'#type' => 'checkbox',
- '#title' => t('Format plural'),
- '#description' => t('If checked, special handling will be used for plurality.'),
+ '#title' => $this->t('Format plural'),
+ '#description' => $this->t('If checked, special handling will be used for plurality.'),
'#default_value' => $this->options['format_plural'],
);
$form['format_plural_singular'] = array(
'#type' => 'textfield',
- '#title' => t('Singular form'),
+ '#title' => $this->t('Singular form'),
'#default_value' => $this->options['format_plural_singular'],
- '#description' => t('Text to use for the singular form.'),
+ '#description' => $this->t('Text to use for the singular form.'),
'#states' => array(
'visible' => array(
':input[name="options[format_plural]"]' => array('checked' => TRUE),
@@ -100,9 +100,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['format_plural_plural'] = array(
'#type' => 'textfield',
- '#title' => t('Plural form'),
+ '#title' => $this->t('Plural form'),
'#default_value' => $this->options['format_plural_plural'],
- '#description' => t('Text to use for the plural form, @count will be replaced with the value.'),
+ '#description' => $this->t('Text to use for the plural form, @count will be replaced with the value.'),
'#states' => array(
'visible' => array(
':input[name="options[format_plural]"]' => array('checked' => TRUE),
@@ -111,15 +111,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['prefix'] = array(
'#type' => 'textfield',
- '#title' => t('Prefix'),
+ '#title' => $this->t('Prefix'),
'#default_value' => $this->options['prefix'],
- '#description' => t('Text to put before the number, such as currency symbol.'),
+ '#description' => $this->t('Text to put before the number, such as currency symbol.'),
);
$form['suffix'] = array(
'#type' => 'textfield',
- '#title' => t('Suffix'),
+ '#title' => $this->t('Suffix'),
'#default_value' => $this->options['suffix'],
- '#description' => t('Text to put after the number, such as currency symbol.'),
+ '#description' => $this->t('Text to put after the number, such as currency symbol.'),
);
parent::buildOptionsForm($form, $form_state);
diff --git a/core/modules/views/src/Plugin/views/field/PrerenderList.php b/core/modules/views/src/Plugin/views/field/PrerenderList.php
index c309879..08c87e2 100644
--- a/core/modules/views/src/Plugin/views/field/PrerenderList.php
+++ b/core/modules/views/src/Plugin/views/field/PrerenderList.php
@@ -45,18 +45,18 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['type'] = array(
'#type' => 'radios',
- '#title' => t('Display type'),
+ '#title' => $this->t('Display type'),
'#options' => array(
- 'ul' => t('Unordered list'),
- 'ol' => t('Ordered list'),
- 'separator' => t('Simple separator'),
+ 'ul' => $this->t('Unordered list'),
+ 'ol' => $this->t('Ordered list'),
+ 'separator' => $this->t('Simple separator'),
),
'#default_value' => $this->options['type'],
);
$form['separator'] = array(
'#type' => 'textfield',
- '#title' => t('Separator'),
+ '#title' => $this->t('Separator'),
'#default_value' => $this->options['separator'],
'#states' => array(
'visible' => array(
diff --git a/core/modules/views/src/Plugin/views/field/Serialized.php b/core/modules/views/src/Plugin/views/field/Serialized.php
index 6432c7e..a039de6 100644
--- a/core/modules/views/src/Plugin/views/field/Serialized.php
+++ b/core/modules/views/src/Plugin/views/field/Serialized.php
@@ -33,18 +33,18 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['format'] = array(
'#type' => 'select',
- '#title' => t('Display format'),
- '#description' => t('How should the serialized data be displayed. You can choose a custom array/object key or a print_r on the full output.'),
+ '#title' => $this->t('Display format'),
+ '#description' => $this->t('How should the serialized data be displayed. You can choose a custom array/object key or a print_r on the full output.'),
'#options' => array(
- 'unserialized' => t('Full data (unserialized)'),
- 'serialized' => t('Full data (serialized)'),
- 'key' => t('A certain key'),
+ 'unserialized' => $this->t('Full data (unserialized)'),
+ 'serialized' => $this->t('Full data (serialized)'),
+ 'key' => $this->t('A certain key'),
),
'#default_value' => $this->options['format'],
);
$form['key'] = array(
'#type' => 'textfield',
- '#title' => t('Which key should be displayed'),
+ '#title' => $this->t('Which key should be displayed'),
'#default_value' => $this->options['key'],
'#states' => array(
'visible' => array(
@@ -57,7 +57,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
public function validateOptionsForm(&$form, FormStateInterface $form_state) {
// Require a key if the format is key.
if ($form_state->getValue(array('options', 'format')) == 'key' && $form_state->getValue(array('options', 'key')) == '') {
- $form_state->setError($form['key'], t('You have to enter a key if you want to display a key of the data.'));
+ $form_state->setError($form['key'], $this->t('You have to enter a key if you want to display a key of the data.'));
}
}
diff --git a/core/modules/views/src/Plugin/views/field/TimeInterval.php b/core/modules/views/src/Plugin/views/field/TimeInterval.php
index 62f0286..db0326a 100644
--- a/core/modules/views/src/Plugin/views/field/TimeInterval.php
+++ b/core/modules/views/src/Plugin/views/field/TimeInterval.php
@@ -70,8 +70,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['granularity'] = array(
'#type' => 'textfield',
- '#title' => t('Granularity'),
- '#description' => t('How many different units to display in the string.'),
+ '#title' => $this->t('Granularity'),
+ '#description' => $this->t('How many different units to display in the string.'),
'#default_value' => $this->options['granularity'],
);
}
diff --git a/core/modules/views/src/Plugin/views/field/Url.php b/core/modules/views/src/Plugin/views/field/Url.php
index 22ced7d..ea82308 100644
--- a/core/modules/views/src/Plugin/views/field/Url.php
+++ b/core/modules/views/src/Plugin/views/field/Url.php
@@ -32,7 +32,7 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['display_as_link'] = array(
- '#title' => t('Display as link'),
+ '#title' => $this->t('Display as link'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['display_as_link']),
);
diff --git a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
index 7a87faa..4e30ca9 100644
--- a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
+++ b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php
@@ -60,15 +60,15 @@ public function operatorOptions($which = 'title') {
protected function operators() {
return array(
'=' => array(
- 'title' => t('Is equal to'),
+ 'title' => $this->t('Is equal to'),
'method' => 'queryOpBoolean',
- 'short' => t('='),
+ 'short' => $this->t('='),
'values' => 1,
),
'!=' => array(
- 'title' => t('Is not equal to'),
+ 'title' => $this->t('Is not equal to'),
'method' => 'queryOpBoolean',
- 'short' => t('!='),
+ 'short' => $this->t('!='),
'values' => 1,
),
);
@@ -80,7 +80,7 @@ protected function operators() {
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
- $this->value_value = t('True');
+ $this->value_value = $this->t('True');
if (isset($this->definition['label'])) {
$this->value_value = $this->definition['label'];
}
@@ -108,19 +108,19 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
public function getValueOptions() {
if (isset($this->definition['type'])) {
if ($this->definition['type'] == 'yes-no') {
- $this->value_options = array(1 => t('Yes'), 0 => t('No'));
+ $this->value_options = array(1 => $this->t('Yes'), 0 => $this->t('No'));
}
if ($this->definition['type'] == 'on-off') {
- $this->value_options = array(1 => t('On'), 0 => t('Off'));
+ $this->value_options = array(1 => $this->t('On'), 0 => $this->t('Off'));
}
if ($this->definition['type'] == 'enabled-disabled') {
- $this->value_options = array(1 => t('Enabled'), 0 => t('Disabled'));
+ $this->value_options = array(1 => $this->t('Enabled'), 0 => $this->t('Disabled'));
}
}
// Provide a fallback if the above didn't set anything.
if (!isset($this->value_options)) {
- $this->value_options = array(1 => t('True'), 0 => t('False'));
+ $this->value_options = array(1 => $this->t('True'), 0 => $this->t('False'));
}
}
@@ -160,23 +160,23 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
}
// If we're configuring an exposed filter, add an - Any - option.
if (!$exposed || empty($this->options['expose']['required'])) {
- $form['value']['#options'] = array('All' => t('- Any -')) + $form['value']['#options'];
+ $form['value']['#options'] = array('All' => $this->t('- Any -')) + $form['value']['#options'];
}
}
}
protected function valueValidate($form, FormStateInterface $form_state) {
if ($form_state->getValue(array('options', 'value')) == 'All' && !$form_state->isValueEmpty(array('options', 'expose', 'required'))) {
- $form_state->setErrorByName('value', t('You must select a value unless this is an non-required exposed filter.'));
+ $form_state->setErrorByName('value', $this->t('You must select a value unless this is an non-required exposed filter.'));
}
}
public function adminSummary() {
if ($this->isAGroup()) {
- return t('grouped');
+ return $this->t('grouped');
}
if (!empty($this->options['exposed'])) {
- return t('exposed');
+ return $this->t('exposed');
}
if (empty($this->value_options)) {
$this->getValueOptions();
diff --git a/core/modules/views/src/Plugin/views/filter/Bundle.php b/core/modules/views/src/Plugin/views/filter/Bundle.php
index 2691541..92b4980 100644
--- a/core/modules/views/src/Plugin/views/filter/Bundle.php
+++ b/core/modules/views/src/Plugin/views/filter/Bundle.php
@@ -50,7 +50,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
public function getValueOptions() {
if (!isset($this->value_options)) {
$types = entity_get_bundles($this->entityTypeId);
- $this->value_title = t('@entity types', array('@entity' => $this->entityType->getLabel()));
+ $this->value_title = $this->t('@entity types', array('@entity' => $this->entityType->getLabel()));
$options = array();
foreach ($types as $type => $info) {
diff --git a/core/modules/views/src/Plugin/views/filter/Combine.php b/core/modules/views/src/Plugin/views/filter/Combine.php
index 7751027..20486db 100644
--- a/core/modules/views/src/Plugin/views/filter/Combine.php
+++ b/core/modules/views/src/Plugin/views/filter/Combine.php
@@ -43,15 +43,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
if ($options) {
$form['fields'] = array(
'#type' => 'select',
- '#title' => t('Choose fields to combine for filtering'),
- '#description' => t("This filter doesn't work for very special field handlers."),
+ '#title' => $this->t('Choose fields to combine for filtering'),
+ '#description' => $this->t("This filter doesn't work for very special field handlers."),
'#multiple' => TRUE,
'#options' => $options,
'#default_value' => $this->options['fields'],
);
}
else {
- $form_state->setErrorByName('', t('You have to add some fields to be able to use this filter.'));
+ $form_state->setErrorByName('', $this->t('You have to add some fields to be able to use this filter.'));
}
}
}
diff --git a/core/modules/views/src/Plugin/views/filter/Date.php b/core/modules/views/src/Plugin/views/filter/Date.php
index 8f0778a..7e5417f 100644
--- a/core/modules/views/src/Plugin/views/filter/Date.php
+++ b/core/modules/views/src/Plugin/views/filter/Date.php
@@ -34,10 +34,10 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
if (!$form_state->get('exposed')) {
$form['value']['type'] = array(
'#type' => 'radios',
- '#title' => t('Value type'),
+ '#title' => $this->t('Value type'),
'#options' => array(
- 'date' => t('A date in any machine readable format. CCYY-MM-DD HH:MM:SS is preferred.'),
- 'offset' => t('An offset from the current time such as "!example1" or "!example2"', array('!example1' => '+1 day', '!example2' => '-2 hours -30 minutes')),
+ 'date' => $this->t('A date in any machine readable format. CCYY-MM-DD HH:MM:SS is preferred.'),
+ 'offset' => $this->t('An offset from the current time such as "!example1" or "!example2"', array('!example1' => '+1 day', '!example2' => '-2 hours -30 minutes')),
),
'#default_value' => !empty($this->value['type']) ? $this->value['type'] : 'date',
);
@@ -87,17 +87,17 @@ public function validateValidTime(&$form, FormStateInterface $form_state, $opera
if ($operators[$operator]['values'] == 1) {
$convert = strtotime($value['value']);
if (!empty($form['value']) && ($convert == -1 || $convert === FALSE)) {
- $form_state->setError($form['value'], t('Invalid date format.'));
+ $form_state->setError($form['value'], $this->t('Invalid date format.'));
}
}
elseif ($operators[$operator]['values'] == 2) {
$min = strtotime($value['min']);
if ($min == -1 || $min === FALSE) {
- $form_state->setError($form['min'], t('Invalid date format.'));
+ $form_state->setError($form['min'], $this->t('Invalid date format.'));
}
$max = strtotime($value['max']);
if ($max == -1 || $max === FALSE) {
- $form_state->setError($form['max'], t('Invalid date format.'));
+ $form_state->setError($form['max'], $this->t('Invalid date format.'));
}
}
}
@@ -115,14 +115,14 @@ protected function buildGroupValidate($form, FormStateInterface $form_state) {
// Check if the title is defined but value wasn't defined.
if (!empty($group['title'])) {
if ((!is_array($group['value']) && empty($group['value'])) || (is_array($group['value']) && count(array_filter($group['value'])) == 1)) {
- $form_state->setError($form['group_info']['group_items'][$id]['value'], t('The value is required if title for this item is defined.'));
+ $form_state->setError($form['group_info']['group_items'][$id]['value'], $this->t('The value is required if title for this item is defined.'));
}
}
// Check if the value is defined but title wasn't defined.
if ((!is_array($group['value']) && !empty($group['value'])) || (is_array($group['value']) && count(array_filter($group['value'])) > 1)) {
if (empty($group['title'])) {
- $form_state->setError($form['group_info']['group_items'][$id]['title'], t('The title is required if value for this item is defined.'));
+ $form_state->setError($form['group_info']['group_items'][$id]['title'], $this->t('The title is required if value for this item is defined.'));
}
}
}
diff --git a/core/modules/views/src/Plugin/views/filter/Equality.php b/core/modules/views/src/Plugin/views/filter/Equality.php
index 9d25e0b..36070ae 100644
--- a/core/modules/views/src/Plugin/views/filter/Equality.php
+++ b/core/modules/views/src/Plugin/views/filter/Equality.php
@@ -26,8 +26,8 @@ class Equality extends FilterPluginBase {
*/
public function operatorOptions() {
return array(
- '=' => t('Is equal to'),
- '!=' => t('Is not equal to'),
+ '=' => $this->t('Is equal to'),
+ '!=' => $this->t('Is not equal to'),
);
}
@@ -37,7 +37,7 @@ public function operatorOptions() {
protected function valueForm(&$form, FormStateInterface $form_state) {
$form['value'] = array(
'#type' => 'textfield',
- '#title' => t('Value'),
+ '#title' => $this->t('Value'),
'#size' => 30,
'#default_value' => $this->value,
);
diff --git a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
index 602ecfe..15557be 100644
--- a/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/src/Plugin/views/filter/FilterPluginBase.php
@@ -291,7 +291,7 @@ protected function operatorForm(&$form, FormStateInterface $form_state) {
if (!empty($options)) {
$form['operator'] = array(
'#type' => count($options) < 10 ? 'radios' : 'select',
- '#title' => t('Operator'),
+ '#title' => $this->t('Operator'),
'#default_value' => $this->operator,
'#options' => $options,
);
@@ -384,18 +384,18 @@ protected function showBuildGroupButton(&$form, FormStateInterface $form_state)
'#weight' => -190,
);
- $grouped_description = t('Grouped filters allow a choice between predefined operator|value pairs.');
+ $grouped_description = $this->t('Grouped filters allow a choice between predefined operator|value pairs.');
$form['group_button']['radios'] = array(
'#theme_wrappers' => array('container'),
'#attributes' => array('class' => array('js-only')),
);
$form['group_button']['radios']['radios'] = array(
- '#title' => t('Filter type to expose'),
+ '#title' => $this->t('Filter type to expose'),
'#description' => $grouped_description,
'#type' => 'radios',
'#options' => array(
- t('Single filter'),
- t('Grouped filters'),
+ $this->t('Single filter'),
+ $this->t('Grouped filters'),
),
);
@@ -406,7 +406,7 @@ protected function showBuildGroupButton(&$form, FormStateInterface $form_state)
$form['group_button']['button'] = array(
'#limit_validation_errors' => array(),
'#type' => 'submit',
- '#value' => t('Grouped filters'),
+ '#value' => $this->t('Grouped filters'),
'#submit' => array(array($this, 'buildGroupForm')),
'#attributes' => array('class' => array('use-ajax-submit')),
);
@@ -416,7 +416,7 @@ protected function showBuildGroupButton(&$form, FormStateInterface $form_state)
$form['group_button']['button'] = array(
'#limit_validation_errors' => array(),
'#type' => 'submit',
- '#value' => t('Single filter'),
+ '#value' => $this->t('Single filter'),
'#submit' => array(array($this, 'buildGroupForm')),
'#attributes' => array('class' => array('use-ajax-submit')),
);
@@ -469,19 +469,19 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
'#attributes' => array('class' => array('js-only')),
);
$form['expose_button']['checkbox']['checkbox'] = array(
- '#title' => t('Expose this filter to visitors, to allow them to change it'),
+ '#title' => $this->t('Expose this filter to visitors, to allow them to change it'),
'#type' => 'checkbox',
);
// Then add the button itself.
if (empty($this->options['exposed'])) {
$form['expose_button']['markup'] = array(
- '#markup' => '
' . t('This filter is not exposed. Expose it to allow the users to change it.') . '
',
+ '#markup' => '
' . $this->t('This filter is not exposed. Expose it to allow the users to change it.') . '
',
);
$form['expose_button']['button'] = array(
'#limit_validation_errors' => array(),
'#type' => 'submit',
- '#value' => t('Expose filter'),
+ '#value' => $this->t('Expose filter'),
'#submit' => array(array($this, 'displayExposedForm')),
'#attributes' => array('class' => array('use-ajax-submit')),
);
@@ -489,12 +489,12 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
}
else {
$form['expose_button']['markup'] = array(
- '#markup' => '
' . t('This filter is exposed. If you hide it, users will not be able to change it.') . '
',
+ '#markup' => '
' . $this->t('This filter is exposed. If you hide it, users will not be able to change it.') . '
',
);
$form['expose_button']['button'] = array(
'#limit_validation_errors' => array(),
'#type' => 'submit',
- '#value' => t('Hide filter'),
+ '#value' => $this->t('Hide filter'),
'#submit' => array(array($this, 'displayExposedForm')),
'#attributes' => array('class' => array('use-ajax-submit')),
);
@@ -519,7 +519,7 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
if (empty($this->always_required)) {
$form['expose']['required'] = array(
'#type' => 'checkbox',
- '#title' => t('Required'),
+ '#title' => $this->t('Required'),
'#default_value' => $this->options['expose']['required'],
);
}
@@ -532,14 +532,14 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
$form['expose']['label'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['expose']['label'],
- '#title' => t('Label'),
+ '#title' => $this->t('Label'),
'#size' => 40,
);
$form['expose']['description'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['expose']['description'],
- '#title' => t('Description'),
+ '#title' => $this->t('Description'),
'#size' => 60,
);
@@ -552,16 +552,16 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
$form['expose']['use_operator'] = array(
'#type' => 'checkbox',
- '#title' => t('Expose operator'),
- '#description' => t('Allow the user to choose the operator.'),
+ '#title' => $this->t('Expose operator'),
+ '#description' => $this->t('Allow the user to choose the operator.'),
'#default_value' => !empty($this->options['expose']['use_operator']),
);
$form['expose']['operator_id'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['expose']['operator_id'],
- '#title' => t('Operator identifier'),
+ '#title' => $this->t('Operator identifier'),
'#size' => 40,
- '#description' => t('This will appear in the URL after the ? to identify this operator.'),
+ '#description' => $this->t('This will appear in the URL after the ? to identify this operator.'),
'#states' => array(
'visible' => array(
':input[name="options[expose][use_operator]"]' => array('checked' => TRUE),
@@ -579,23 +579,23 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
if (empty($this->alwaysMultiple)) {
$form['expose']['multiple'] = array(
'#type' => 'checkbox',
- '#title' => t('Allow multiple selections'),
- '#description' => t('Enable to allow users to select multiple items.'),
+ '#title' => $this->t('Allow multiple selections'),
+ '#description' => $this->t('Enable to allow users to select multiple items.'),
'#default_value' => $this->options['expose']['multiple'],
);
}
$form['expose']['remember'] = array(
'#type' => 'checkbox',
- '#title' => t('Remember the last selection'),
- '#description' => t('Enable to remember the last selection made by the user.'),
+ '#title' => $this->t('Remember the last selection'),
+ '#description' => $this->t('Enable to remember the last selection made by the user.'),
'#default_value' => $this->options['expose']['remember'],
);
$role_options = array_map('\Drupal\Component\Utility\String::checkPlain', user_role_names());
$form['expose']['remember_roles'] = array(
'#type' => 'checkboxes',
- '#title' => t('User roles'),
- '#description' => t('Remember exposed selection only for the selected user role(s). If you select no roles, the exposed data will never be stored.'),
+ '#title' => $this->t('User roles'),
+ '#description' => $this->t('Remember exposed selection only for the selected user role(s). If you select no roles, the exposed data will never be stored.'),
'#default_value' => $this->options['expose']['remember_roles'],
'#options' => $role_options,
'#states' => array(
@@ -608,9 +608,9 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
$form['expose']['identifier'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['expose']['identifier'],
- '#title' => t('Filter identifier'),
+ '#title' => $this->t('Filter identifier'),
'#size' => 40,
- '#description' => t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
+ '#description' => $this->t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
);
}
@@ -620,14 +620,14 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
public function validateExposeForm($form, FormStateInterface $form_state) {
$identifier = $form_state->getValue(array('options', 'expose', 'identifier'));
if (empty($identifier)) {
- $form_state->setError($form['expose']['identifier'], t('The identifier is required if the filter is exposed.'));
+ $form_state->setError($form['expose']['identifier'], $this->t('The identifier is required if the filter is exposed.'));
}
elseif ($identifier == 'value') {
- $form_state->setError($form['expose']['identifier'], t('This identifier is not allowed.'));
+ $form_state->setError($form['expose']['identifier'], $this->t('This identifier is not allowed.'));
}
if (!$this->view->display_handler->isIdentifierUnique($form_state->get('id'), $identifier)) {
- $form_state->setError($form['expose']['identifier'], t('This identifier is used by another handler.'));
+ $form_state->setError($form['expose']['identifier'], $this->t('This identifier is used by another handler.'));
}
}
@@ -638,15 +638,15 @@ protected function buildGroupValidate($form, FormStateInterface $form_state) {
if (!$form_state->isValueEmpty(array('options', 'group_info'))) {
$identifier = $form_state->getValue(array('options', 'group_info', 'identifier'));
if (empty($identifier)) {
- $form_state->setError($form['group_info']['identifier'], t('The identifier is required if the filter is exposed.'));
+ $form_state->setError($form['group_info']['identifier'], $this->t('The identifier is required if the filter is exposed.'));
}
elseif ($identifier == 'value') {
- $form_state->setError($form['group_info']['identifier'], t('This identifier is not allowed.'));
+ $form_state->setError($form['group_info']['identifier'], $this->t('This identifier is not allowed.'));
}
if (!$this->view->display_handler->isIdentifierUnique($form_state->get('id'), $identifier)) {
- $form_state->setError($form['group_info']['identifier'], t('This identifier is used by another handler.'));
+ $form_state->setError($form['group_info']['identifier'], $this->t('This identifier is used by another handler.'));
}
}
@@ -660,7 +660,7 @@ protected function buildGroupValidate($form, FormStateInterface $form_state) {
if (!empty($group['title']) && $operators[$group['operator']]['values'] > 0) {
if ((!is_array($group['value']) && trim($group['value']) == "") ||
(is_array($group['value']) && count(array_filter($group['value'], 'static::arrayFilterZero')) == 0)) {
- $form_state->setError($form['group_info']['group_items'][$id]['value'], t('The value is required if title for this item is defined.'));
+ $form_state->setError($form['group_info']['group_items'][$id]['value'], $this->t('The value is required if title for this item is defined.'));
}
}
@@ -668,7 +668,7 @@ protected function buildGroupValidate($form, FormStateInterface $form_state) {
if ((!is_array($group['value']) && trim($group['value']) != "") ||
(is_array($group['value']) && count(array_filter($group['value'], 'static::arrayFilterZero')) > 0)) {
if (empty($group['title'])) {
- $form_state->setError($form['group_info']['group_items'][$id]['title'], t('The title is required if value for this item is defined.'));
+ $form_state->setError($form['group_info']['group_items'][$id]['title'], $this->t('The title is required if value for this item is defined.'));
}
}
}
@@ -750,11 +750,11 @@ protected function buildGroupOptions() {
*/
public function groupForm(&$form, FormStateInterface $form_state) {
if (!empty($this->options['group_info']['optional']) && !$this->multipleExposedInput()) {
- $groups = array('All' => t('- Any -'));
+ $groups = array('All' => $this->t('- Any -'));
}
foreach ($this->options['group_info']['group_items'] as $id => $group) {
if (!empty($group['title'])) {
- $groups[$id] = $id != 'All' ? t($group['title']) : $group['title'];
+ $groups[$id] = $id != 'All' ? $this->t($group['title']) : $group['title'];
}
}
@@ -862,48 +862,48 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form
$form['group_info']['identifier'] = array(
'#type' => 'textfield',
'#default_value' => $identifier,
- '#title' => t('Filter identifier'),
+ '#title' => $this->t('Filter identifier'),
'#size' => 40,
- '#description' => t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
+ '#description' => $this->t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
);
$form['group_info']['label'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['group_info']['label'],
- '#title' => t('Label'),
+ '#title' => $this->t('Label'),
'#size' => 40,
);
$form['group_info']['description'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['group_info']['description'],
- '#title' => t('Description'),
+ '#title' => $this->t('Description'),
'#size' => 60,
);
$form['group_info']['optional'] = array(
'#type' => 'checkbox',
- '#title' => t('Optional'),
- '#description' => t('This exposed filter is optional and will have added options to allow it not to be set.'),
+ '#title' => $this->t('Optional'),
+ '#description' => $this->t('This exposed filter is optional and will have added options to allow it not to be set.'),
'#default_value' => $this->options['group_info']['optional'],
);
$form['group_info']['multiple'] = array(
'#type' => 'checkbox',
- '#title' => t('Allow multiple selections'),
- '#description' => t('Enable to allow users to select multiple items.'),
+ '#title' => $this->t('Allow multiple selections'),
+ '#description' => $this->t('Enable to allow users to select multiple items.'),
'#default_value' => $this->options['group_info']['multiple'],
);
$form['group_info']['widget'] = array(
'#type' => 'radios',
'#default_value' => $this->options['group_info']['widget'],
- '#title' => t('Widget type'),
+ '#title' => $this->t('Widget type'),
'#options' => array(
- 'radios' => t('Radios'),
- 'select' => t('Select'),
+ 'radios' => $this->t('Radios'),
+ 'select' => $this->t('Select'),
),
- '#description' => t('Select which kind of widget will be used to render the group of filters'),
+ '#description' => $this->t('Select which kind of widget will be used to render the group of filters'),
);
$form['group_info']['remember'] = array(
'#type' => 'checkbox',
- '#title' => t('Remember'),
- '#description' => t('Remember the last setting the user gave this filter.'),
+ '#title' => $this->t('Remember'),
+ '#description' => $this->t('Remember the last setting the user gave this filter.'),
'#default_value' => $this->options['group_info']['remember'],
);
@@ -916,40 +916,40 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form
$form['group_info']['identifier'] = array(
'#type' => 'textfield',
'#default_value' => $identifier,
- '#title' => t('Filter identifier'),
+ '#title' => $this->t('Filter identifier'),
'#size' => 40,
- '#description' => t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
+ '#description' => $this->t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
);
$form['group_info']['label'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['group_info']['label'],
- '#title' => t('Label'),
+ '#title' => $this->t('Label'),
'#size' => 40,
);
$form['group_info']['optional'] = array(
'#type' => 'checkbox',
- '#title' => t('Optional'),
- '#description' => t('This exposed filter is optional and will have added options to allow it not to be set.'),
+ '#title' => $this->t('Optional'),
+ '#description' => $this->t('This exposed filter is optional and will have added options to allow it not to be set.'),
'#default_value' => $this->options['group_info']['optional'],
);
$form['group_info']['widget'] = array(
'#type' => 'radios',
'#default_value' => $this->options['group_info']['widget'],
- '#title' => t('Widget type'),
+ '#title' => $this->t('Widget type'),
'#options' => array(
- 'radios' => t('Radios'),
- 'select' => t('Select'),
+ 'radios' => $this->t('Radios'),
+ 'select' => $this->t('Select'),
),
- '#description' => t('Select which kind of widget will be used to render the group of filters'),
+ '#description' => $this->t('Select which kind of widget will be used to render the group of filters'),
);
$form['group_info']['remember'] = array(
'#type' => 'checkbox',
- '#title' => t('Remember'),
- '#description' => t('Remember the last setting the user gave this filter.'),
+ '#title' => $this->t('Remember'),
+ '#description' => $this->t('Remember the last setting the user gave this filter.'),
'#default_value' => $this->options['group_info']['remember'],
);
- $groups = array('All' => t('- Any -')); // The string '- Any -' will not be rendered see @theme_views_ui_build_group_filter_form
+ $groups = array('All' => $this->t('- Any -')); // The string '- Any -' will not be rendered see @theme_views_ui_build_group_filter_form
// Provide 3 options to start when we are in a new group.
if (count($this->options['group_info']['group_items']) == 0) {
@@ -970,7 +970,7 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form
// In each row, we have to display the operator form and the value from
// $row acts as a fake form to render each widget in a row.
$row = array();
- $groups[$item_id] = t('Grouping @id', array('@id' => $item_id));
+ $groups[$item_id] = $this->t('Grouping @id', array('@id' => $item_id));
$this->operatorForm($row, $form_state);
// Force the operator form to be a select box. Some handlers uses
// radios and they occupy a lot of space in a table row.
@@ -1028,7 +1028,7 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form
// Per item group, we have a title that identifies it.
$form['group_info']['group_items'][$item_id] = array(
'title' => array(
- '#title' => t('Label'),
+ '#title' => $this->t('Label'),
'#title_display' => 'invisible',
'#type' => 'textfield',
'#size' => 20,
@@ -1045,7 +1045,7 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form
'#default_value' => 0,
),
'weight' => array(
- '#title' => t('Weight'),
+ '#title' => $this->t('Weight'),
'#title_display' => 'invisible',
'#type' => 'weight',
'#delta' => 10,
@@ -1078,7 +1078,7 @@ protected function buildExposedFiltersGroupForm(&$form, FormStateInterface $form
'#prefix' => '
',
'#suffix' => '
',
'#type' => 'submit',
- '#value' => t('Add another item'),
+ '#value' => $this->t('Add another item'),
'#submit' => array(array($this, 'addGroupForm')),
'#attributes' => array('class' => array('use-ajax-submit')),
);
@@ -1156,7 +1156,7 @@ protected function exposedTranslate(&$form, $type) {
}
if ($type == 'value' && empty($this->always_required) && empty($this->options['expose']['required']) && $form['#type'] == 'select' && empty($form['#multiple'])) {
- $form['#options'] = array('All' => t('- Any -')) + $form['#options'];
+ $form['#options'] = array('All' => $this->t('- Any -')) + $form['#options'];
$form['#default_value'] = 'All';
}
diff --git a/core/modules/views/src/Plugin/views/filter/InOperator.php b/core/modules/views/src/Plugin/views/filter/InOperator.php
index 4d442b8..cbb781e 100644
--- a/core/modules/views/src/Plugin/views/filter/InOperator.php
+++ b/core/modules/views/src/Plugin/views/filter/InOperator.php
@@ -40,7 +40,7 @@ class InOperator extends FilterPluginBase {
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
- $this->value_title = t('Options');
+ $this->value_title = $this->t('Options');
$this->value_options = NULL;
}
@@ -69,7 +69,7 @@ public function getValueOptions() {
}
}
else {
- $this->value_options = array(t('Yes'), t('No'));
+ $this->value_options = array(t('Yes'), $this->t('No'));
}
return $this->value_options;
@@ -84,8 +84,8 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
parent::buildExposeForm($form, $form_state);
$form['expose']['reduce'] = array(
'#type' => 'checkbox',
- '#title' => t('Limit list to selected items'),
- '#description' => t('If checked, the only items presented to the user will be the ones selected here.'),
+ '#title' => $this->t('Limit list to selected items'),
+ '#description' => $this->t('If checked, the only items presented to the user will be the ones selected here.'),
'#default_value' => !empty($this->options['expose']['reduce']), // safety
);
}
@@ -108,16 +108,16 @@ protected function defineOptions() {
function operators() {
$operators = array(
'in' => array(
- 'title' => t('Is one of'),
- 'short' => t('in'),
- 'short_single' => t('='),
+ 'title' => $this->t('Is one of'),
+ 'short' => $this->t('in'),
+ 'short_single' => $this->t('='),
'method' => 'opSimple',
'values' => 1,
),
'not in' => array(
- 'title' => t('Is not one of'),
- 'short' => t('not in'),
- 'short_single' => t('<>'),
+ 'title' => $this->t('Is not one of'),
+ 'short' => $this->t('not in'),
+ 'short_single' => $this->t('<>'),
'method' => 'opSimple',
'values' => 1,
),
@@ -126,15 +126,15 @@ function operators() {
if (!empty($this->definition['allow empty'])) {
$operators += array(
'empty' => array(
- 'title' => t('Is empty (NULL)'),
+ 'title' => $this->t('Is empty (NULL)'),
'method' => 'opEmpty',
- 'short' => t('empty'),
+ 'short' => $this->t('empty'),
'values' => 0,
),
'not empty' => array(
- 'title' => t('Is not empty (NOT NULL)'),
+ 'title' => $this->t('Is not empty (NOT NULL)'),
'method' => 'opEmpty',
- 'short' => t('not empty'),
+ 'short' => $this->t('not empty'),
'values' => 0,
),
);
@@ -173,7 +173,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
$exposed = $form_state->get('exposed');
if (!$exposed) {
// Add a select all option to the value form.
- $options = array('all' => t('Select all'));
+ $options = array('all' => $this->t('Select all'));
}
$this->getValueOptions();
@@ -314,10 +314,10 @@ protected function valueSubmit($form, FormStateInterface $form_state) {
public function adminSummary() {
if ($this->isAGroup()) {
- return t('grouped');
+ return $this->t('grouped');
}
if (!empty($this->options['exposed'])) {
- return t('exposed');
+ return $this->t('exposed');
}
$info = $this->operators();
@@ -338,7 +338,7 @@ public function adminSummary() {
}
// Choose different kind of ouput for 0, a single and multiple values.
if (count($this->value) == 0) {
- $values = t('Unknown');
+ $values = $this->t('Unknown');
}
else if (count($this->value) == 1) {
// If any, use the 'single' short name of the operator instead.
@@ -415,7 +415,7 @@ public function validate() {
}
if (!in_array($this->operator, $this->operatorValues(1))) {
- $errors[] = t('The operator is invalid on filter: @filter.', array('@filter' => $this->adminLabel(TRUE)));
+ $errors[] = $this->t('The operator is invalid on filter: @filter.', array('@filter' => $this->adminLabel(TRUE)));
}
if (is_array($this->value)) {
if (!isset($this->value_options)) {
@@ -438,11 +438,11 @@ public function validate() {
}
// Choose different kind of ouput for 0, a single and multiple values.
if (count($this->value) == 0) {
- $errors[] = t('No valid values found on filter: @filter.', array('@filter' => $this->adminLabel(TRUE)));
+ $errors[] = $this->t('No valid values found on filter: @filter.', array('@filter' => $this->adminLabel(TRUE)));
}
}
elseif (!empty($this->value) && ($this->operator == 'in' || $this->operator == 'not in')) {
- $errors[] = t('The value @value is not an array for @operator on filter: @filter', array('@value' => var_export($this->value), '@operator' => $this->operator, '@filter' => $this->adminLabel(TRUE)));
+ $errors[] = $this->t('The value @value is not an array for @operator on filter: @filter', array('@value' => var_export($this->value), '@operator' => $this->operator, '@filter' => $this->adminLabel(TRUE)));
}
return $errors;
}
diff --git a/core/modules/views/src/Plugin/views/filter/LanguageFilter.php b/core/modules/views/src/Plugin/views/filter/LanguageFilter.php
index 67d6a4f..ba7ac15 100644
--- a/core/modules/views/src/Plugin/views/filter/LanguageFilter.php
+++ b/core/modules/views/src/Plugin/views/filter/LanguageFilter.php
@@ -24,7 +24,7 @@ class LanguageFilter extends InOperator {
*/
public function getValueOptions() {
if (!isset($this->value_options)) {
- $this->value_title = t('Language');
+ $this->value_title = $this->t('Language');
$this->value_options = $this->listLanguages(LanguageInterface::STATE_ALL |LanguageInterface::STATE_SITE_DEFAULT | PluginBase::INCLUDE_NEGOTIATED);
}
}
diff --git a/core/modules/views/src/Plugin/views/filter/ManyToOne.php b/core/modules/views/src/Plugin/views/filter/ManyToOne.php
index bd5c1ee..5770349 100644
--- a/core/modules/views/src/Plugin/views/filter/ManyToOne.php
+++ b/core/modules/views/src/Plugin/views/filter/ManyToOne.php
@@ -62,25 +62,25 @@ protected function defineOptions() {
function operators() {
$operators = array(
'or' => array(
- 'title' => t('Is one of'),
- 'short' => t('or'),
- 'short_single' => t('='),
+ 'title' => $this->t('Is one of'),
+ 'short' => $this->t('or'),
+ 'short_single' => $this->t('='),
'method' => 'opHelper',
'values' => 1,
'ensure_my_table' => 'helper',
),
'and' => array(
- 'title' => t('Is all of'),
- 'short' => t('and'),
- 'short_single' => t('='),
+ 'title' => $this->t('Is all of'),
+ 'short' => $this->t('and'),
+ 'short_single' => $this->t('='),
'method' => 'opHelper',
'values' => 1,
'ensure_my_table' => 'helper',
),
'not' => array(
- 'title' => t('Is none of'),
- 'short' => t('not'),
- 'short_single' => t('<>'),
+ 'title' => $this->t('Is none of'),
+ 'short' => $this->t('not'),
+ 'short_single' => $this->t('<>'),
'method' => 'opHelper',
'values' => 1,
'ensure_my_table' => 'helper',
@@ -90,15 +90,15 @@ function operators() {
if (!empty($this->definition['allow empty'])) {
$operators += array(
'empty' => array(
- 'title' => t('Is empty (NULL)'),
+ 'title' => $this->t('Is empty (NULL)'),
'method' => 'opEmpty',
- 'short' => t('empty'),
+ 'short' => $this->t('empty'),
'values' => 0,
),
'not empty' => array(
- 'title' => t('Is not empty (NOT NULL)'),
+ 'title' => $this->t('Is not empty (NOT NULL)'),
'method' => 'opEmpty',
- 'short' => t('not empty'),
+ 'short' => $this->t('not empty'),
'values' => 0,
),
);
diff --git a/core/modules/views/src/Plugin/views/filter/Numeric.php b/core/modules/views/src/Plugin/views/filter/Numeric.php
index 5579158..38c0fca 100644
--- a/core/modules/views/src/Plugin/views/filter/Numeric.php
+++ b/core/modules/views/src/Plugin/views/filter/Numeric.php
@@ -39,56 +39,56 @@ protected function defineOptions() {
function operators() {
$operators = array(
'<' => array(
- 'title' => t('Is less than'),
+ 'title' => $this->t('Is less than'),
'method' => 'opSimple',
- 'short' => t('<'),
+ 'short' => $this->t('<'),
'values' => 1,
),
'<=' => array(
- 'title' => t('Is less than or equal to'),
+ 'title' => $this->t('Is less than or equal to'),
'method' => 'opSimple',
- 'short' => t('<='),
+ 'short' => $this->t('<='),
'values' => 1,
),
'=' => array(
- 'title' => t('Is equal to'),
+ 'title' => $this->t('Is equal to'),
'method' => 'opSimple',
- 'short' => t('='),
+ 'short' => $this->t('='),
'values' => 1,
),
'!=' => array(
- 'title' => t('Is not equal to'),
+ 'title' => $this->t('Is not equal to'),
'method' => 'opSimple',
- 'short' => t('!='),
+ 'short' => $this->t('!='),
'values' => 1,
),
'>=' => array(
- 'title' => t('Is greater than or equal to'),
+ 'title' => $this->t('Is greater than or equal to'),
'method' => 'opSimple',
- 'short' => t('>='),
+ 'short' => $this->t('>='),
'values' => 1,
),
'>' => array(
- 'title' => t('Is greater than'),
+ 'title' => $this->t('Is greater than'),
'method' => 'opSimple',
- 'short' => t('>'),
+ 'short' => $this->t('>'),
'values' => 1,
),
'between' => array(
- 'title' => t('Is between'),
+ 'title' => $this->t('Is between'),
'method' => 'opBetween',
- 'short' => t('between'),
+ 'short' => $this->t('between'),
'values' => 2,
),
'not between' => array(
- 'title' => t('Is not between'),
+ 'title' => $this->t('Is not between'),
'method' => 'opBetween',
- 'short' => t('not between'),
+ 'short' => $this->t('not between'),
'values' => 2,
),
'regular_expression' => array(
- 'title' => t('Regular expression'),
- 'short' => t('regex'),
+ 'title' => $this->t('Regular expression'),
+ 'short' => $this->t('regex'),
'method' => 'op_regex',
'values' => 1,
),
@@ -98,15 +98,15 @@ function operators() {
if (!empty($this->definition['allow empty'])) {
$operators += array(
'empty' => array(
- 'title' => t('Is empty (NULL)'),
+ 'title' => $this->t('Is empty (NULL)'),
'method' => 'opEmpty',
- 'short' => t('empty'),
+ 'short' => $this->t('empty'),
'values' => 0,
),
'not empty' => array(
- 'title' => t('Is not empty (NOT NULL)'),
+ 'title' => $this->t('Is not empty (NOT NULL)'),
'method' => 'opEmpty',
- 'short' => t('not empty'),
+ 'short' => $this->t('not empty'),
'values' => 0,
),
);
@@ -168,7 +168,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
if ($which == 'all') {
$form['value']['value'] = array(
'#type' => 'textfield',
- '#title' => !$exposed ? t('Value') : '',
+ '#title' => !$exposed ? $this->t('Value') : '',
'#size' => 30,
'#default_value' => $this->value['value'],
);
@@ -188,7 +188,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
// the operator is locked.
$form['value'] = array(
'#type' => 'textfield',
- '#title' => !$exposed ? t('Value') : '',
+ '#title' => !$exposed ? $this->t('Value') : '',
'#size' => 30,
'#default_value' => $this->value['value'],
);
@@ -201,13 +201,13 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
if ($which == 'all' || $which == 'minmax') {
$form['value']['min'] = array(
'#type' => 'textfield',
- '#title' => !$exposed ? t('Min') : '',
+ '#title' => !$exposed ? $this->t('Min') : '',
'#size' => 30,
'#default_value' => $this->value['min'],
);
$form['value']['max'] = array(
'#type' => 'textfield',
- '#title' => !$exposed ? t('And max') : t('And'),
+ '#title' => !$exposed ? $this->t('And max') : $this->t('And'),
'#size' => 30,
'#default_value' => $this->value['max'],
);
@@ -285,16 +285,16 @@ protected function opRegex($field) {
public function adminSummary() {
if ($this->isAGroup()) {
- return t('grouped');
+ return $this->t('grouped');
}
if (!empty($this->options['exposed'])) {
- return t('exposed');
+ return $this->t('exposed');
}
$options = $this->operatorOptions('short');
$output = UtilityString::checkPlain($options[$this->operator]);
if (in_array($this->operator, $this->operatorValues(2))) {
- $output .= ' ' . t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));
+ $output .= ' ' . $this->t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));
}
elseif (in_array($this->operator, $this->operatorValues(1))) {
$output .= ' ' . UtilityString::checkPlain($this->value['value']);
diff --git a/core/modules/views/src/Plugin/views/filter/String.php b/core/modules/views/src/Plugin/views/filter/String.php
index a93c907..633dd38 100644
--- a/core/modules/views/src/Plugin/views/filter/String.php
+++ b/core/modules/views/src/Plugin/views/filter/String.php
@@ -40,80 +40,80 @@ protected function defineOptions() {
function operators() {
$operators = array(
'=' => array(
- 'title' => t('Is equal to'),
- 'short' => t('='),
+ 'title' => $this->t('Is equal to'),
+ 'short' => $this->t('='),
'method' => 'opEqual',
'values' => 1,
),
'!=' => array(
- 'title' => t('Is not equal to'),
- 'short' => t('!='),
+ 'title' => $this->t('Is not equal to'),
+ 'short' => $this->t('!='),
'method' => 'opEqual',
'values' => 1,
),
'contains' => array(
- 'title' => t('Contains'),
- 'short' => t('contains'),
+ 'title' => $this->t('Contains'),
+ 'short' => $this->t('contains'),
'method' => 'opContains',
'values' => 1,
),
'word' => array(
- 'title' => t('Contains any word'),
- 'short' => t('has word'),
+ 'title' => $this->t('Contains any word'),
+ 'short' => $this->t('has word'),
'method' => 'opContainsWord',
'values' => 1,
),
'allwords' => array(
- 'title' => t('Contains all words'),
- 'short' => t('has all'),
+ 'title' => $this->t('Contains all words'),
+ 'short' => $this->t('has all'),
'method' => 'opContainsWord',
'values' => 1,
),
'starts' => array(
- 'title' => t('Starts with'),
- 'short' => t('begins'),
+ 'title' => $this->t('Starts with'),
+ 'short' => $this->t('begins'),
'method' => 'opStartsWith',
'values' => 1,
),
'not_starts' => array(
- 'title' => t('Does not start with'),
- 'short' => t('not_begins'),
+ 'title' => $this->t('Does not start with'),
+ 'short' => $this->t('not_begins'),
'method' => 'opNotStartsWith',
'values' => 1,
),
'ends' => array(
- 'title' => t('Ends with'),
- 'short' => t('ends'),
+ 'title' => $this->t('Ends with'),
+ 'short' => $this->t('ends'),
'method' => 'opEndsWith',
'values' => 1,
),
'not_ends' => array(
- 'title' => t('Does not end with'),
- 'short' => t('not_ends'),
+ 'title' => $this->t('Does not end with'),
+ 'short' => $this->t('not_ends'),
'method' => 'opNotEndsWith',
'values' => 1,
),
'not' => array(
- 'title' => t('Does not contain'),
- 'short' => t('!has'),
+ 'title' => $this->t('Does not contain'),
+ 'short' => $this->t('!has'),
'method' => 'opNotLike',
'values' => 1,
),
'shorterthan' => array(
- 'title' => t('Length is shorter than'),
- 'short' => t('shorter than'),
+ 'title' => $this->t('Length is shorter than'),
+ 'short' => $this->t('shorter than'),
'method' => 'opShorterThan',
'values' => 1,
),
'longerthan' => array(
- 'title' => t('Length is longer than'),
- 'short' => t('longer than'),
+ 'title' => $this->t('Length is longer than'),
+ 'short' => $this->t('longer than'),
'method' => 'opLongerThan',
'values' => 1,
),
'regular_expression' => array(
- 'title' => t('Regular expression'),
- 'short' => t('regex'),
+ 'title' => $this->t('Regular expression'),
+ 'short' => $this->t('regex'),
'method' => 'opRegex',
'values' => 1,
),
@@ -122,15 +122,15 @@ function operators() {
if (!empty($this->definition['allow empty'])) {
$operators += array(
'empty' => array(
- 'title' => t('Is empty (NULL)'),
+ 'title' => $this->t('Is empty (NULL)'),
'method' => 'opEmpty',
- 'short' => t('empty'),
+ 'short' => $this->t('empty'),
'values' => 0,
),
'not empty' => array(
- 'title' => t('Is not empty (NOT NULL)'),
+ 'title' => $this->t('Is not empty (NOT NULL)'),
'method' => 'opEmpty',
- 'short' => t('not empty'),
+ 'short' => $this->t('not empty'),
'values' => 0,
),
);
@@ -153,10 +153,10 @@ public function operatorOptions($which = 'title') {
public function adminSummary() {
if ($this->isAGroup()) {
- return t('grouped');
+ return $this->t('grouped');
}
if (!empty($this->options['exposed'])) {
- return t('exposed');
+ return $this->t('exposed');
}
$options = $this->operatorOptions('short');
@@ -208,7 +208,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
if ($which == 'all' || $which == 'value') {
$form['value'] = array(
'#type' => 'textfield',
- '#title' => t('Value'),
+ '#title' => $this->t('Value'),
'#size' => 30,
'#default_value' => $this->value,
);
diff --git a/core/modules/views/src/Plugin/views/pager/Full.php b/core/modules/views/src/Plugin/views/pager/Full.php
index ed8bbd1..2fbf4c8 100644
--- a/core/modules/views/src/Plugin/views/pager/Full.php
+++ b/core/modules/views/src/Plugin/views/pager/Full.php
@@ -48,21 +48,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['quantity'] = array(
'#type' => 'number',
- '#title' => t('Number of pager links visible'),
- '#description' => t('Specify the number of links to pages to display in the pager.'),
+ '#title' => $this->t('Number of pager links visible'),
+ '#description' => $this->t('Specify the number of links to pages to display in the pager.'),
'#default_value' => $this->options['quantity'],
);
$form['tags']['first'] = array(
'#type' => 'textfield',
- '#title' => t('First page link text'),
+ '#title' => $this->t('First page link text'),
'#default_value' => $this->options['tags']['first'],
'#weight' => -10,
);
$form['tags']['last'] = array(
'#type' => 'textfield',
- '#title' => t('Last page link text'),
+ '#title' => $this->t('Last page link text'),
'#default_value' => $this->options['tags']['last'],
'#weight' => 10,
);
diff --git a/core/modules/views/src/Plugin/views/pager/None.php b/core/modules/views/src/Plugin/views/pager/None.php
index 15bfa13..b364032 100644
--- a/core/modules/views/src/Plugin/views/pager/None.php
+++ b/core/modules/views/src/Plugin/views/pager/None.php
@@ -37,9 +37,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
public function summaryTitle() {
if (!empty($this->options['offset'])) {
- return t('All items, skip @skip', array('@skip' => $this->options['offset']));
+ return $this->t('All items, skip @skip', array('@skip' => $this->options['offset']));
}
- return t('All items');
+ return $this->t('All items');
}
protected function defineOptions() {
@@ -56,8 +56,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['offset'] = array(
'#type' => 'textfield',
- '#title' => t('Offset (number of items to skip)'),
- '#description' => t('For example, set this to 3 and the first 3 items will not be displayed.'),
+ '#title' => $this->t('Offset (number of items to skip)'),
+ '#description' => $this->t('For example, set this to 3 and the first 3 items will not be displayed.'),
'#default_value' => $this->options['offset'],
);
}
diff --git a/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php b/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php
index 12a7098..72b578a 100644
--- a/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php
+++ b/core/modules/views/src/Plugin/views/pager/PagerPluginBase.php
@@ -132,7 +132,7 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) { }
* pager plugin.
*/
public function summaryTitle() {
- return t('Unknown');
+ return $this->t('Unknown');
}
/**
diff --git a/core/modules/views/src/Plugin/views/pager/Some.php b/core/modules/views/src/Plugin/views/pager/Some.php
index d024960..effc40e 100644
--- a/core/modules/views/src/Plugin/views/pager/Some.php
+++ b/core/modules/views/src/Plugin/views/pager/Some.php
@@ -53,8 +53,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['offset'] = array(
'#type' => 'textfield',
- '#title' => t('Offset (number of items to skip)'),
- '#description' => t('For example, set this to 3 and the first 3 items will not be displayed.'),
+ '#title' => $this->t('Offset (number of items to skip)'),
+ '#description' => $this->t('For example, set this to 3 and the first 3 items will not be displayed.'),
'#default_value' => $this->options['offset'],
);
}
diff --git a/core/modules/views/src/Plugin/views/pager/SqlBase.php b/core/modules/views/src/Plugin/views/pager/SqlBase.php
index 8a4a8e5..0abedd2 100644
--- a/core/modules/views/src/Plugin/views/pager/SqlBase.php
+++ b/core/modules/views/src/Plugin/views/pager/SqlBase.php
@@ -56,22 +56,22 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['offset'] = array(
'#type' => 'number',
- '#title' => t('Offset (number of items to skip)'),
- '#description' => t('For example, set this to 3 and the first 3 items will not be displayed.'),
+ '#title' => $this->t('Offset (number of items to skip)'),
+ '#description' => $this->t('For example, set this to 3 and the first 3 items will not be displayed.'),
'#default_value' => $this->options['offset'],
);
$form['id'] = array(
'#type' => 'number',
- '#title' => t('Pager ID'),
- '#description' => t("Unless you're experiencing problems with pagers related to this view, you should leave this at 0. If using multiple pagers on one page you may need to set this number to a higher value so as not to conflict within the ?page= array. Large values will add a lot of commas to your URLs, so avoid if possible."),
+ '#title' => $this->t('Pager ID'),
+ '#description' => $this->t("Unless you're experiencing problems with pagers related to this view, you should leave this at 0. If using multiple pagers on one page you may need to set this number to a higher value so as not to conflict within the ?page= array. Large values will add a lot of commas to your URLs, so avoid if possible."),
'#default_value' => $this->options['id'],
);
$form['total_pages'] = array(
'#type' => 'number',
- '#title' => t('Number of pages'),
- '#description' => t('The total number of pages. Leave empty to show all pages.'),
+ '#title' => $this->t('Number of pages'),
+ '#description' => $this->t('The total number of pages. Leave empty to show all pages.'),
'#default_value' => $this->options['total_pages'],
);
@@ -79,19 +79,19 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#type' => 'details',
'#open' => TRUE,
'#tree' => TRUE,
- '#title' => t('Pager link labels'),
+ '#title' => $this->t('Pager link labels'),
'#input' => TRUE,
);
$form['tags']['previous'] = array(
'#type' => 'textfield',
- '#title' => t('Previous page link text'),
+ '#title' => $this->t('Previous page link text'),
'#default_value' => $this->options['tags']['previous'],
);
$form['tags']['next'] = array(
'#type' => 'textfield',
- '#title' => t('Next page link text'),
+ '#title' => $this->t('Next page link text'),
'#default_value' => $this->options['tags']['next'],
);
@@ -99,23 +99,23 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#type' => 'details',
'#open' => TRUE,
'#tree' => TRUE,
- '#title' => t('Exposed options'),
+ '#title' => $this->t('Exposed options'),
'#input' => TRUE,
- '#description' => t('Exposing this options allows users to define their values in a exposed form when view is displayed'),
+ '#description' => $this->t('Exposing this options allows users to define their values in a exposed form when view is displayed'),
);
$form['expose']['items_per_page'] = array(
'#type' => 'checkbox',
- '#title' => t('Expose items per page'),
- '#description' => t('When checked, users can determine how many items per page show in a view'),
+ '#title' => $this->t('Expose items per page'),
+ '#description' => $this->t('When checked, users can determine how many items per page show in a view'),
'#default_value' => $this->options['expose']['items_per_page'],
);
$form['expose']['items_per_page_label'] = array(
'#type' => 'textfield',
- '#title' => t('Items per page label'),
+ '#title' => $this->t('Items per page label'),
'#required' => TRUE,
- '#description' => t('Label to use in the exposed items per page form element.'),
+ '#description' => $this->t('Label to use in the exposed items per page form element.'),
'#default_value' => $this->options['expose']['items_per_page_label'],
'#states' => array(
'invisible' => array(
@@ -126,9 +126,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['expose']['items_per_page_options'] = array(
'#type' => 'textfield',
- '#title' => t('Exposed items per page options'),
+ '#title' => $this->t('Exposed items per page options'),
'#required' => TRUE,
- '#description' => t('Set between which values the user can choose when determining the items per page. Separated by comma.'),
+ '#description' => $this->t('Set between which values the user can choose when determining the items per page. Separated by comma.'),
'#default_value' => $this->options['expose']['items_per_page_options'],
'#states' => array(
'invisible' => array(
@@ -140,15 +140,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['expose']['items_per_page_options_all'] = array(
'#type' => 'checkbox',
- '#title' => t('Include all items option'),
- '#description' => t('If checked, an extra item will be included to items per page to display all items'),
+ '#title' => $this->t('Include all items option'),
+ '#description' => $this->t('If checked, an extra item will be included to items per page to display all items'),
'#default_value' => $this->options['expose']['items_per_page_options_all'],
);
$form['expose']['items_per_page_options_all_label'] = array(
'#type' => 'textfield',
- '#title' => t('All items label'),
- '#description' => t('Which label will be used to display all items'),
+ '#title' => $this->t('All items label'),
+ '#description' => $this->t('Which label will be used to display all items'),
'#default_value' => $this->options['expose']['items_per_page_options_all_label'],
'#states' => array(
'invisible' => array(
@@ -159,16 +159,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['expose']['offset'] = array(
'#type' => 'checkbox',
- '#title' => t('Expose Offset'),
- '#description' => t('When checked, users can determine how many items should be skipped at the beginning.'),
+ '#title' => $this->t('Expose Offset'),
+ '#description' => $this->t('When checked, users can determine how many items should be skipped at the beginning.'),
'#default_value' => $this->options['expose']['offset'],
);
$form['expose']['offset_label'] = array(
'#type' => 'textfield',
- '#title' => t('Offset label'),
+ '#title' => $this->t('Offset label'),
'#required' => TRUE,
- '#description' => t('Label to use in the exposed offset form element.'),
+ '#description' => $this->t('Label to use in the exposed offset form element.'),
'#default_value' => $this->options['expose']['offset_label'],
'#states' => array(
'invisible' => array(
@@ -197,14 +197,14 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
$error = TRUE;
}
if ($error) {
- $form_state->setErrorByName('pager_options][expose][items_per_page_options', t('Insert a list of integer numeric values separated by commas: e.g: 10, 20, 50, 100'));
+ $form_state->setErrorByName('pager_options][expose][items_per_page_options', $this->t('Insert a list of integer numeric values separated by commas: e.g: 10, 20, 50, 100'));
}
// Make sure that the items_per_page is part of the expose settings.
if (!$form_state->isValueEmpty(array('pager_options', 'expose', 'items_per_page')) && !$form_state->isValueEmpty(array('pager_options', 'items_per_page'))) {
$items_per_page = $form_state->getValue(array('pager_options', 'items_per_page'));
if (array_search($items_per_page, $options) === FALSE) {
- $form_state->setErrorByName('pager_options][expose][items_per_page_options', t("The
Exposed items per page field's options must include the value from the
Items per page field (@items_per_page).",
+ $form_state->setErrorByName('pager_options][expose][items_per_page_options', $this->t("The
Exposed items per page field's options must include the value from the
Items per page field (@items_per_page).",
array('@items_per_page' => $items_per_page))
);
}
@@ -371,7 +371,7 @@ public function exposedFormAlter(&$form, FormStateInterface $form_state) {
public function exposedFormValidate(&$form, FormStateInterface $form_state) {
if (!$form_state->isValueEmpty('offset') && trim($form_state->getValue('offset'))) {
if (!is_numeric($form_state->getValue('offset')) || $form_state->getValue('offset') < 0) {
- $form_state->setErrorByName('offset', t('Offset must be an number greather or equal than 0.'));
+ $form_state->setErrorByName('offset', $this->t('Offset must be an number greather or equal than 0.'));
}
}
}
diff --git a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
index 4097efa..2db89fd 100644
--- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
+++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
@@ -114,7 +114,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) { }
public function submitOptionsForm(&$form, FormStateInterface $form_state) { }
public function summaryTitle() {
- return t('Settings');
+ return $this->t('Settings');
}
/**
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 61dbfb7..7e24d94 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -206,34 +206,34 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['disable_sql_rewrite'] = array(
- '#title' => t('Disable SQL rewriting'),
- '#description' => t('Disabling SQL rewriting will disable node_access checks as well as other modules that implement hook_query_alter().'),
+ '#title' => $this->t('Disable SQL rewriting'),
+ '#description' => $this->t('Disabling SQL rewriting will disable node_access checks as well as other modules that implement hook_query_alter().'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['disable_sql_rewrite']),
- '#suffix' => '
' . t('WARNING: Disabling SQL rewriting means that node access security is disabled. This may allow users to see data they should not be able to see if your view is misconfigured. Use this option only if you understand and accept this security risk.') . '
',
+ '#suffix' => '
' . $this->t('WARNING: Disabling SQL rewriting means that node access security is disabled. This may allow users to see data they should not be able to see if your view is misconfigured. Use this option only if you understand and accept this security risk.') . '
',
);
$form['distinct'] = array(
'#type' => 'checkbox',
- '#title' => t('Distinct'),
- '#description' => t('This will make the view display only distinct items. If there are multiple identical items, each will be displayed only once. You can use this to try and remove duplicates from a view, though it does not always work. Note that this can slow queries down, so use it with caution.'),
+ '#title' => $this->t('Distinct'),
+ '#description' => $this->t('This will make the view display only distinct items. If there are multiple identical items, each will be displayed only once. You can use this to try and remove duplicates from a view, though it does not always work. Note that this can slow queries down, so use it with caution.'),
'#default_value' => !empty($this->options['distinct']),
);
$form['replica'] = array(
'#type' => 'checkbox',
- '#title' => t('Use Secondary Server'),
- '#description' => t('This will make the query attempt to connect to a replica server if available. If no replica server is defined or available, it will fall back to the default server.'),
+ '#title' => $this->t('Use Secondary Server'),
+ '#description' => $this->t('This will make the query attempt to connect to a replica server if available. If no replica server is defined or available, it will fall back to the default server.'),
'#default_value' => !empty($this->options['replica']),
);
$form['query_comment'] = array(
'#type' => 'textfield',
- '#title' => t('Query Comment'),
- '#description' => t('If set, this comment will be embedded in the query and passed to the SQL server. This can be helpful for logging or debugging.'),
+ '#title' => $this->t('Query Comment'),
+ '#description' => $this->t('If set, this comment will be embedded in the query and passed to the SQL server. This can be helpful for logging or debugging.'),
'#default_value' => $this->options['query_comment'],
);
$form['query_tags'] = array(
'#type' => 'textfield',
- '#title' => t('Query Tags'),
- '#description' => t('If set, these tags will be appended to the query and can be used to identify the query in a module. This can be helpful for altering queries.'),
+ '#title' => $this->t('Query Tags'),
+ '#description' => $this->t('If set, these tags will be appended to the query and can be used to identify the query in a module. This can be helpful for altering queries.'),
'#default_value' => implode(', ', $this->options['query_tags']),
'#element_validate' => array('views_element_validate_tags'),
);
@@ -1529,11 +1529,11 @@ public function getAggregationInfo() {
// functions into here.
return array(
'group' => array(
- 'title' => t('Group results together'),
+ 'title' => $this->t('Group results together'),
'is aggregate' => FALSE,
),
'count' => array(
- 'title' => t('Count'),
+ 'title' => $this->t('Count'),
'method' => 'aggregationMethodSimple',
'handler' => array(
'argument' => 'groupby_numeric',
@@ -1543,7 +1543,7 @@ public function getAggregationInfo() {
),
),
'count_distinct' => array(
- 'title' => t('Count DISTINCT'),
+ 'title' => $this->t('Count DISTINCT'),
'method' => 'aggregationMethodDistinct',
'handler' => array(
'argument' => 'groupby_numeric',
@@ -1553,7 +1553,7 @@ public function getAggregationInfo() {
),
),
'sum' => array(
- 'title' => t('Sum'),
+ 'title' => $this->t('Sum'),
'method' => 'aggregationMethodSimple',
'handler' => array(
'argument' => 'groupby_numeric',
@@ -1563,7 +1563,7 @@ public function getAggregationInfo() {
),
),
'avg' => array(
- 'title' => t('Average'),
+ 'title' => $this->t('Average'),
'method' => 'aggregationMethodSimple',
'handler' => array(
'argument' => 'groupby_numeric',
@@ -1573,7 +1573,7 @@ public function getAggregationInfo() {
),
),
'min' => array(
- 'title' => t('Minimum'),
+ 'title' => $this->t('Minimum'),
'method' => 'aggregationMethodSimple',
'handler' => array(
'argument' => 'groupby_numeric',
@@ -1583,7 +1583,7 @@ public function getAggregationInfo() {
),
),
'max' => array(
- 'title' => t('Maximum'),
+ 'title' => $this->t('Maximum'),
'method' => 'aggregationMethodSimple',
'handler' => array(
'argument' => 'groupby_numeric',
@@ -1593,7 +1593,7 @@ public function getAggregationInfo() {
),
),
'stddev_pop' => array(
- 'title' => t('Standard deviation'),
+ 'title' => $this->t('Standard deviation'),
'method' => 'aggregationMethodSimple',
'handler' => array(
'argument' => 'groupby_numeric',
diff --git a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
index e6d67f6..c3f99f8 100644
--- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
+++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php
@@ -96,25 +96,25 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
// sort and an order for it.
$form['subquery_sort'] = array(
'#type' => 'select',
- '#title' => t('Representative sort criteria'),
+ '#title' => $this->t('Representative sort criteria'),
// Provide the base field as sane default sort option.
'#default_value' => !empty($this->options['subquery_sort']) ? $this->options['subquery_sort'] : $this->definition['base'] . '.' . $base_table_data['table']['base']['field'],
'#options' => $sort_options,
- '#description' => t("The sort criteria is applied to the data brought in by the relationship to determine how a representative item is obtained for each row. For example, to show the most recent node for each user, pick 'Content: Updated date'."),
+ '#description' => $this->t("The sort criteria is applied to the data brought in by the relationship to determine how a representative item is obtained for each row. For example, to show the most recent node for each user, pick 'Content: Updated date'."),
);
$form['subquery_order'] = array(
'#type' => 'radios',
- '#title' => t('Representative sort order'),
- '#description' => t("The ordering to use for the sort criteria selected above."),
- '#options' => array('ASC' => t('Ascending'), 'DESC' => t('Descending')),
+ '#title' => $this->t('Representative sort order'),
+ '#description' => $this->t("The ordering to use for the sort criteria selected above."),
+ '#options' => array('ASC' => $this->t('Ascending'), 'DESC' => $this->t('Descending')),
'#default_value' => $this->options['subquery_order'],
);
$form['subquery_namespace'] = array(
'#type' => 'textfield',
- '#title' => t('Subquery namespace'),
- '#description' => t('Advanced. Enter a namespace for the subquery used by this relationship.'),
+ '#title' => $this->t('Subquery namespace'),
+ '#description' => $this->t('Advanced. Enter a namespace for the subquery used by this relationship.'),
'#default_value' => $this->options['subquery_namespace'],
);
@@ -141,17 +141,17 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['subquery_view'] = array(
'#type' => 'select',
- '#title' => t('Representative view'),
+ '#title' => $this->t('Representative view'),
'#default_value' => $this->options['subquery_view'],
'#options' => $views,
- '#description' => t('Advanced. Use another view to generate the relationship subquery. This allows you to use filtering and more than one sort. If you pick a view here, the sort options above are ignored. Your view must have the ID of its base as its only field, and should have some kind of sorting.'),
+ '#description' => $this->t('Advanced. Use another view to generate the relationship subquery. This allows you to use filtering and more than one sort. If you pick a view here, the sort options above are ignored. Your view must have the ID of its base as its only field, and should have some kind of sorting.'),
);
$form['subquery_regenerate'] = array(
'#type' => 'checkbox',
- '#title' => t('Generate subquery each time view is run'),
+ '#title' => $this->t('Generate subquery each time view is run'),
'#default_value' => $this->options['subquery_regenerate'],
- '#description' => t('Will re-generate the subquery for this relationship every time the view is run, instead of only when these options are saved. Use for testing if you are making changes elsewhere. WARNING: seriously impairs performance.'),
+ '#description' => $this->t('Will re-generate the subquery for this relationship every time the view is run, instead of only when these options are saved. Use for testing if you are making changes elsewhere. WARNING: seriously impairs performance.'),
);
}
diff --git a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
index a75ffeb..b8c24cd 100644
--- a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
+++ b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
@@ -113,8 +113,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['required'] = array(
'#type' => 'checkbox',
- '#title' => t('Require this relationship'),
- '#description' => t('Enable to hide items that do not contain this relationship'),
+ '#title' => $this->t('Require this relationship'),
+ '#description' => $this->t('Enable to hide items that do not contain this relationship'),
'#default_value' => !empty($this->options['required']),
);
}
diff --git a/core/modules/views/src/Plugin/views/row/EntityRow.php b/core/modules/views/src/Plugin/views/row/EntityRow.php
index d830017..fd889d9 100644
--- a/core/modules/views/src/Plugin/views/row/EntityRow.php
+++ b/core/modules/views/src/Plugin/views/row/EntityRow.php
@@ -132,7 +132,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['view_mode'] = array(
'#type' => 'select',
'#options' => \Drupal::entityManager()->getViewModeOptions($this->entityTypeId),
- '#title' => t('View mode'),
+ '#title' => $this->t('View mode'),
'#default_value' => $this->options['view_mode'],
);
@@ -140,7 +140,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['rendering_language'] = array(
'#type' => 'select',
'#options' => $options,
- '#title' => t('Rendering language'),
+ '#title' => $this->t('Rendering language'),
'#default_value' => $this->options['rendering_language'],
'#access' => $this->languageManager->isMultilingual(),
);
@@ -170,7 +170,7 @@ public function summaryTitle() {
return String::checkPlain($options[$this->options['view_mode']]);
}
else {
- return t('No view mode selected');
+ return $this->t('No view mode selected');
}
}
diff --git a/core/modules/views/src/Plugin/views/row/Fields.php b/core/modules/views/src/Plugin/views/row/Fields.php
index 788219a..14fcd55 100644
--- a/core/modules/views/src/Plugin/views/row/Fields.php
+++ b/core/modules/views/src/Plugin/views/row/Fields.php
@@ -57,17 +57,17 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['default_field_elements'] = array(
'#type' => 'checkbox',
- '#title' => t('Provide default field wrapper elements'),
+ '#title' => $this->t('Provide default field wrapper elements'),
'#default_value' => $this->options['default_field_elements'],
- '#description' => t('If not checked, fields that are not configured to customize their HTML elements will get no wrappers at all for their field, label and field + label wrappers. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
+ '#description' => $this->t('If not checked, fields that are not configured to customize their HTML elements will get no wrappers at all for their field, label and field + label wrappers. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
);
$form['inline'] = array(
'#type' => 'checkboxes',
- '#title' => t('Inline fields'),
+ '#title' => $this->t('Inline fields'),
'#options' => $options,
'#default_value' => $this->options['inline'],
- '#description' => t('Inline fields will be displayed next to each other rather than one after another. Note that some fields will ignore this if they are block elements, particularly body fields and other formatted HTML.'),
+ '#description' => $this->t('Inline fields will be displayed next to each other rather than one after another. Note that some fields will ignore this if they are block elements, particularly body fields and other formatted HTML.'),
'#states' => array(
'visible' => array(
':input[name="row_options[default_field_elements]"]' => array('checked' => TRUE),
@@ -76,11 +76,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['separator'] = array(
- '#title' => t('Separator'),
+ '#title' => $this->t('Separator'),
'#type' => 'textfield',
'#size' => 10,
'#default_value' => isset($this->options['separator']) ? $this->options['separator'] : '',
- '#description' => t('The separator may be placed between inline fields to keep them from squishing up next to each other. You can use HTML in this field.'),
+ '#description' => $this->t('The separator may be placed between inline fields to keep them from squishing up next to each other. You can use HTML in this field.'),
'#states' => array(
'visible' => array(
':input[name="row_options[default_field_elements]"]' => array('checked' => TRUE),
@@ -90,9 +90,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['hide_empty'] = array(
'#type' => 'checkbox',
- '#title' => t('Hide empty fields'),
+ '#title' => $this->t('Hide empty fields'),
'#default_value' => $this->options['hide_empty'],
- '#description' => t('Do not display fields, labels or markup for fields that are empty.'),
+ '#description' => $this->t('Do not display fields, labels or markup for fields that are empty.'),
);
}
diff --git a/core/modules/views/src/Plugin/views/row/RowPluginBase.php b/core/modules/views/src/Plugin/views/row/RowPluginBase.php
index 459a768..059a415 100644
--- a/core/modules/views/src/Plugin/views/row/RowPluginBase.php
+++ b/core/modules/views/src/Plugin/views/row/RowPluginBase.php
@@ -102,7 +102,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
}
if (!empty($relationship_options)) {
- $relationship_options = array_merge(array('none' => t('Do not use a relationship')), $relationship_options);
+ $relationship_options = array_merge(array('none' => $this->t('Do not use a relationship')), $relationship_options);
$rel = empty($this->options['relationship']) ? 'none' : $this->options['relationship'];
if (empty($relationship_options[$rel])) {
// Pick the first relationship.
@@ -111,7 +111,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['relationship'] = array(
'#type' => 'select',
- '#title' => t('Relationship'),
+ '#title' => $this->t('Relationship'),
'#options' => $relationship_options,
'#default_value' => $rel,
);
diff --git a/core/modules/views/src/Plugin/views/row/RssFields.php b/core/modules/views/src/Plugin/views/row/RssFields.php
index 48dcefe..ec4830c 100644
--- a/core/modules/views/src/Plugin/views/row/RssFields.php
+++ b/core/modules/views/src/Plugin/views/row/RssFields.php
@@ -44,67 +44,67 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
- $initial_labels = array('' => t('- None -'));
+ $initial_labels = array('' => $this->t('- None -'));
$view_fields_labels = $this->displayHandler->getFieldLabels();
$view_fields_labels = array_merge($initial_labels, $view_fields_labels);
$form['title_field'] = array(
'#type' => 'select',
- '#title' => t('Title field'),
- '#description' => t('The field that is going to be used as the RSS item title for each row.'),
+ '#title' => $this->t('Title field'),
+ '#description' => $this->t('The field that is going to be used as the RSS item title for each row.'),
'#options' => $view_fields_labels,
'#default_value' => $this->options['title_field'],
'#required' => TRUE,
);
$form['link_field'] = array(
'#type' => 'select',
- '#title' => t('Link field'),
- '#description' => t('The field that is going to be used as the RSS item link for each row. This must be a drupal relative path.'),
+ '#title' => $this->t('Link field'),
+ '#description' => $this->t('The field that is going to be used as the RSS item link for each row. This must be a drupal relative path.'),
'#options' => $view_fields_labels,
'#default_value' => $this->options['link_field'],
'#required' => TRUE,
);
$form['description_field'] = array(
'#type' => 'select',
- '#title' => t('Description field'),
- '#description' => t('The field that is going to be used as the RSS item description for each row.'),
+ '#title' => $this->t('Description field'),
+ '#description' => $this->t('The field that is going to be used as the RSS item description for each row.'),
'#options' => $view_fields_labels,
'#default_value' => $this->options['description_field'],
'#required' => TRUE,
);
$form['creator_field'] = array(
'#type' => 'select',
- '#title' => t('Creator field'),
- '#description' => t('The field that is going to be used as the RSS item creator for each row.'),
+ '#title' => $this->t('Creator field'),
+ '#description' => $this->t('The field that is going to be used as the RSS item creator for each row.'),
'#options' => $view_fields_labels,
'#default_value' => $this->options['creator_field'],
'#required' => TRUE,
);
$form['date_field'] = array(
'#type' => 'select',
- '#title' => t('Publication date field'),
- '#description' => t('The field that is going to be used as the RSS item pubDate for each row. It needs to be in RFC 2822 format.'),
+ '#title' => $this->t('Publication date field'),
+ '#description' => $this->t('The field that is going to be used as the RSS item pubDate for each row. It needs to be in RFC 2822 format.'),
'#options' => $view_fields_labels,
'#default_value' => $this->options['date_field'],
'#required' => TRUE,
);
$form['guid_field_options'] = array(
'#type' => 'details',
- '#title' => t('GUID settings'),
+ '#title' => $this->t('GUID settings'),
'#open' => TRUE,
);
$form['guid_field_options']['guid_field'] = array(
'#type' => 'select',
- '#title' => t('GUID field'),
- '#description' => t('The globally unique identifier of the RSS item.'),
+ '#title' => $this->t('GUID field'),
+ '#description' => $this->t('The globally unique identifier of the RSS item.'),
'#options' => $view_fields_labels,
'#default_value' => $this->options['guid_field_options']['guid_field'],
'#required' => TRUE,
);
$form['guid_field_options']['guid_field_is_permalink'] = array(
'#type' => 'checkbox',
- '#title' => t('GUID is permalink'),
- '#description' => t('The RSS item GUID is a permalink.'),
+ '#title' => $this->t('GUID is permalink'),
+ '#description' => $this->t('The RSS item GUID is a permalink.'),
'#default_value' => $this->options['guid_field_options']['guid_field_is_permalink'],
);
}
@@ -114,13 +114,13 @@ public function validate() {
$required_options = array('title_field', 'link_field', 'description_field', 'creator_field', 'date_field');
foreach ($required_options as $required_option) {
if (empty($this->options[$required_option])) {
- $errors[] = t('Row style plugin requires specifying which views fields to use for RSS item.');
+ $errors[] = $this->t('Row style plugin requires specifying which views fields to use for RSS item.');
break;
}
}
// Once more for guid.
if (empty($this->options['guid_field_options']['guid_field'])) {
- $errors[] = t('Row style plugin requires specifying which views fields to use for RSS item.');
+ $errors[] = $this->t('Row style plugin requires specifying which views fields to use for RSS item.');
}
return $errors;
}
diff --git a/core/modules/views/src/Plugin/views/sort/Date.php b/core/modules/views/src/Plugin/views/sort/Date.php
index 6c0b754..090aff9 100644
--- a/core/modules/views/src/Plugin/views/sort/Date.php
+++ b/core/modules/views/src/Plugin/views/sort/Date.php
@@ -32,16 +32,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['granularity'] = array(
'#type' => 'radios',
- '#title' => t('Granularity'),
+ '#title' => $this->t('Granularity'),
'#options' => array(
- 'second' => t('Second'),
- 'minute' => t('Minute'),
- 'hour' => t('Hour'),
- 'day' => t('Day'),
- 'month' => t('Month'),
- 'year' => t('Year'),
+ 'second' => $this->t('Second'),
+ 'minute' => $this->t('Minute'),
+ 'hour' => $this->t('Hour'),
+ 'day' => $this->t('Day'),
+ 'month' => $this->t('Month'),
+ 'year' => $this->t('Year'),
),
- '#description' => t('The granularity is the smallest unit to use when determining whether two dates are the same; for example, if the granularity is "Year" then all dates in 1999, regardless of when they fall in 1999, will be considered the same date.'),
+ '#description' => $this->t('The granularity is the smallest unit to use when determining whether two dates are the same; for example, if the granularity is "Year" then all dates in 1999, regardless of when they fall in 1999, will be considered the same date.'),
'#default_value' => $this->options['granularity'],
);
}
diff --git a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
index 5a01ad9..6e8fb39 100644
--- a/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
+++ b/core/modules/views/src/Plugin/views/sort/SortPluginBase.php
@@ -60,17 +60,17 @@ protected function defineOptions() {
*/
public function adminSummary() {
if (!empty($this->options['exposed'])) {
- return t('Exposed');
+ return $this->t('Exposed');
}
switch ($this->options['order']) {
case 'ASC':
case 'asc':
default:
- return t('asc');
+ return $this->t('asc');
break;
case 'DESC';
case 'desc';
- return t('desc');
+ return $this->t('desc');
break;
}
}
@@ -109,19 +109,19 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
'#attributes' => array('class' => array('js-only')),
);
$form['expose_button']['checkbox']['checkbox'] = array(
- '#title' => t('Expose this sort to visitors, to allow them to change it'),
+ '#title' => $this->t('Expose this sort to visitors, to allow them to change it'),
'#type' => 'checkbox',
);
// Then add the button itself.
if (empty($this->options['exposed'])) {
$form['expose_button']['markup'] = array(
- '#markup' => '
' . t('This sort is not exposed. Expose it to allow the users to change it.') . '
',
+ '#markup' => '
' . $this->t('This sort is not exposed. Expose it to allow the users to change it.') . '
',
);
$form['expose_button']['button'] = array(
'#limit_validation_errors' => array(),
'#type' => 'submit',
- '#value' => t('Expose sort'),
+ '#value' => $this->t('Expose sort'),
'#submit' => array(array($this, 'displayExposedForm')),
'#attributes' => array('class' => array('use-ajax-submit')),
);
@@ -129,12 +129,12 @@ public function showExposeButton(&$form, FormStateInterface $form_state) {
}
else {
$form['expose_button']['markup'] = array(
- '#markup' => '
' . t('This sort is exposed. If you hide it, users will not be able to change it.') . '
',
+ '#markup' => '
' . $this->t('This sort is exposed. If you hide it, users will not be able to change it.') . '
',
);
$form['expose_button']['button'] = array(
'#limit_validation_errors' => array(),
'#type' => 'submit',
- '#value' => t('Hide sort'),
+ '#value' => $this->t('Hide sort'),
'#submit' => array(array($this, 'displayExposedForm')),
'#attributes' => array('class' => array('use-ajax-submit')),
);
@@ -173,7 +173,7 @@ protected function showSortForm(&$form, FormStateInterface $form_state) {
$options = $this->sortOptions();
if (!empty($options)) {
$form['order'] = array(
- '#title' => t('Order'),
+ '#title' => $this->t('Order'),
'#type' => 'radios',
'#options' => $options,
'#default_value' => $this->options['order'],
@@ -191,8 +191,8 @@ public function sortSubmit(&$form, FormStateInterface $form_state) { }
*/
protected function sortOptions() {
return array(
- 'ASC' => t('Sort ascending'),
- 'DESC' => t('Sort descending'),
+ 'ASC' => $this->t('Sort ascending'),
+ 'DESC' => $this->t('Sort descending'),
);
}
@@ -207,7 +207,7 @@ public function buildExposeForm(&$form, FormStateInterface $form_state) {
$form['expose']['label'] = array(
'#type' => 'textfield',
'#default_value' => $this->options['expose']['label'],
- '#title' => t('Label'),
+ '#title' => $this->t('Label'),
'#required' => TRUE,
'#size' => 40,
'#weight' => -1,
diff --git a/core/modules/views/src/Plugin/views/style/DefaultSummary.php b/core/modules/views/src/Plugin/views/style/DefaultSummary.php
index 7401a95..be01b54 100644
--- a/core/modules/views/src/Plugin/views/style/DefaultSummary.php
+++ b/core/modules/views/src/Plugin/views/style/DefaultSummary.php
@@ -45,9 +45,9 @@ public function query() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['base_path'] = array(
'#type' => 'textfield',
- '#title' => t('Base path'),
+ '#title' => $this->t('Base path'),
'#default_value' => $this->options['base_path'],
- '#description' => t('Define the base path for links in this summary
+ '#description' => $this->t('Define the base path for links in this summary
view, i.e. http://example.com/
your_view_path/archive.
Do not include beginning and ending forward slash. If this value
is empty, views will use the first path found as the base path,
@@ -56,17 +56,17 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['count'] = array(
'#type' => 'checkbox',
'#default_value' => !empty($this->options['count']),
- '#title' => t('Display record count with link'),
+ '#title' => $this->t('Display record count with link'),
);
$form['override'] = array(
'#type' => 'checkbox',
'#default_value' => !empty($this->options['override']),
- '#title' => t('Override number of items to display'),
+ '#title' => $this->t('Override number of items to display'),
);
$form['items_per_page'] = array(
'#type' => 'textfield',
- '#title' => t('Items to display'),
+ '#title' => $this->t('Items to display'),
'#default_value' => $this->options['items_per_page'],
'#states' => array(
'visible' => array(
diff --git a/core/modules/views/src/Plugin/views/style/Grid.php b/core/modules/views/src/Plugin/views/style/Grid.php
index ab5c6a2..cd73f52 100644
--- a/core/modules/views/src/Plugin/views/style/Grid.php
+++ b/core/modules/views/src/Plugin/views/style/Grid.php
@@ -53,53 +53,53 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['columns'] = array(
'#type' => 'number',
- '#title' => t('Number of columns'),
+ '#title' => $this->t('Number of columns'),
'#default_value' => $this->options['columns'],
'#required' => TRUE,
'#min' => 1,
);
$form['automatic_width'] = array(
'#type' => 'checkbox',
- '#title' => t('Automatic width'),
- '#description' => t('The width of each column will be calculated automatically based on the number of columns provided. If additional classes are entered or a theme injects classes based on a grid system, disabling this option may prove beneficial.'),
+ '#title' => $this->t('Automatic width'),
+ '#description' => $this->t('The width of each column will be calculated automatically based on the number of columns provided. If additional classes are entered or a theme injects classes based on a grid system, disabling this option may prove beneficial.'),
'#default_value' => $this->options['automatic_width'],
);
$form['alignment'] = array(
'#type' => 'radios',
- '#title' => t('Alignment'),
- '#options' => array('horizontal' => t('Horizontal'), 'vertical' => t('Vertical')),
+ '#title' => $this->t('Alignment'),
+ '#options' => array('horizontal' => $this->t('Horizontal'), 'vertical' => $this->t('Vertical')),
'#default_value' => $this->options['alignment'],
- '#description' => t('Horizontal alignment will place items starting in the upper left and moving right. Vertical alignment will place items starting in the upper left and moving down.'),
+ '#description' => $this->t('Horizontal alignment will place items starting in the upper left and moving right. Vertical alignment will place items starting in the upper left and moving down.'),
);
$form['col_class_default'] = array(
- '#title' => t('Default column classes'),
- '#description' => t('Add the default views column classes like views-col, col-1 and clearfix to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
+ '#title' => $this->t('Default column classes'),
+ '#description' => $this->t('Add the default views column classes like views-col, col-1 and clearfix to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
'#type' => 'checkbox',
'#default_value' => $this->options['col_class_default'],
);
$form['col_class_custom'] = array(
- '#title' => t('Custom column class'),
- '#description' => t('Additional classes to provide on each column. Separated by a space.'),
+ '#title' => $this->t('Custom column class'),
+ '#description' => $this->t('Additional classes to provide on each column. Separated by a space.'),
'#type' => 'textfield',
'#default_value' => $this->options['col_class_custom'],
);
if ($this->usesFields()) {
- $form['col_class_custom']['#description'] .= ' ' . t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
+ $form['col_class_custom']['#description'] .= ' ' . $this->t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
}
$form['row_class_default'] = array(
- '#title' => t('Default row classes'),
- '#description' => t('Adds the default views row classes like views-row, row-1 and clearfix to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
+ '#title' => $this->t('Default row classes'),
+ '#description' => $this->t('Adds the default views row classes like views-row, row-1 and clearfix to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
'#type' => 'checkbox',
'#default_value' => $this->options['row_class_default'],
);
$form['row_class_custom'] = array(
- '#title' => t('Custom row class'),
- '#description' => t('Additional classes to provide on each row. Separated by a space.'),
+ '#title' => $this->t('Custom row class'),
+ '#description' => $this->t('Additional classes to provide on each row. Separated by a space.'),
'#type' => 'textfield',
'#default_value' => $this->options['row_class_custom'],
);
if ($this->usesFields()) {
- $form['row_class_custom']['#description'] .= ' ' . t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
+ $form['row_class_custom']['#description'] .= ' ' . $this->t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
}
}
diff --git a/core/modules/views/src/Plugin/views/style/HtmlList.php b/core/modules/views/src/Plugin/views/style/HtmlList.php
index bf4422d..d965792 100644
--- a/core/modules/views/src/Plugin/views/style/HtmlList.php
+++ b/core/modules/views/src/Plugin/views/style/HtmlList.php
@@ -58,20 +58,20 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['type'] = array(
'#type' => 'radios',
- '#title' => t('List type'),
- '#options' => array('ul' => t('Unordered list'), 'ol' => t('Ordered list')),
+ '#title' => $this->t('List type'),
+ '#options' => array('ul' => $this->t('Unordered list'), 'ol' => $this->t('Ordered list')),
'#default_value' => $this->options['type'],
);
$form['wrapper_class'] = array(
- '#title' => t('Wrapper class'),
- '#description' => t('The class to provide on the wrapper, outside the list.'),
+ '#title' => $this->t('Wrapper class'),
+ '#description' => $this->t('The class to provide on the wrapper, outside the list.'),
'#type' => 'textfield',
'#size' => '30',
'#default_value' => $this->options['wrapper_class'],
);
$form['class'] = array(
- '#title' => t('List class'),
- '#description' => t('The class to provide on the list element itself.'),
+ '#title' => $this->t('List class'),
+ '#description' => $this->t('The class to provide on the list element itself.'),
'#type' => 'textfield',
'#size' => '30',
'#default_value' => $this->options['class'],
diff --git a/core/modules/views/src/Plugin/views/style/Mapping.php b/core/modules/views/src/Plugin/views/style/Mapping.php
index 7c538a3..e8af4ea 100644
--- a/core/modules/views/src/Plugin/views/style/Mapping.php
+++ b/core/modules/views/src/Plugin/views/style/Mapping.php
@@ -97,7 +97,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$field_options = array();
$required = !empty($mapping[$key]['#required']);
if (!$required && empty($mapping[$key]['#multiple'])) {
- $field_options = array('' => t('- None -'));
+ $field_options = array('' => $this->t('- None -'));
}
$field_options += $field_labels;
@@ -118,7 +118,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
if (!empty($mapping[$key]['#toggle'])) {
$form['mapping']["toggle_$key"] = array(
'#type' => 'checkbox',
- '#title' => t('Use a custom %field_name', array('%field_name' => strtolower($mapping[$key]['#title']))),
+ '#title' => $this->t('Use a custom %field_name', array('%field_name' => strtolower($mapping[$key]['#title']))),
'#default_value' => $this->options['mapping']["toggle_$key"],
);
$overrides['#states']['visible'][':input[name="style_options[mapping][' . "toggle_$key" . ']"]'] = array('checked' => TRUE);
diff --git a/core/modules/views/src/Plugin/views/style/Rss.php b/core/modules/views/src/Plugin/views/style/Rss.php
index 60482b1..f812ccc 100644
--- a/core/modules/views/src/Plugin/views/style/Rss.php
+++ b/core/modules/views/src/Plugin/views/style/Rss.php
@@ -79,9 +79,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['description'] = array(
'#type' => 'textfield',
- '#title' => t('RSS description'),
+ '#title' => $this->t('RSS description'),
'#default_value' => $this->options['description'],
- '#description' => t('This will appear in the RSS feed itself.'),
+ '#description' => $this->t('This will appear in the RSS feed itself.'),
'#maxlength' => 1024,
);
}
diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
index 4b79f84..cf94f25 100644
--- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php
+++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -268,7 +268,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
// to FALSE.
// @TODO: Document "usesGrouping" in docs.php when docs.php is written.
if ($this->usesFields() && $this->usesGrouping()) {
- $options = array('' => t('- None -'));
+ $options = array('' => $this->t('- None -'));
$field_labels = $this->displayHandler->getFieldLabels(TRUE);
$options += $field_labels;
// If there are no fields, we can't group on them.
@@ -292,16 +292,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$grouping += array('field' => '', 'rendered' => TRUE, 'rendered_strip' => FALSE);
$form['grouping'][$i]['field'] = array(
'#type' => 'select',
- '#title' => t('Grouping field Nr.@number', array('@number' => $i + 1)),
+ '#title' => $this->t('Grouping field Nr.@number', array('@number' => $i + 1)),
'#options' => $options,
'#default_value' => $grouping['field'],
- '#description' => t('You may optionally specify a field by which to group the records. Leave blank to not group.'),
+ '#description' => $this->t('You may optionally specify a field by which to group the records. Leave blank to not group.'),
);
$form['grouping'][$i]['rendered'] = array(
'#type' => 'checkbox',
- '#title' => t('Use rendered output to group rows'),
+ '#title' => $this->t('Use rendered output to group rows'),
'#default_value' => $grouping['rendered'],
- '#description' => t('If enabled the rendered output of the grouping field is used to group the rows.'),
+ '#description' => $this->t('If enabled the rendered output of the grouping field is used to group the rows.'),
'#states' => array(
'invisible' => array(
':input[name="style_options[grouping][' . $i . '][field]"]' => array('value' => ''),
@@ -310,7 +310,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['grouping'][$i]['rendered_strip'] = array(
'#type' => 'checkbox',
- '#title' => t('Remove tags from rendered output'),
+ '#title' => $this->t('Remove tags from rendered output'),
'#default_value' => $grouping['rendered_strip'],
'#states' => array(
'invisible' => array(
@@ -324,19 +324,19 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
if ($this->usesRowClass()) {
$form['row_class'] = array(
- '#title' => t('Row class'),
- '#description' => t('The class to provide on each row.'),
+ '#title' => $this->t('Row class'),
+ '#description' => $this->t('The class to provide on each row.'),
'#type' => 'textfield',
'#default_value' => $this->options['row_class'],
);
if ($this->usesFields()) {
- $form['row_class']['#description'] .= ' ' . t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
+ $form['row_class']['#description'] .= ' ' . $this->t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
}
$form['default_row_class'] = array(
- '#title' => t('Add views row classes'),
- '#description' => t('Add the default row classes like views-row-1 to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
+ '#title' => $this->t('Add views row classes'),
+ '#description' => $this->t('Add the default row classes like views-row-1 to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'),
'#type' => 'checkbox',
'#default_value' => $this->options['default_row_class'],
);
@@ -345,8 +345,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
if (!$this->usesFields() || !empty($this->options['uses_fields'])) {
$form['uses_fields'] = array(
'#type' => 'checkbox',
- '#title' => t('Force using fields'),
- '#description' => t('If neither the row nor the style plugin supports fields, this field allows to enable them, so you can for example use groupby.'),
+ '#title' => $this->t('Force using fields'),
+ '#description' => $this->t('If neither the row nor the style plugin supports fields, this field allows to enable them, so you can for example use groupby.'),
'#default_value' => $this->options['uses_fields'],
);
}
@@ -701,7 +701,7 @@ public function validate() {
if ($this->usesRowPlugin()) {
$plugin = $this->displayHandler->getPlugin('row');
if (empty($plugin)) {
- $errors[] = t('Style @style requires a row style but the row plugin is invalid.', array('@style' => $this->definition['title']));
+ $errors[] = $this->t('Style @style requires a row style but the row plugin is invalid.', array('@style' => $this->definition['title']));
}
else {
$result = $plugin->validate();
diff --git a/core/modules/views/src/Plugin/views/style/Table.php b/core/modules/views/src/Plugin/views/style/Table.php
index 92012fe..54891da 100644
--- a/core/modules/views/src/Plugin/views/style/Table.php
+++ b/core/modules/views/src/Plugin/views/style/Table.php
@@ -209,48 +209,48 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$handlers = $this->displayHandler->getHandlers('field');
if (empty($handlers)) {
$form['error_markup'] = array(
- '#markup' => '
' . t('You need at least one field before you can configure your table settings') . '
',
+ '#markup' => '
' . $this->t('You need at least one field before you can configure your table settings') . '
',
);
return;
}
$form['override'] = array(
'#type' => 'checkbox',
- '#title' => t('Override normal sorting if click sorting is used'),
+ '#title' => $this->t('Override normal sorting if click sorting is used'),
'#default_value' => !empty($this->options['override']),
);
$form['sticky'] = array(
'#type' => 'checkbox',
- '#title' => t('Enable Drupal style "sticky" table headers (Javascript)'),
+ '#title' => $this->t('Enable Drupal style "sticky" table headers (Javascript)'),
'#default_value' => !empty($this->options['sticky']),
- '#description' => t('(Sticky header effects will not be active for preview below, only on live output.)'),
+ '#description' => $this->t('(Sticky header effects will not be active for preview below, only on live output.)'),
);
$form['caption'] = array(
'#type' => 'textfield',
- '#title' => t('Caption for the table'),
- '#description' => t('A title which is semantically associated to your table for increased accessibility.'),
+ '#title' => $this->t('Caption for the table'),
+ '#description' => $this->t('A title which is semantically associated to your table for increased accessibility.'),
'#default_value' => $this->options['caption'],
'#maxlength' => 255,
);
$form['accessibility_details'] = array(
'#type' => 'details',
- '#title' => t('Table details'),
+ '#title' => $this->t('Table details'),
);
$form['summary'] = array(
- '#title' => t('Summary title'),
+ '#title' => $this->t('Summary title'),
'#type' => 'textfield',
'#default_value' => $this->options['summary'],
'#fieldset' => 'accessibility_details',
);
$form['description'] = array(
- '#title' => t('Table description'),
+ '#title' => $this->t('Table description'),
'#type' => 'textarea',
- '#description' => t('Provide additional details about the table to increase accessibility.'),
+ '#description' => $this->t('Provide additional details about the table to increase accessibility.'),
'#default_value' => $this->options['description'],
'#states' => array(
'visible' => array(
@@ -283,7 +283,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$column_selector = ':input[name="style_options[columns][' . $field . ']"]';
$form['columns'][$field] = array(
- '#title' => t('Columns for @field', array('@field' => $field)),
+ '#title' => $this->t('Columns for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'select',
'#options' => $field_names,
@@ -291,7 +291,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
if ($handlers[$field]->clickSortable()) {
$form['info'][$field]['sortable'] = array(
- '#title' => t('Sortable for @field', array('@field' => $field)),
+ '#title' => $this->t('Sortable for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'checkbox',
'#default_value' => !empty($this->options['info'][$field]['sortable']),
@@ -302,10 +302,10 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['info'][$field]['default_sort_order'] = array(
- '#title' => t('Default sort order for @field', array('@field' => $field)),
+ '#title' => $this->t('Default sort order for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'select',
- '#options' => array('asc' => t('Ascending'), 'desc' => t('Descending')),
+ '#options' => array('asc' => $this->t('Ascending'), 'desc' => $this->t('Descending')),
'#default_value' => !empty($this->options['info'][$field]['default_sort_order']) ? $this->options['info'][$field]['default_sort_order'] : 'asc',
'#states' => array(
'visible' => array(
@@ -317,7 +317,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
// Provide an ID so we can have such things.
$radio_id = drupal_html_id('edit-default-' . $field);
$form['default'][$field] = array(
- '#title' => t('Default sort for @field', array('@field' => $field)),
+ '#title' => $this->t('Default sort for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'radio',
'#return_value' => $field,
@@ -334,15 +334,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
}
$form['info'][$field]['align'] = array(
- '#title' => t('Alignment for @field', array('@field' => $field)),
+ '#title' => $this->t('Alignment for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'select',
'#default_value' => !empty($this->options['info'][$field]['align']) ? $this->options['info'][$field]['align'] : '',
'#options' => array(
- '' => t('None'),
- 'views-align-left' => t('Left', array(), array('context' => 'Text alignment')),
- 'views-align-center' => t('Center', array(), array('context' => 'Text alignment')),
- 'views-align-right' => t('Right', array(), array('context' => 'Text alignment')),
+ '' => $this->t('None'),
+ 'views-align-left' => $this->t('Left', array(), array('context' => 'Text alignment')),
+ 'views-align-center' => $this->t('Center', array(), array('context' => 'Text alignment')),
+ 'views-align-right' => $this->t('Right', array(), array('context' => 'Text alignment')),
),
'#states' => array(
'visible' => array(
@@ -351,7 +351,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['info'][$field]['separator'] = array(
- '#title' => t('Separator for @field', array('@field' => $field)),
+ '#title' => $this->t('Separator for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'textfield',
'#size' => 10,
@@ -363,7 +363,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['info'][$field]['empty_column'] = array(
- '#title' => t('Hide empty column for @field', array('@field' => $field)),
+ '#title' => $this->t('Hide empty column for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'checkbox',
'#default_value' => isset($this->options['info'][$field]['empty_column']) ? $this->options['info'][$field]['empty_column'] : FALSE,
@@ -374,11 +374,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
),
);
$form['info'][$field]['responsive'] = array(
- '#title' => t('Responsive setting for @field', array('@field' => $field)),
+ '#title' => $this->t('Responsive setting for @field', array('@field' => $field)),
'#title_display' => 'invisible',
'#type' => 'select',
'#default_value' => isset($this->options['info'][$field]['responsive']) ? $this->options['info'][$field]['responsive'] : '',
- '#options' => array('' => t('High'), RESPONSIVE_PRIORITY_MEDIUM => t('Medium'), RESPONSIVE_PRIORITY_LOW => t('Low')),
+ '#options' => array('' => $this->t('High'), RESPONSIVE_PRIORITY_MEDIUM => $this->t('Medium'), RESPONSIVE_PRIORITY_LOW => $this->t('Low')),
'#states' => array(
'visible' => array(
$column_selector => array('value' => $field),
@@ -394,7 +394,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
// Provide a radio for no default sort
$form['default'][-1] = array(
- '#title' => t('No default sort'),
+ '#title' => $this->t('No default sort'),
'#title_display' => 'invisible',
'#type' => 'radio',
'#return_value' => -1,
@@ -405,13 +405,13 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['empty_table'] = array(
'#type' => 'checkbox',
- '#title' => t('Show the empty text in the table'),
+ '#title' => $this->t('Show the empty text in the table'),
'#default_value' => $this->options['empty_table'],
- '#description' => t('Per default the table is hidden for an empty view. With this option it is posible to show an empty table with the text in it.'),
+ '#description' => $this->t('Per default the table is hidden for an empty view. With this option it is posible to show an empty table with the text in it.'),
);
$form['description_markup'] = array(
- '#markup' => '
' . t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.') . '
',
+ '#markup' => '
' . $this->t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.') . '
',
);
}
diff --git a/core/modules/views/src/Plugin/views/style/UnformattedSummary.php b/core/modules/views/src/Plugin/views/style/UnformattedSummary.php
index 05c9e8e..440b870 100644
--- a/core/modules/views/src/Plugin/views/style/UnformattedSummary.php
+++ b/core/modules/views/src/Plugin/views/style/UnformattedSummary.php
@@ -36,11 +36,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['inline'] = array(
'#type' => 'checkbox',
'#default_value' => !empty($this->options['inline']),
- '#title' => t('Display items inline'),
+ '#title' => $this->t('Display items inline'),
);
$form['separator'] = array(
'#type' => 'textfield',
- '#title' => t('Separator'),
+ '#title' => $this->t('Separator'),
'#default_value' => $this->options['separator'],
);
}
diff --git a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
index a989be7..1b13575 100644
--- a/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
+++ b/core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
@@ -226,12 +226,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form['displays']['page'] = array(
'#type' => 'fieldset',
- '#title' => t('Page settings'),
+ '#title' => $this->t('Page settings'),
'#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')),
'#tree' => TRUE,
);
$form['displays']['page']['create'] = array(
- '#title' => t('Create a page'),
+ '#title' => $this->t('Create a page'),
'#type' => 'checkbox',
'#attributes' => array('class' => array('strong')),
'#default_value' => FALSE,
@@ -254,12 +254,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
);
$form['displays']['page']['options']['title'] = array(
- '#title' => t('Page title'),
+ '#title' => $this->t('Page title'),
'#type' => 'textfield',
'#maxlength' => 255,
);
$form['displays']['page']['options']['path'] = array(
- '#title' => t('Path'),
+ '#title' => $this->t('Path'),
'#type' => 'textfield',
'#field_prefix' => $path_prefix,
// Account for the leading backslash.
@@ -267,13 +267,13 @@ public function buildForm(array $form, FormStateInterface $form_state) {
);
$form['displays']['page']['options']['style'] = array(
'#type' => 'fieldset',
- '#title' => t('Page display settings'),
+ '#title' => $this->t('Page display settings'),
'#attributes' => array('class' => array('container-inline', 'fieldset-no-legend')),
);
// Create the dropdown for choosing the display format.
$form['displays']['page']['options']['style']['style_plugin'] = array(
- '#title' => t('Display format'),
+ '#title' => $this->t('Display format'),
'#type' => 'select',
'#options' => $style_options,
);
@@ -285,18 +285,18 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$this->buildFormStyle($form, $form_state, 'page');
$form['displays']['page']['options']['items_per_page'] = array(
- '#title' => t('Items to display'),
+ '#title' => $this->t('Items to display'),
'#type' => 'number',
'#default_value' => 10,
'#min' => 0,
);
$form['displays']['page']['options']['pager'] = array(
- '#title' => t('Use a pager'),
+ '#title' => $this->t('Use a pager'),
'#type' => 'checkbox',
'#default_value' => TRUE,
);
$form['displays']['page']['options']['link'] = array(
- '#title' => t('Create a menu link'),
+ '#title' => $this->t('Create a menu link'),
'#type' => 'checkbox',
'#id' => 'edit-page-link',
);
@@ -317,22 +317,22 @@ public function buildForm(array $form, FormStateInterface $form_state) {
// These are not yet translated.
$menu_options = menu_list_system_menus();
foreach ($menu_options as $name => $title) {
- $menu_options[$name] = t($title);
+ $menu_options[$name] = $this->t($title);
}
}
$form['displays']['page']['options']['link_properties']['menu_name'] = array(
- '#title' => t('Menu'),
+ '#title' => $this->t('Menu'),
'#type' => 'select',
'#options' => $menu_options,
);
$form['displays']['page']['options']['link_properties']['title'] = array(
- '#title' => t('Link text'),
+ '#title' => $this->t('Link text'),
'#type' => 'textfield',
);
// Only offer a feed if we have at least one available feed row style.
if ($feed_row_options) {
$form['displays']['page']['options']['feed'] = array(
- '#title' => t('Include an RSS feed'),
+ '#title' => $this->t('Include an RSS feed'),
'#type' => 'checkbox',
'#id' => 'edit-page-feed',
);
@@ -347,7 +347,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#suffix' => '
',
);
$form['displays']['page']['options']['feed_properties']['path'] = array(
- '#title' => t('Feed path'),
+ '#title' => $this->t('Feed path'),
'#type' => 'textfield',
'#field_prefix' => $path_prefix,
// Account for the leading backslash.
@@ -355,7 +355,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
);
// This will almost never be visible.
$form['displays']['page']['options']['feed_properties']['row_plugin'] = array(
- '#title' => t('Feed row style'),
+ '#title' => $this->t('Feed row style'),
'#type' => 'select',
'#options' => $feed_row_options,
'#default_value' => key($feed_row_options),
@@ -374,12 +374,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
if (\Drupal::moduleHandler()->moduleExists('block')) {
$form['displays']['block'] = array(
'#type' => 'fieldset',
- '#title' => t('Block settings'),
+ '#title' => $this->t('Block settings'),
'#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')),
'#tree' => TRUE,
);
$form['displays']['block']['create'] = array(
- '#title' => t('Create a block'),
+ '#title' => $this->t('Create a block'),
'#type' => 'checkbox',
'#attributes' => array('class' => array('strong')),
'#id' => 'edit-block-create',
@@ -402,19 +402,19 @@ public function buildForm(array $form, FormStateInterface $form_state) {
);
$form['displays']['block']['options']['title'] = array(
- '#title' => t('Block title'),
+ '#title' => $this->t('Block title'),
'#type' => 'textfield',
'#maxlength' => 255,
);
$form['displays']['block']['options']['style'] = array(
'#type' => 'fieldset',
- '#title' => t('Block display settings'),
+ '#title' => $this->t('Block display settings'),
'#attributes' => array('class' => array('container-inline', 'fieldset-no-legend')),
);
// Create the dropdown for choosing the display format.
$form['displays']['block']['options']['style']['style_plugin'] = array(
- '#title' => t('Display format'),
+ '#title' => $this->t('Display format'),
'#type' => 'select',
'#options' => $style_options,
);
@@ -426,13 +426,13 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$this->buildFormStyle($form, $form_state, 'block');
$form['displays']['block']['options']['items_per_page'] = array(
- '#title' => t('Items per block'),
+ '#title' => $this->t('Items per block'),
'#type' => 'number',
'#default_value' => 5,
'#min' => 0,
);
$form['displays']['block']['options']['pager'] = array(
- '#title' => t('Use a pager'),
+ '#title' => $this->t('Use a pager'),
'#type' => 'checkbox',
'#default_value' => FALSE,
);
@@ -442,12 +442,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
if (\Drupal::moduleHandler()->moduleExists('rest')) {
$form['displays']['rest_export'] = array(
'#type' => 'fieldset',
- '#title' => t('REST export settings'),
+ '#title' => $this->t('REST export settings'),
'#attributes' => array('class' => array('views-attachment', 'fieldset-no-legend')),
'#tree' => TRUE,
);
$form['displays']['rest_export']['create'] = array(
- '#title' => t('Provide a REST export'),
+ '#title' => $this->t('Provide a REST export'),
'#type' => 'checkbox',
'#attributes' => array('class' => array('strong')),
'#id' => 'edit-rest-export-create',
@@ -470,7 +470,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
);
$form['displays']['rest_export']['options']['path'] = array(
- '#title' => t('REST export path'),
+ '#title' => $this->t('REST export path'),
'#type' => 'textfield',
'#field_prefix' => $path_prefix,
// Account for the leading backslash.
@@ -579,7 +579,7 @@ protected function buildFormStyle(array &$form, FormStateInterface $form_state,
$options = $this->rowStyleOptions();
$style_form['row_plugin'] = array(
'#type' => 'select',
- '#title' => t('of'),
+ '#title' => $this->t('of'),
'#options' => $options,
'#access' => count($options) > 1,
);
@@ -598,7 +598,7 @@ protected function buildFormStyle(array &$form, FormStateInterface $form_state,
);
}
elseif ($style_plugin->usesFields()) {
- $style_form['row_plugin'] = array('#markup' => '
');
}
}
@@ -627,13 +627,13 @@ protected function buildFilters(&$form, FormStateInterface $form_state) {
// If the current base table support bundles and has more than one (like user).
if (!empty($bundles) && $this->entityType && $this->entityType->hasKey('bundle')) {
// Get all bundles and their human readable names.
- $options = array('all' => t('All'));
+ $options = array('all' => $this->t('All'));
foreach ($bundles as $type => $bundle) {
$options[$type] = $bundle['label'];
}
$form['displays']['show']['type'] = array(
'#type' => 'select',
- '#title' => t('of type'),
+ '#title' => $this->t('of type'),
'#options' => $options,
);
$selected_bundle = static::getSelected($form_state, array('show', 'type'), 'all', $form['displays']['show']['type']);
@@ -652,14 +652,14 @@ protected function buildFilters(&$form, FormStateInterface $form_state) {
*/
protected function buildSorts(&$form, FormStateInterface $form_state) {
$sorts = array(
- 'none' => t('Unsorted'),
+ 'none' => $this->t('Unsorted'),
);
// Check if we are allowed to sort by creation date.
$created_column = $this->getCreatedColumn();
if ($created_column) {
$sorts += array(
- $created_column . ':DESC' => t('Newest first'),
- $created_column . ':ASC' => t('Oldest first'),
+ $created_column . ':DESC' => $this->t('Newest first'),
+ $created_column . ':ASC' => $this->t('Oldest first'),
);
}
if ($available_sorts = $this->getAvailableSorts()) {
@@ -670,7 +670,7 @@ protected function buildSorts(&$form, FormStateInterface $form_state) {
if (!empty($sorts)) {
$form['displays']['show']['sort'] = array(
'#type' => 'select',
- '#title' => t('sorted by'),
+ '#title' => $this->t('sorted by'),
'#options' => $sorts,
'#default_value' => isset($created_column) ? $created_column . ':DESC' : 'none',
);
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
index 5eefaf1..0fd5c1a 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
@@ -56,18 +56,18 @@ public function optionsSummary(&$categories, &$options) {
parent::optionsSummary($categories, $options);
$categories['display_test'] = array(
- 'title' => t('Display test settings'),
+ 'title' => $this->t('Display test settings'),
'column' => 'second',
'build' => array(
'#weight' => -100,
),
);
- $test_option = $this->getOption('test_option') ?: t('Empty');
+ $test_option = $this->getOption('test_option') ?: $this->t('Empty');
$options['test_option'] = array(
'category' => 'display_test',
- 'title' => t('Test option'),
+ 'title' => $this->t('Test option'),
'value' => views_ui_truncate($test_option, 24),
);
}
@@ -80,11 +80,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
switch ($form_state->get('section')) {
case 'test_option':
- $form['#title'] .= t('Test option');
+ $form['#title'] .= $this->t('Test option');
$form['test_option'] = array(
- '#title' => t('Test option'),
+ '#title' => $this->t('Test option'),
'#type' => 'textfield',
- '#description' => t('This is a textfield for test_option.'),
+ '#description' => $this->t('This is a textfield for test_option.'),
'#default_value' => $this->getOption('test_option'),
);
break;
@@ -100,7 +100,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
switch ($form_state->get('section')) {
case 'test_option':
if (!trim($form_state->getValue('test_option'))) {
- $form_state->setError($form['test_option'], t('You cannot have an empty option.'));
+ $form_state->setError($form['test_option'], $this->t('You cannot have an empty option.'));
}
break;
}
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php
index bb35b9e..853dc6b 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display_extender/DisplayExtenderTest.php
@@ -43,18 +43,18 @@ public function optionsSummary(&$categories, &$options) {
parent::optionsSummary($categories, $options);
$categories['display_extender_test'] = array(
- 'title' => t('Display extender test settings'),
+ 'title' => $this->t('Display extender test settings'),
'column' => 'second',
'build' => array(
'#weight' => -100,
),
);
- $test_option = $this->displayHandler->getOption('test_extender_test_option') ?: t('Empty');
+ $test_option = $this->displayHandler->getOption('test_extender_test_option') ?: $this->t('Empty');
$options['test_extender_test_option'] = array(
'category' => 'display_extender_test',
- 'title' => t('Test option'),
+ 'title' => $this->t('Test option'),
'value' => views_ui_truncate($test_option, 24),
);
}
@@ -65,11 +65,11 @@ public function optionsSummary(&$categories, &$options) {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
switch ($form_state->get('section')) {
case 'test_extender_test_option':
- $form['#title'] .= t('Test option');
+ $form['#title'] .= $this->t('Test option');
$form['test_extender_test_option'] = array(
- '#title' => t('Test option'),
+ '#title' => $this->t('Test option'),
'#type' => 'textfield',
- '#description' => t('This is a textfield for test_option.'),
+ '#description' => $this->t('This is a textfield for test_option.'),
'#default_value' => $this->displayHandler->getOption('test_extender_test_option'),
);
}
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php
index 23fa2fe..4677e76 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/filter/FilterTest.php
@@ -37,7 +37,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['test_enable'] = array(
'#type' => 'checkbox',
- '#title' => t('Controls whether the filter plugin should be active'),
+ '#title' => $this->t('Controls whether the filter plugin should be active'),
'#default_value' => $this->options['test_enable'],
);
}
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
index 5a1b61b..546a635 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
@@ -44,7 +44,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['test_setting'] = array(
- '#title' => t('Test setting'),
+ '#title' => $this->t('Test setting'),
'#type' => 'textfield',
'#default_value' => $this->options['test_setting'],
);
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
index cb759a3..1a7dbdc 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
@@ -49,9 +49,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['test_option'] = array(
- '#title' => t('Test option'),
+ '#title' => $this->t('Test option'),
'#type' => 'textfield',
- '#description' => t('This is a textfield for test_option.'),
+ '#description' => $this->t('This is a textfield for test_option.'),
'#default_value' => $this->options['test_option'],
);
}
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/MappingTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/MappingTest.php
index 740c156..6d221ae 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/MappingTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/MappingTest.php
@@ -31,18 +31,18 @@ class MappingTest extends Mapping {
protected function defineMapping() {
return array(
'title_field' => array(
- '#title' => t('Title field'),
- '#description' => t('Choose the field with the custom title.'),
+ '#title' => $this->t('Title field'),
+ '#description' => $this->t('Choose the field with the custom title.'),
'#toggle' => TRUE,
'#required' => TRUE,
),
'name_field' => array(
- '#title' => t('Name field'),
- '#description' => t('Choose the field with the custom name.'),
+ '#title' => $this->t('Name field'),
+ '#description' => $this->t('Choose the field with the custom name.'),
),
'numeric_field' => array(
- '#title' => t('Numeric field'),
- '#description' => t('Select one or more numeric fields.'),
+ '#title' => $this->t('Numeric field'),
+ '#description' => $this->t('Select one or more numeric fields.'),
'#multiple' => TRUE,
'#toggle' => TRUE,
'#filter' => 'filterNumericFields',
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
index 748dbd2..3cf8779 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
@@ -57,9 +57,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['test_option'] = array(
- '#title' => t('Test option'),
+ '#title' => $this->t('Test option'),
'#type' => 'textfield',
- '#description' => t('This is a textfield for test_option.'),
+ '#description' => $this->t('This is a textfield for test_option.'),
'#default_value' => $this->options['test_option'],
);
}