diff -u b/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php
--- b/core/modules/system/src/Form/ModulesListForm.php
+++ b/core/modules/system/src/Form/ModulesListForm.php
@@ -247,8 +247,8 @@
protected function buildRow(array $modules, Extension $module, $distribution) {
// Set the basic properties.
$row['#version'] = $module->info['version'];
- $row['#requires'] = isset($row['#requires']) ? $row['#requires'] : FALSE;
- $row['#required_by'] = isset($row['#required_by']) ? $row['#required_by'] : FALSE;
+ $row['#requires'] = array();
+ $row['#required_by'] = array();
// Generate link for module's help page, if there is one.
$row_links['help'] = array();
@@ -464,9 +464,9 @@
$row['description'] = array(
'#type' => 'details',
- '#title' => ' ' . $this->t($module->info['description']) . '',
+ '#title' => $this->t(' ' . $module->info['description'] . ''),
'#attributes' => array('id' => $id . '-description'),
- '#description' => $description,
+ '#description' => t($description),
'#collapsed' => TRUE,
'#wrapper_attributes' => array(
'class' => array('description', 'expand'),
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Access/AccessResultInterface.php
+++ b/core/lib/Drupal/Core/Access/AccessResultInterface.php
@@ -22,11 +22,6 @@
* @endcode
* would never enter the else-statement and hence introduce a critical security
* issue.
- *
- * Objects implementing this interface are using Kleene's weak three-valued
- * logic with the isAllowed() state being TRUE, the isForbidden() state being
- * the intermediate truth value and isNeutral() being FALSE. See
- * http://en.wikipedia.org/wiki/Many-valued_logic for more.
*/
interface AccessResultInterface {
@@ -65,6 +60,15 @@ public function isNeutral();
* - otherwise if isAllowed() in either ⇒ isAllowed()
* - otherwise both must be isNeutral() ⇒ isNeutral()
*
+ * Truth table:
+ * @code
+ * |A N F
+ * --+-----
+ * A |A A F
+ * N |A N F
+ * F |F F F
+ * @endcode
+ *
* @param \Drupal\Core\Access\AccessResultInterface $other
* The other access result to OR this one with.
*
@@ -80,6 +84,15 @@ public function orIf(AccessResultInterface $other);
* - otherwise, if isAllowed() in both ⇒ isAllowed()
* - otherwise, one of them is isNeutral() ⇒ isNeutral()
*
+ * Truth table:
+ * @code
+ * |A N F
+ * --+-----
+ * A |A N F
+ * N |N N F
+ * F |F F F
+ * @endcode
+ *
* @param \Drupal\Core\Access\AccessResultInterface $other
* The other access result to AND this one with.
*
only in patch2:
unchanged:
--- a/core/modules/aggregator/src/Plugin/views/field/TitleLink.php
+++ b/core/modules/aggregator/src/Plugin/views/field/TitleLink.php
@@ -48,7 +48,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']),
);
only in patch2:
unchanged:
--- a/core/modules/aggregator/src/Plugin/views/row/Rss.php
+++ b/core/modules/aggregator/src/Plugin/views/row/Rss.php
@@ -55,12 +55,12 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['view_mode'] = array(
'#type' => 'select',
- '#title' => t('Display type'),
+ '#title' => $this->t('Display type'),
'#options' => array(
- 'fulltext' => t('Full text'),
- 'teaser' => t('Title plus teaser'),
- 'title' => t('Title only'),
- 'default' => t('Use default RSS settings'),
+ 'fulltext' => $this->t('Full text'),
+ 'teaser' => $this->t('Title plus teaser'),
+ 'title' => $this->t('Title only'),
+ 'default' => $this->t('Use default RSS settings'),
),
'#default_value' => $this->options['view_mode'],
);
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/argument/UserUid.php
+++ b/core/modules/comment/src/Plugin/views/argument/UserUid.php
@@ -62,7 +62,7 @@ function title() {
$title = $this->database->query('SELECT name FROM {users_field_data} WHERE uid = :uid AND default_langcode = 1', array(':uid' => $this->argument))->fetchField();
}
if (empty($title)) {
- return t('No user');
+ return $this->t('No user');
}
return String::checkPlain($title);
@@ -108,7 +108,7 @@ public function query($group_by = FALSE) {
* {@inheritdoc}
*/
public function getSortName() {
- return t('Numerical', array(), array('context' => 'Sort order'));
+ return $this->t('Numerical', array(), array('context' => 'Sort order'));
}
}
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/Comment.php
+++ b/core/modules/comment/src/Plugin/views/field/Comment.php
@@ -63,13 +63,13 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_comment'] = array(
- '#title' => t('Link this field to its comment'),
- '#description' => t("Enable to override this field's links."),
+ '#title' => $this->t('Link this field to its comment'),
+ '#description' => $this->t("Enable to override this field's links."),
'#type' => 'checkbox',
'#default_value' => $this->options['link_to_comment'],
);
$form['link_to_entity'] = array(
- '#title' => t('Link field to the entity if there is no comment'),
+ '#title' => $this->t('Link field to the entity if there is no comment'),
'#type' => 'checkbox',
'#default_value' => $this->options['link_to_entity'],
);
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/EntityLink.php
+++ b/core/modules/comment/src/Plugin/views/field/EntityLink.php
@@ -36,9 +36,9 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['teaser'] = array(
'#type' => 'checkbox',
- '#title' => t('Show teaser-style link'),
+ '#title' => $this->t('Show teaser-style link'),
'#default_value' => $this->options['teaser'],
- '#description' => t('Show the comment link in the form used on standard entity teasers, rather than the full entity form.'),
+ '#description' => $this->t('Show the comment link in the form used on standard entity teasers, rather than the full entity form.'),
);
parent::buildOptionsForm($form, $form_state);
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/Link.php
+++ b/core/modules/comment/src/Plugin/views/field/Link.php
@@ -73,7 +73,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#default_value' => $this->options['text'],
);
$form['link_to_entity'] = array(
- '#title' => t('Link field to the entity if there is no comment'),
+ '#title' => $this->t('Link field to the entity if there is no comment'),
'#type' => 'checkbox',
'#default_value' => $this->options['link_to_entity'],
);
@@ -102,7 +102,7 @@ public function render(ResultRow $values) {
* Returns a string for the link text.
*/
protected function renderLink($data, ResultRow $values) {
- $text = !empty($this->options['text']) ? $this->options['text'] : t('View');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('View');
/** @var \Drupal\comment\CommentInterface $comment */
$comment = $data;
$cid = $comment->id();
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/LinkApprove.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkApprove.php
@@ -47,7 +47,7 @@ protected function renderLink($data, ResultRow $values) {
return;
}
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Approve');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Approve');
$comment = $this->get_entity($values);
$this->options['alter']['make_link'] = TRUE;
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/LinkDelete.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkDelete.php
@@ -39,7 +39,7 @@ public function access(AccountInterface $account) {
* Returns a string for the link text.
*/
protected function renderLink($data, ResultRow $values) {
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Delete');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Delete');
$comment = $this->getEntity($values);
$this->options['alter']['make_link'] = TRUE;
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkEdit.php
@@ -31,8 +31,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['destination'] = array(
'#type' => 'checkbox',
- '#title' => t('Use destination'),
- '#description' => t('Add destination to the link'),
+ '#title' => $this->t('Use destination'),
+ '#description' => $this->t('Add destination to the link'),
'#default_value' => $this->options['destination'],
);
}
@@ -56,7 +56,7 @@ protected function renderLink($data, ResultRow $values) {
return;
}
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Edit');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Edit');
unset($this->options['alter']['fragment']);
if (!empty($this->options['destination'])) {
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/LinkReply.php
+++ b/core/modules/comment/src/Plugin/views/field/LinkReply.php
@@ -39,7 +39,7 @@ public function access(AccountInterface $account) {
* Returns a string for the link text.
*/
protected function renderLink($data, ResultRow $values) {
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Reply');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Reply');
$comment = $this->getEntity($values);
$this->options['alter']['make_link'] = TRUE;
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/NodeComment.php
+++ b/core/modules/comment/src/Plugin/views/field/NodeComment.php
@@ -28,11 +28,11 @@ public function render(ResultRow $values) {
switch ($value) {
case CommentItemInterface::HIDDEN:
default:
- return t('Hidden');
+ return $this->t('Hidden');
case CommentItemInterface::CLOSED:
- return t('Closed');
+ return $this->t('Closed');
case CommentItemInterface::OPEN:
- return t('Open');
+ return $this->t('Open');
}
}
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
+++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
@@ -85,8 +85,8 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_comment'] = array(
- '#title' => t('Link this field to new comments'),
- '#description' => t("Enable to override this field's links."),
+ '#title' => $this->t('Link this field to new comments'),
+ '#description' => $this->t("Enable to override this field's links."),
'#type' => 'checkbox',
'#default_value' => $this->options['link_to_comment'],
);
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/field/Username.php
+++ b/core/modules/comment/src/Plugin/views/field/Username.php
@@ -42,7 +42,7 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_user'] = array(
- '#title' => t("Link this field to its user or an author's homepage"),
+ '#title' => $this->t("Link this field to its user or an author's homepage"),
'#type' => 'checkbox',
'#default_value' => $this->options['link_to_user'],
);
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/filter/NodeComment.php
+++ b/core/modules/comment/src/Plugin/views/filter/NodeComment.php
@@ -21,9 +21,9 @@ class NodeComment extends InOperator {
public function getValueOptions() {
$this->value_options = array(
- CommentItemInterface::HIDDEN => t('Hidden'),
- CommentItemInterface::CLOSED => t('Closed'),
- CommentItemInterface::OPEN => t('Open'),
+ CommentItemInterface::HIDDEN => $this->t('Hidden'),
+ CommentItemInterface::CLOSED => $this->t('Closed'),
+ CommentItemInterface::OPEN => $this->t('Open'),
);
}
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/row/Rss.php
+++ b/core/modules/comment/src/Plugin/views/row/Rss.php
@@ -41,7 +41,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['view_mode'] = array(
'#type' => 'select',
- '#title' => t('Display type'),
+ '#title' => $this->t('Display type'),
'#options' => $this->options_form_summary_options(),
'#default_value' => $this->options['view_mode'],
);
@@ -74,8 +74,8 @@ function options_form_summary_options() {
foreach ($view_modes as $mode => $settings) {
$options[$mode] = $settings['label'];
}
- $options['title'] = t('Title only');
- $options['default'] = t('Use site default RSS settings');
+ $options['title'] = $this->t('Title only');
+ $options['default'] = $this->t('Use site default RSS settings');
return $options;
}
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/wizard/Comment.php
+++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php
@@ -69,8 +69,8 @@ class Comment extends WizardPluginBase {
*/
protected function rowStyleOptions() {
$options = array();
- $options['comment'] = t('comments');
- $options['fields'] = t('fields');
+ $options['comment'] = $this->t('comments');
+ $options['fields'] = $this->t('fields');
return $options;
}
@@ -87,11 +87,11 @@ protected function buildFormStyle(array &$form, FormStateInterface $form_state,
case 'comment':
$style_form['row_options']['links'] = array(
'#type' => 'select',
- '#title' => t('Should links be displayed below each comment'),
+ '#title' => $this->t('Should links be displayed below each comment'),
'#title_display' => 'invisible',
'#options' => array(
- 1 => t('with links (allow users to reply to the comment, etc.)'),
- 0 => t('without links'),
+ 1 => $this->t('with links (allow users to reply to the comment, etc.)'),
+ 0 => $this->t('without links'),
),
'#default_value' => 1,
);
only in patch2:
unchanged:
--- a/core/modules/contact/src/Plugin/views/field/ContactLink.php
+++ b/core/modules/contact/src/Plugin/views/field/ContactLink.php
@@ -87,9 +87,9 @@ public static function create(ContainerInterface $container, array $configuratio
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
- $form['text']['#title'] = t('Link label');
+ $form['text']['#title'] = $this->t('Link label');
$form['text']['#required'] = TRUE;
- $form['text']['#default_value'] = empty($this->options['text']) ? t('contact') : $this->options['text'];
+ $form['text']['#default_value'] = empty($this->options['text']) ? $this->t('contact') : $this->options['text'];
}
/**
@@ -119,7 +119,7 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) {
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = "user/{$entity->id()}/contact";
- $title = t('Contact %user', array('%user' => $entity->name->value));
+ $title = $this->t('Contact %user', array('%user' => $entity->name->value));
$this->options['alter']['attributes'] = array('title' => $title);
if (!empty($this->options['text'])) {
only in patch2:
unchanged:
--- a/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php
+++ b/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php
@@ -36,7 +36,7 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['text'] = array(
'#type' => 'textfield',
- '#title' => t('Text to display'),
+ '#title' => $this->t('Text to display'),
'#default_value' => $this->options['text'],
);
parent::buildOptionsForm($form, $form_state);
@@ -62,7 +62,7 @@ public function render(ResultRow $values) {
*/
protected function renderLink(EntityInterface $entity, ResultRow $values) {
if (content_translation_translate_access($entity)->isAllowed()) {
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Translate');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Translate');
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = $entity->getSystemPath('drupal:content-translation-overview');
only in patch2:
unchanged:
--- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
@@ -44,18 +44,18 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$field_options = array_slice($all_fields, 0, array_search($this->options['id'], array_keys($all_fields)));
$form['fields'] = array(
'#type' => 'checkboxes',
- '#title' => t('Fields'),
- '#description' => t('Fields to be included as contextual links.'),
+ '#title' => $this->t('Fields'),
+ '#description' => $this->t('Fields to be included as contextual links.'),
'#options' => $field_options,
'#default_value' => $this->options['fields'],
);
$form['destination'] = array(
'#type' => 'select',
- '#title' => t('Include destination'),
- '#description' => t('Include a "destination" parameter in the link to return the user to the original view upon completing the contextual 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 contextual action.'),
'#options' => array(
- '0' => t('No'),
- '1' => t('Yes'),
+ '0' => $this->t('No'),
+ '1' => $this->t('Yes'),
),
'#default_value' => $this->options['destination'],
);
only in patch2:
unchanged:
--- a/core/modules/dblog/src/Plugin/views/field/DblogMessage.php
+++ b/core/modules/dblog/src/Plugin/views/field/DblogMessage.php
@@ -51,7 +51,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['replace_variables'] = array(
- '#title' => t('Replace variables'),
+ '#title' => $this->t('Replace variables'),
'#type' => 'checkbox',
'#default_value' => $this->options['replace_variables'],
);
only in patch2:
unchanged:
--- a/core/modules/entity_reference/src/Plugin/views/display/EntityReference.php
+++ b/core/modules/entity_reference/src/Plugin/views/display/EntityReference.php
@@ -165,14 +165,14 @@ public function validate() {
// Verify that search fields are set up.
$style = $this->getOption('style');
if (!isset($style['options']['search_fields'])) {
- $errors[] = t('Display "@display" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display['display_title']));
+ $errors[] = $this->t('Display "@display" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display['display_title']));
}
else {
// Verify that the search fields used actually exist.
$fields = array_keys($this->handlers['field']);
foreach ($style['options']['search_fields'] as $field_alias => $enabled) {
if ($enabled && !in_array($field_alias, $fields)) {
- $errors[] = t('Display "@display" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display['display_title'], '%field' => $field_alias));
+ $errors[] = $this->t('Display "@display" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display['display_title'], '%field' => $field_alias));
}
}
}
only in patch2:
unchanged:
--- a/core/modules/entity_reference/src/Plugin/views/row/EntityReference.php
+++ b/core/modules/entity_reference/src/Plugin/views/row/EntityReference.php
@@ -43,7 +43,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
// Expand the description of the 'Inline field' checkboxes.
- $form['inline']['#description'] .= '
' . t("Note: In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
+ $form['inline']['#description'] .= '
' . $this->t("Note: In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
}
/**
only in patch2:
unchanged:
--- a/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php
+++ b/core/modules/entity_reference/src/Plugin/views/style/EntityReference.php
@@ -61,11 +61,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$options = $this->displayHandler->getFieldLabels(TRUE);
$form['search_fields'] = array(
'#type' => 'checkboxes',
- '#title' => t('Search fields'),
+ '#title' => $this->t('Search fields'),
'#options' => $options,
'#required' => TRUE,
'#default_value' => $this->options['search_fields'],
- '#description' => t('Select the field(s) that will be searched when using the autocomplete widget.'),
+ '#description' => $this->t('Select the field(s) that will be searched when using the autocomplete widget.'),
'#weight' => -3,
);
}
only in patch2:
unchanged:
--- a/core/modules/field/src/Plugin/views/argument/FieldList.php
+++ b/core/modules/field/src/Plugin/views/argument/FieldList.php
@@ -55,7 +55,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['summary']['human'] = array(
- '#title' => t('Display list value as human readable'),
+ '#title' => $this->t('Display list value as human readable'),
'#type' => 'checkbox',
'#default_value' => $this->options['summary']['human'],
'#states' => array(
only in patch2:
unchanged:
--- a/core/modules/field/src/Plugin/views/argument/ListString.php
+++ b/core/modules/field/src/Plugin/views/argument/ListString.php
@@ -56,7 +56,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['summary']['human'] = array(
- '#title' => t('Display list value as human readable'),
+ '#title' => $this->t('Display list value as human readable'),
'#type' => 'checkbox',
'#default_value' => $this->options['summary']['human'],
'#states' => array(
only in patch2:
unchanged:
--- a/core/modules/field/src/Plugin/views/field/Field.php
+++ b/core/modules/field/src/Plugin/views/field/Field.php
@@ -459,16 +459,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
else {
$form['click_sort_column'] = array(
'#type' => 'select',
- '#title' => t('Column used for click sorting'),
+ '#title' => $this->t('Column used for click sorting'),
'#options' => array_combine($column_names, $column_names),
'#default_value' => $this->options['click_sort_column'],
- '#description' => t('Used by Style: Table to determine the actual column to click sort the field on. The default is usually fine.'),
+ '#description' => $this->t('Used by Style: Table to determine the actual column to click sort the field on. The default is usually fine.'),
);
}
$form['type'] = array(
'#type' => 'select',
- '#title' => t('Formatter'),
+ '#title' => $this->t('Formatter'),
'#options' => $formatters,
'#default_value' => $this->options['type'],
'#ajax' => array(
@@ -479,16 +479,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
);
$form['field_api_classes'] = array(
- '#title' => t('Use field template'),
+ '#title' => $this->t('Use field template'),
'#type' => 'checkbox',
'#default_value' => $this->options['field_api_classes'],
- '#description' => t('If checked, field api classes will be added by field templates. This is not recommended unless your CSS depends upon these classes. If not checked, template will not be used.'),
+ '#description' => $this->t('If checked, field api classes will be added by field templates. This is not recommended unless your CSS depends upon these classes. If not checked, template will not be used.'),
'#fieldset' => 'style_settings',
'#weight' => 20,
);
if ($this->multiple) {
- $form['field_api_classes']['#description'] .= ' ' . t('Checking this option will cause the group Display Type and Separator values to be ignored.');
+ $form['field_api_classes']['#description'] .= ' ' . $this->t('Checking this option will cause the group Display Type and Separator values to be ignored.');
}
// Get the currently selected formatter.
@@ -523,21 +523,21 @@ function multiple_options_form(&$form, FormStateInterface $form_state) {
$form['multiple_field_settings'] = array(
'#type' => 'details',
- '#title' => t('Multiple field settings'),
+ '#title' => $this->t('Multiple field settings'),
'#weight' => 5,
);
$form['group_rows'] = array(
- '#title' => t('Display all values in the same row'),
+ '#title' => $this->t('Display all values in the same row'),
'#type' => 'checkbox',
'#default_value' => $this->options['group_rows'],
- '#description' => t('If checked, multiple values for this field will be shown in the same row. If not checked, each value in this field will create a new row. If using group by, please make sure to group by "Entity ID" for this setting to have any effect.'),
+ '#description' => $this->t('If checked, multiple values for this field will be shown in the same row. If not checked, each value in this field will create a new row. If using group by, please make sure to group by "Entity ID" for this setting to have any effect.'),
'#fieldset' => 'multiple_field_settings',
);
// Make the string translatable by keeping it as a whole rather than
// translating prefix and suffix separately.
- list($prefix, $suffix) = explode('@count', t('Display @count value(s)'));
+ list($prefix, $suffix) = explode('@count', $this->t('Display @count value(s)'));
if ($field->getCardinality() == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) {
$type = 'textfield';
@@ -552,11 +552,11 @@ function multiple_options_form(&$form, FormStateInterface $form_state) {
}
$form['multi_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'),
),
'#states' => array(
'visible' => array(
@@ -569,7 +569,7 @@ function multiple_options_form(&$form, FormStateInterface $form_state) {
$form['separator'] = array(
'#type' => 'textfield',
- '#title' => t('Separator'),
+ '#title' => $this->t('Separator'),
'#default_value' => $this->options['separator'],
'#states' => array(
'visible' => array(
@@ -596,7 +596,7 @@ function multiple_options_form(&$form, FormStateInterface $form_state) {
'#fieldset' => 'multiple_field_settings',
);
- list($prefix, $suffix) = explode('@count', t('starting from @count'));
+ list($prefix, $suffix) = explode('@count', $this->t('starting from @count'));
$form['delta_offset'] = array(
'#type' => 'textfield',
'#size' => 5,
@@ -608,11 +608,11 @@ function multiple_options_form(&$form, FormStateInterface $form_state) {
':input[name="options[group_rows]"]' => array('checked' => TRUE),
),
),
- '#description' => t('(first item is 0)'),
+ '#description' => $this->t('(first item is 0)'),
'#fieldset' => 'multiple_field_settings',
);
$form['delta_reversed'] = array(
- '#title' => t('Reversed'),
+ '#title' => $this->t('Reversed'),
'#type' => 'checkbox',
'#default_value' => $this->options['delta_reversed'],
'#suffix' => $suffix,
@@ -621,11 +621,11 @@ function multiple_options_form(&$form, FormStateInterface $form_state) {
':input[name="options[group_rows]"]' => array('checked' => TRUE),
),
),
- '#description' => t('(start from last values)'),
+ '#description' => $this->t('(start from last values)'),
'#fieldset' => 'multiple_field_settings',
);
$form['delta_first_last'] = array(
- '#title' => t('First and last only'),
+ '#title' => $this->t('First and last only'),
'#type' => 'checkbox',
'#default_value' => $this->options['delta_first_last'],
'#suffix' => '',
@@ -648,14 +648,14 @@ public function buildGroupByForm(&$form, FormStateInterface $form_state) {
$field_columns = array_keys($this->getFieldDefinition()->getColumns());
$group_columns = array(
- 'entity_id' => t('Entity ID'),
+ 'entity_id' => $this->t('Entity ID'),
) + array_map('ucfirst', array_combine($field_columns, $field_columns));
$form['group_column'] = array(
'#type' => 'select',
- '#title' => t('Group column'),
+ '#title' => $this->t('Group column'),
'#default_value' => $this->options['group_column'],
- '#description' => t('Select the column of this field to apply the grouping function selected above.'),
+ '#description' => $this->t('Select the column of this field to apply the grouping function selected above.'),
'#options' => $group_columns,
);
@@ -667,9 +667,9 @@ public function buildGroupByForm(&$form, FormStateInterface $form_state) {
// Add on defined fields, noting that they're prefixed with the field name.
$form['group_columns'] = array(
'#type' => 'checkboxes',
- '#title' => t('Group columns (additional)'),
+ '#title' => $this->t('Group columns (additional)'),
'#default_value' => $this->options['group_columns'],
- '#description' => t('Select any additional columns of this field to include in the query and to group on.'),
+ '#description' => $this->t('Select any additional columns of this field to include in the query and to group on.'),
'#options' => $options + $group_columns,
);
}
@@ -889,7 +889,7 @@ function render_item($count, $item) {
protected function documentSelfTokens(&$tokens) {
$field = $this->getFieldDefinition();
foreach ($field->getColumns() as $id => $column) {
- $tokens['[' . $this->options['id'] . '-' . $id . ']'] = t('Raw @column', array('@column' => $id));
+ $tokens['[' . $this->options['id'] . '-' . $id . ']'] = $this->t('Raw @column', array('@column' => $id));
}
}
only in patch2:
unchanged:
--- a/core/modules/file/src/Plugin/views/field/Extension.php
+++ b/core/modules/file/src/Plugin/views/field/Extension.php
@@ -36,8 +36,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['extension_detect_tar'] = array(
'#type' => 'checkbox',
- '#title' => t('Detect if tar is part of the extension'),
- '#description' => t("See if the previous extension is '.tar' and if so, add that, so we see 'tar.gz' or 'tar.bz2' instead of just 'gz'."),
+ '#title' => $this->t('Detect if tar is part of the extension'),
+ '#description' => $this->t("See if the previous extension is '.tar' and if so, add that, so we see 'tar.gz' or 'tar.bz2' instead of just 'gz'."),
'#default_value' => $this->options['extension_detect_tar'],
);
}
only in patch2:
unchanged:
--- a/core/modules/file/src/Plugin/views/field/File.php
+++ b/core/modules/file/src/Plugin/views/field/File.php
@@ -44,8 +44,8 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_file'] = array(
- '#title' => t('Link this field to download the file'),
- '#description' => t("Enable to override this field's links."),
+ '#title' => $this->t('Link this field to download the file'),
+ '#description' => $this->t("Enable to override this field's links."),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_file']),
);
only in patch2:
unchanged:
--- a/core/modules/file/src/Plugin/views/field/FileMime.php
+++ b/core/modules/file/src/Plugin/views/field/FileMime.php
@@ -27,7 +27,7 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['filemime_image'] = array(
- '#title' => t('Display an icon representing the file type, instead of the MIME text (such as "image/jpeg")'),
+ '#title' => $this->t('Display an icon representing the file type, instead of the MIME text (such as "image/jpeg")'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['filemime_image']),
);
only in patch2:
unchanged:
--- a/core/modules/file/src/Plugin/views/field/Uri.php
+++ b/core/modules/file/src/Plugin/views/field/Uri.php
@@ -25,8 +25,8 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['file_download_path'] = array(
- '#title' => t('Display download path instead of file storage URI'),
- '#description' => t('This will provide the full download URL rather than the internal filestream address.'),
+ '#title' => $this->t('Display download path instead of file storage URI'),
+ '#description' => $this->t('This will provide the full download URL rather than the internal filestream address.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['file_download_path']),
);
only in patch2:
unchanged:
--- a/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
+++ b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php
@@ -60,7 +60,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
if (\Drupal::moduleHandler()->moduleExists('comment')) {
$form['comments'] = array(
'#type' => 'checkbox',
- '#title' => t('Check for new comments as well'),
+ '#title' => $this->t('Check for new comments as well'),
'#default_value' => !empty($this->options['comments']),
);
}
only in patch2:
unchanged:
--- a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
+++ b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
@@ -49,7 +49,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
$label = $this->options['expose']['label'];
}
else {
- $label = t('Has new content');
+ $label = $this->t('Has new content');
}
$form['value'] = array(
'#type' => 'checkbox',
@@ -95,7 +95,7 @@ public function query() {
public function adminSummary() {
if (!empty($this->options['exposed'])) {
- return t('exposed');
+ return $this->t('exposed');
}
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/argument/Type.php
+++ b/core/modules/node/src/Plugin/views/argument/Type.php
@@ -35,7 +35,7 @@ function title() {
function node_type($type_name) {
$type = entity_load('node_type', $type_name);
- $output = $type ? $type->label() : t('Unknown content type');
+ $output = $type ? $type->label() : $this->t('Unknown content type');
return UtilityString::checkPlain($output);
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/Language.php
+++ b/core/modules/node/src/Plugin/views/field/Language.php
@@ -30,10 +30,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'),
);
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/Link.php
+++ b/core/modules/node/src/Plugin/views/field/Link.php
@@ -36,7 +36,7 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['text'] = array(
'#type' => 'textfield',
- '#title' => t('Text to display'),
+ '#title' => $this->t('Text to display'),
'#default_value' => $this->options['text'],
);
parent::buildOptionsForm($form, $form_state);
@@ -77,7 +77,7 @@ protected function renderLink($node, ResultRow $values) {
if ($node->access('view')) {
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = 'node/' . $node->id();
- $text = !empty($this->options['text']) ? $this->options['text'] : t('View');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('View');
return $text;
}
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/LinkDelete.php
+++ b/core/modules/node/src/Plugin/views/field/LinkDelete.php
@@ -40,7 +40,7 @@ protected function renderLink($node, ResultRow $values) {
$this->options['alter']['path'] = $node->getSystemPath('delete-form');
$this->options['alter']['query'] = drupal_get_destination();
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Delete');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Delete');
return $text;
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/node/src/Plugin/views/field/LinkEdit.php
@@ -40,7 +40,7 @@ protected function renderLink($node, ResultRow $values) {
$this->options['alter']['path'] = "node/" . $node->id() . "/edit";
$this->options['alter']['query'] = drupal_get_destination();
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Edit');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Edit');
return $text;
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/Node.php
+++ b/core/modules/node/src/Plugin/views/field/Node.php
@@ -47,8 +47,8 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_node'] = array(
- '#title' => t('Link this field to the original piece of content'),
- '#description' => t("Enable to override this field's links."),
+ '#title' => $this->t('Link this field to the original piece of content'),
+ '#description' => $this->t("Enable to override this field's links."),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_node']),
);
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/NodeBulkForm.php
+++ b/core/modules/node/src/Plugin/views/field/NodeBulkForm.php
@@ -21,7 +21,7 @@ class NodeBulkForm extends BulkForm {
* {@inheritdoc}
*/
protected function emptySelectedMessage() {
- return t('No content selected.');
+ return $this->t('No content selected.');
}
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/Path.php
+++ b/core/modules/node/src/Plugin/views/field/Path.php
@@ -42,9 +42,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['absolute'] = array(
'#type' => 'checkbox',
- '#title' => t('Use absolute link (begins with "http://")'),
+ '#title' => $this->t('Use absolute link (begins with "http://")'),
'#default_value' => $this->options['absolute'],
- '#description' => t('Enable this option to output an absolute link. Required if you want to use the path as a link destination (as in "output this field as a link" above).'),
+ '#description' => $this->t('Enable this option to output an absolute link. Required if you want to use the path as a link destination (as in "output this field as a link" above).'),
'#fieldset' => 'alter',
);
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/Revision.php
+++ b/core/modules/node/src/Plugin/views/field/Revision.php
@@ -44,8 +44,8 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_node_revision'] = array(
- '#title' => t('Link this field to its content revision'),
- '#description' => t('This will override any other link you have set.'),
+ '#title' => $this->t('Link this field to its content revision'),
+ '#description' => $this->t('This will override any other link you have set.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_node_revision']),
);
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/RevisionLink.php
+++ b/core/modules/node/src/Plugin/views/field/RevisionLink.php
@@ -65,7 +65,7 @@ protected function renderLink($data, ResultRow $values) {
$this->options['alter']['path'] = $path;
$this->options['alter']['query'] = drupal_get_destination();
- return !empty($this->options['text']) ? $this->options['text'] : t('View');
+ return !empty($this->options['text']) ? $this->options['text'] : $this->t('View');
}
/**
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php
+++ b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php
@@ -53,7 +53,7 @@ protected function renderLink($data, ResultRow $values) {
$this->options['alter']['path'] = 'node/' . $node->id() . "/revisions/$vid/delete";
$this->options['alter']['query'] = drupal_get_destination();
- return !empty($this->options['text']) ? $this->options['text'] : t('Delete');
+ return !empty($this->options['text']) ? $this->options['text'] : $this->t('Delete');
}
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
+++ b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php
@@ -53,7 +53,7 @@ protected function renderLink($data, ResultRow $values) {
$this->options['alter']['path'] = 'node/' . $node->id() . "/revisions/$vid/revert";
$this->options['alter']['query'] = drupal_get_destination();
- return !empty($this->options['text']) ? $this->options['text'] : t('Revert');
+ return !empty($this->options['text']) ? $this->options['text'] : $this->t('Revert');
}
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/field/Type.php
+++ b/core/modules/node/src/Plugin/views/field/Type.php
@@ -34,8 +34,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 the content type machine name.'),
+ '#title' => $this->t('Output machine name'),
+ '#description' => $this->t('Display field as the content type machine name.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['machine_name']),
);
@@ -47,7 +47,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
function render_name($data, $values) {
if ($this->options['machine_name'] != 1 && $data !== NULL && $data !== '') {
$type = entity_load('node_type', $data);
- return $type ? t($this->sanitizeValue($type->label())) : '';
+ return $type ? $this->t($this->sanitizeValue($type->label())) : '';
}
return $this->sanitizeValue($data);
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/row/Rss.php
+++ b/core/modules/node/src/Plugin/views/row/Rss.php
@@ -49,7 +49,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['view_mode'] = array(
'#type' => 'select',
- '#title' => t('Display type'),
+ '#title' => $this->t('Display type'),
'#options' => $this->buildOptionsForm_summary_options(),
'#default_value' => $this->options['view_mode'],
);
@@ -64,8 +64,8 @@ public function buildOptionsForm_summary_options() {
foreach ($view_modes as $mode => $settings) {
$options[$mode] = $settings['label'];
}
- $options['title'] = t('Title only');
- $options['default'] = t('Use site default RSS settings');
+ $options['title'] = $this->t('Title only');
+ $options['default'] = $this->t('Use site default RSS settings');
return $options;
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/wizard/Node.php
+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -65,7 +65,7 @@ class Node extends WizardPluginBase {
public function getAvailableSorts() {
// You can't execute functions in properties, so override the method
return array(
- 'node_field_data-title:DESC' => t('Title')
+ 'node_field_data-title:DESC' => $this->t('Title')
);
}
@@ -74,11 +74,11 @@ public function getAvailableSorts() {
*/
protected function rowStyleOptions() {
$options = array();
- $options['teasers'] = t('teasers');
- $options['full_posts'] = t('full posts');
- $options['titles'] = t('titles');
- $options['titles_linked'] = t('titles (linked)');
- $options['fields'] = t('fields');
+ $options['teasers'] = $this->t('teasers');
+ $options['full_posts'] = $this->t('full posts');
+ $options['titles'] = $this->t('titles');
+ $options['titles_linked'] = $this->t('titles (linked)');
+ $options['fields'] = $this->t('fields');
return $options;
}
@@ -106,11 +106,11 @@ protected function buildFormStyle(array &$form, FormStateInterface $form_state,
case 'teasers':
$style_form['row_options']['links'] = array(
'#type' => 'select',
- '#title' => t('Should links be displayed below each node'),
+ '#title' => $this->t('Should links be displayed below each node'),
'#title_display' => 'invisible',
'#options' => array(
- 1 => t('with links (allow users to add comments, etc.)'),
- 0 => t('without links'),
+ 1 => $this->t('with links (allow users to add comments, etc.)'),
+ 0 => $this->t('without links'),
),
'#default_value' => 1,
);
@@ -297,7 +297,7 @@ protected function buildFilters(&$form, FormStateInterface $form_state) {
// Add the autocomplete textfield to the wizard.
$form['displays']['show']['tagged_with'] = array(
'#type' => 'textfield',
- '#title' => t('tagged with'),
+ '#title' => $this->t('tagged with'),
'#autocomplete_route_name' => 'taxonomy.autocomplete',
'#autocomplete_route_parameters' => array(
'entity_type' => $this->entityTypeId,
only in patch2:
unchanged:
--- a/core/modules/rest/src/Plugin/views/display/RestExport.php
+++ b/core/modules/rest/src/Plugin/views/display/RestExport.php
@@ -225,7 +225,7 @@ public function optionsSummary(&$categories, &$options) {
unset($options['show_admin_links'], $options['analyze-theme']);
$categories['path'] = array(
- 'title' => t('Path settings'),
+ 'title' => $this->t('Path settings'),
'column' => 'second',
'build' => array(
'#weight' => -10,
@@ -233,7 +233,7 @@ public function optionsSummary(&$categories, &$options) {
);
$options['path']['category'] = 'path';
- $options['path']['title'] = t('Path');
+ $options['path']['title'] = $this->t('Path');
// Remove css/exposed form settings, as they are not used for the data
// display.
only in patch2:
unchanged:
--- a/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
+++ b/core/modules/rest/src/Plugin/views/row/DataFieldRow.php
@@ -79,8 +79,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['field_options'] = array(
'#type' => 'table',
- '#header' => array(t('Field'), t('Alias'), t('Raw output')),
- '#empty' => t('You have no fields. Add some to your view.'),
+ '#header' => array(t('Field'), $this->t('Alias'), $this->t('Raw output')),
+ '#empty' => $this->t('You have no fields. Add some to your view.'),
'#tree' => TRUE,
);
@@ -92,14 +92,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
'#markup' => $id,
);
$form['field_options'][$id]['alias'] = array(
- '#title' => t('Alias for @id', array('@id' => $id)),
+ '#title' => $this->t('Alias for @id', array('@id' => $id)),
'#title_display' => 'invisible',
'#type' => 'textfield',
'#default_value' => isset($options[$id]['alias']) ? $options[$id]['alias'] : '',
'#element_validate' => array(array($this, 'validateAliasName')),
);
$form['field_options'][$id]['raw_output'] = array(
- '#title' => t('Raw output for @id', array('@id' => $id)),
+ '#title' => $this->t('Raw output for @id', array('@id' => $id)),
'#title_display' => 'invisible',
'#type' => 'checkbox',
'#default_value' => isset($options[$id]['raw_output']) ? $options[$id]['raw_output'] : '',
@@ -113,7 +113,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
*/
public function validateAliasName($element, FormStateInterface $form_state) {
if (preg_match('@[^A-Za-z0-9_-]+@', $element['#value'])) {
- $form_state->setError($element, t('The machine-readable name must contain only letters, numbers, dashes and underscores.'));
+ $form_state->setError($element, $this->t('The machine-readable name must contain only letters, numbers, dashes and underscores.'));
}
}
@@ -127,7 +127,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
// If array filter returns empty, no values have been entered. Unique keys
// should only be validated if we have some.
if (($filtered = array_filter($aliases)) && (array_unique($filtered) !== $filtered)) {
- $form_state->setErrorByName('aliases', t('All field aliases must be unique'));
+ $form_state->setErrorByName('aliases', $this->t('All field aliases must be unique'));
}
}
only in patch2:
unchanged:
--- a/core/modules/rest/src/Plugin/views/style/Serializer.php
+++ b/core/modules/rest/src/Plugin/views/style/Serializer.php
@@ -94,8 +94,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['formats'] = array(
'#type' => 'checkboxes',
- '#title' => t('Accepted request formats'),
- '#description' => t('Request formats that will be allowed in responses. If none are selected all formats will be allowed.'),
+ '#title' => $this->t('Accepted request formats'),
+ '#description' => $this->t('Request formats that will be allowed in responses. If none are selected all formats will be allowed.'),
'#options' => array_combine($this->formats, $this->formats),
'#default_value' => $this->options['formats'],
);
only in patch2:
unchanged:
--- a/core/modules/search/src/Plugin/views/filter/Search.php
+++ b/core/modules/search/src/Plugin/views/filter/Search.php
@@ -74,7 +74,7 @@ protected function defineOptions() {
protected function operatorForm(&$form, FormStateInterface $form_state) {
$form['operator'] = array(
'#type' => 'radios',
- '#title' => t('On empty input'),
+ '#title' => $this->t('On empty input'),
'#default_value' => $this->operator,
'#options' => array(
'optional' => $this->t('Show All'),
only in patch2:
unchanged:
--- a/core/modules/search/src/Plugin/views/row/SearchRow.php
+++ b/core/modules/search/src/Plugin/views/row/SearchRow.php
@@ -38,7 +38,7 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['score'] = array(
'#type' => 'checkbox',
- '#title' => t('Display score'),
+ '#title' => $this->t('Display score'),
'#default_value' => $this->options['score'],
);
}
only in patch2:
unchanged:
--- a/core/modules/system/src/Plugin/views/field/BulkForm.php
+++ b/core/modules/system/src/Plugin/views/field/BulkForm.php
@@ -96,23 +96,23 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['action_title'] = array(
'#type' => 'textfield',
- '#title' => t('Action title'),
+ '#title' => $this->t('Action title'),
'#default_value' => $this->options['action_title'],
- '#description' => t('The title shown above the actions dropdown.'),
+ '#description' => $this->t('The title shown above the actions dropdown.'),
);
$form['include_exclude'] = array(
'#type' => 'radios',
- '#title' => t('Available actions'),
+ '#title' => $this->t('Available actions'),
'#options' => array(
- 'exclude' => t('All actions, except selected'),
- 'include' => t('Only selected actions'),
+ 'exclude' => $this->t('All actions, except selected'),
+ 'include' => $this->t('Only selected actions'),
),
'#default_value' => $this->options['include_exclude'],
);
$form['selected_actions'] = array(
'#type' => 'checkboxes',
- '#title' => t('Selected actions'),
+ '#title' => $this->t('Selected actions'),
'#options' => $this->getBulkOptions(FALSE),
'#default_value' => $this->options['selected_actions'],
);
@@ -175,14 +175,14 @@ public function viewsForm(&$form, FormStateInterface $form_state) {
'#type' => 'checkbox',
// We are not able to determine a main "title" for each row, so we can
// only output a generic label.
- '#title' => t('Update this item'),
+ '#title' => $this->t('Update this item'),
'#title_display' => 'invisible',
'#default_value' => !empty($form_state->getValue($this->options['id'])[$row_index]) ? 1 : NULL,
);
}
// Replace the form submit button label.
- $form['actions']['submit']['#value'] = t('Apply');
+ $form['actions']['submit']['#value'] = $this->t('Apply');
// Ensure a consistent container for filters/operations in the view header.
$form['header'] = array(
@@ -285,7 +285,7 @@ public function viewsFormSubmit(&$form, FormStateInterface $form_state) {
* Message displayed when no items are selected.
*/
protected function emptySelectedMessage() {
- return t('No items selected.');
+ return $this->t('No items selected.');
}
/**
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
@@ -36,15 +36,15 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['depth'] = array(
'#type' => 'weight',
- '#title' => t('Depth'),
+ '#title' => $this->t('Depth'),
'#default_value' => $this->options['depth'],
- '#description' => t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).'),
+ '#description' => $this->t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).'),
);
$form['break_phrase'] = array(
'#type' => 'checkbox',
- '#title' => t('Allow multiple values'),
- '#description' => t('If selected, users can enter multiple values in the form of 1+2+3. Due to the number of JOINs it would require, AND will be treated as OR with this filter.'),
+ '#title' => $this->t('Allow multiple values'),
+ '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3. Due to the number of JOINs it would require, AND will be treated as OR with this filter.'),
'#default_value' => !empty($this->options['break_phrase']),
);
@@ -118,7 +118,7 @@ function title() {
return String::checkPlain($term->getName());
}
// TODO review text
- return t('No name');
+ return $this->t('No name');
}
}
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument/Taxonomy.php
@@ -31,7 +31,7 @@ function title() {
}
}
// TODO review text
- return t('No name');
+ return $this->t('No name');
}
}
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument/VocabularyVid.php
@@ -28,7 +28,7 @@ function title() {
return String::checkPlain($vocabulary->label());
}
- return t('No vocabulary');
+ return $this->t('No vocabulary');
}
}
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
@@ -59,18 +59,18 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['term_page'] = array(
'#type' => 'checkbox',
- '#title' => t('Load default filter from term page'),
+ '#title' => $this->t('Load default filter from term page'),
'#default_value' => $this->options['term_page'],
);
$form['node'] = array(
'#type' => 'checkbox',
- '#title' => t('Load default filter from node page, that\'s good for related taxonomy blocks'),
+ '#title' => $this->t('Load default filter from node page, that\'s good for related taxonomy blocks'),
'#default_value' => $this->options['node'],
);
$form['limit'] = array(
'#type' => 'checkbox',
- '#title' => t('Limit terms by vocabulary'),
+ '#title' => $this->t('Limit terms by vocabulary'),
'#default_value' => $this->options['limit'],
'#states' => array(
'visible' => array(
@@ -87,7 +87,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['vids'] = array(
'#type' => 'checkboxes',
- '#title' => t('Vocabularies'),
+ '#title' => $this->t('Vocabularies'),
'#options' => $options,
'#default_value' => $this->options['vids'],
'#states' => array(
@@ -100,11 +100,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['anyall'] = array(
'#type' => 'radios',
- '#title' => t('Multiple-value handling'),
+ '#title' => $this->t('Multiple-value handling'),
'#default_value' => $this->options['anyall'],
'#options' => array(
- ',' => t('Filter to items that share all terms'),
- '+' => t('Filter to items that share any term'),
+ ',' => $this->t('Filter to items that share all terms'),
+ '+' => $this->t('Filter to items that share any term'),
),
'#states' => array(
'visible' => array(
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_validator/TermName.php
@@ -59,7 +59,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['transform'] = array(
'#type' => 'checkbox',
- '#title' => t('Transform dashes in URL to spaces in term name filter values'),
+ '#title' => $this->t('Transform dashes in URL to spaces in term name filter values'),
'#default_value' => $this->options['transform'],
);
}
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
+++ b/core/modules/taxonomy/src/Plugin/views/field/LinkEdit.php
@@ -43,7 +43,7 @@ protected function defineOptions() {
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['text'] = array(
'#type' => 'textfield',
- '#title' => t('Text to display'),
+ '#title' => $this->t('Text to display'),
'#default_value' => $this->options['text'],
);
parent::buildOptionsForm($form, $form_state);
@@ -67,7 +67,7 @@ public function render(ResultRow $values) {
'vid' => $values->{$this->aliases['vid']},
));
if ($term->access('update')) {
- $text = !empty($this->options['text']) ? $this->options['text'] : t('Edit');
+ $text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Edit');
return l($text, 'taxonomy/term/'. $tid . '/edit', array('query' => drupal_get_destination()));
}
}
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/field/Taxonomy.php
+++ b/core/modules/taxonomy/src/Plugin/views/field/Taxonomy.php
@@ -51,14 +51,14 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_taxonomy'] = array(
- '#title' => t('Link this field to its taxonomy term page'),
- '#description' => t("Enable to override this field's links."),
+ '#title' => $this->t('Link this field to its taxonomy term page'),
+ '#description' => $this->t("Enable to override this field's links."),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_taxonomy']),
);
$form['convert_spaces'] = array(
- '#title' => t('Convert spaces in term names to hyphens'),
- '#description' => t('This allows links to work with Views taxonomy term arguments.'),
+ '#title' => $this->t('Convert spaces in term names to hyphens'),
+ '#description' => $this->t('This allows links to work with Views taxonomy term arguments.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['convert_spaces']),
);
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php
@@ -52,14 +52,14 @@ protected function defineOptions() {
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['link_to_taxonomy'] = array(
- '#title' => t('Link this field to its term page'),
+ '#title' => $this->t('Link this field to its term page'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_taxonomy']),
);
$form['limit'] = array(
'#type' => 'checkbox',
- '#title' => t('Limit terms by vocabulary'),
+ '#title' => $this->t('Limit terms by vocabulary'),
'#default_value' => $this->options['limit'],
);
@@ -71,7 +71,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['vids'] = array(
'#type' => 'checkboxes',
- '#title' => t('Vocabularies'),
+ '#title' => $this->t('Vocabularies'),
'#options' => $options,
'#default_value' => $this->options['vids'],
'#states' => array(
@@ -130,10 +130,10 @@ function render_item($count, $item) {
}
protected function documentSelfTokens(&$tokens) {
- $tokens['[' . $this->options['id'] . '-tid' . ']'] = t('The taxonomy term ID for the term.');
- $tokens['[' . $this->options['id'] . '-name' . ']'] = t('The taxonomy term name for the term.');
- $tokens['[' . $this->options['id'] . '-vocabulary-vid' . ']'] = t('The machine name for the vocabulary the term belongs to.');
- $tokens['[' . $this->options['id'] . '-vocabulary' . ']'] = t('The name for the vocabulary the term belongs to.');
+ $tokens['[' . $this->options['id'] . '-tid' . ']'] = $this->t('The taxonomy term ID for the term.');
+ $tokens['[' . $this->options['id'] . '-name' . ']'] = $this->t('The taxonomy term name for the term.');
+ $tokens['[' . $this->options['id'] . '-vocabulary-vid' . ']'] = $this->t('The machine name for the vocabulary the term belongs to.');
+ $tokens['[' . $this->options['id'] . '-vocabulary' . ']'] = $this->t('The name for the vocabulary the term belongs to.');
}
protected function addSelfTokens(&$tokens, $item) {
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -71,9 +71,9 @@ public function buildExtraOptionsForm(&$form, FormStateInterface $form_state) {
if (empty($this->definition['vocabulary'])) {
$form['vid'] = array(
'#type' => 'radios',
- '#title' => t('Vocabulary'),
+ '#title' => $this->t('Vocabulary'),
'#options' => $options,
- '#description' => t('Select which vocabulary to show terms for in the regular options.'),
+ '#description' => $this->t('Select which vocabulary to show terms for in the regular options.'),
'#default_value' => $this->options['vid'],
);
}
@@ -81,14 +81,14 @@ public function buildExtraOptionsForm(&$form, FormStateInterface $form_state) {
$form['type'] = array(
'#type' => 'radios',
- '#title' => t('Selection type'),
- '#options' => array('select' => t('Dropdown'), 'textfield' => t('Autocomplete')),
+ '#title' => $this->t('Selection type'),
+ '#options' => array('select' => $this->t('Dropdown'), 'textfield' => $this->t('Autocomplete')),
'#default_value' => $this->options['type'],
);
$form['hierarchy'] = array(
'#type' => 'checkbox',
- '#title' => t('Show hierarchy in dropdown'),
+ '#title' => $this->t('Show hierarchy in dropdown'),
'#default_value' => !empty($this->options['hierarchy']),
'#states' => array(
'visible' => array(
@@ -102,7 +102,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) {
$vocabulary = entity_load('taxonomy_vocabulary', $this->options['vid']);
if (empty($vocabulary) && $this->options['limit']) {
$form['markup'] = array(
- '#markup' => '
' . t('The following tokens are available. 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.') . '
', + '#markup' => '' . $this->t('The following tokens are available. 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])) { only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/area/View.php +++ b/core/modules/views/src/Plugin/views/area/View.php @@ -84,21 +84,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $view_display = $this->view->storage->id() . ':' . $this->view->current_display; - $options = array('' => t('-Select-')); + $options = array('' => $this->t('-Select-')); $options += Views::getViewsAsOptions(FALSE, 'all', $view_display, FALSE, TRUE); $form['view_to_insert'] = array( '#type' => 'select', - '#title' => t('View to insert'), + '#title' => $this->t('View to insert'), '#default_value' => $this->options['view_to_insert'], - '#description' => t('The view to insert into this area.'), + '#description' => $this->t('The view to insert into this area.'), '#options' => $options, ); $form['inherit_arguments'] = array( '#type' => 'checkbox', - '#title' => t('Inherit contextual filters'), + '#title' => $this->t('Inherit contextual filters'), '#default_value' => $this->options['inherit_arguments'], - '#description' => t('If checked, this view will receive the same contextual filters as its parent.'), + '#description' => $this->t('If checked, this view will receive the same contextual filters as its parent.'), ); } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php @@ -47,7 +47,7 @@ * - empty field name: For arguments that can have no value, such as taxonomy * which can have "no term", this is the string which * will be displayed for this lack of value. Be sure to use - * t(). + * $this->t(). * - validate type: A little used string to allow an argument to restrict * which validator is available to just one. Use the * validator ID. This probably should not be used at all, @@ -176,7 +176,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { '#markup' => '', ); $form['default_action'] = array( - '#title' => t('Default actions'), + '#title' => $this->t('Default actions'), '#title_display' => 'invisible', '#type' => 'radios', '#process' => array(array($this, 'processContainerRadios')), @@ -186,28 +186,28 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['exception'] = array( '#type' => 'details', - '#title' => t('Exceptions'), + '#title' => $this->t('Exceptions'), '#fieldset' => 'no_argument', ); $form['exception']['value'] = array( '#type' => 'textfield', - '#title' => t('Exception value'), + '#title' => $this->t('Exception value'), '#size' => 20, '#default_value' => $this->options['exception']['value'], - '#description' => t('If this value is received, the filter will be ignored; i.e, "all values"'), + '#description' => $this->t('If this value is received, the filter will be ignored; i.e, "all values"'), ); $form['exception']['title_enable'] = array( '#type' => 'checkbox', - '#title' => t('Override title'), + '#title' => $this->t('Override title'), '#default_value' => $this->options['exception']['title_enable'], ); $form['exception']['title'] = array( '#type' => 'textfield', - '#title' => t('Override title'), + '#title' => $this->t('Override title'), '#title_display' => 'invisible', '#size' => 20, '#default_value' => $this->options['exception']['title'], - '#description' => t('Override the view and other argument titles. Use "%1" for the first argument, "%2" for the second, etc.'), + '#description' => $this->t('Override the view and other argument titles. Use "%1" for the first argument, "%2" for the second, etc.'), '#states' => array( 'visible' => array( ':input[name="options[exception][title_enable]"]' => array('checked' => TRUE), @@ -236,16 +236,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); $form['title_enable'] = array( '#type' => 'checkbox', - '#title' => t('Override title'), + '#title' => $this->t('Override title'), '#default_value' => $this->options['title_enable'], '#fieldset' => 'argument_present', ); $form['title'] = array( '#type' => 'textfield', - '#title' => t('Provide title'), + '#title' => $this->t('Provide title'), '#title_display' => 'invisible', '#default_value' => $this->options['title'], - '#description' => t('Override the view and other argument titles. Use "%1" for the first argument, "%2" for the second, etc.'), + '#description' => $this->t('Override the view and other argument titles. Use "%1" for the first argument, "%2" for the second, etc.'), '#states' => array( 'visible' => array( ':input[name="options[title_enable]"]' => array('checked' => TRUE), @@ -256,7 +256,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['specify_validation'] = array( '#type' => 'checkbox', - '#title' => t('Specify validation criteria'), + '#title' => $this->t('Specify validation criteria'), '#default_value' => $this->options['specify_validation'], '#fieldset' => 'argument_present', ); @@ -269,7 +269,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { // and reverted on submission. $form['validate']['type'] = array( '#type' => 'select', - '#title' => t('Validator'), + '#title' => $this->t('Validator'), '#default_value' => static::encodeValidatorId($this->options['validate']['type']), '#states' => array( 'visible' => array( @@ -332,7 +332,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['validate']['fail'] = array( '#type' => 'select', - '#title' => t('Action to take if filter value does not validate'), + '#title' => $this->t('Action to take if filter value does not validate'), '#default_value' => $this->options['validate']['fail'], '#options' => $validate_options, '#states' => array( @@ -426,39 +426,39 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) { protected function defaultActions($which = NULL) { $defaults = array( 'ignore' => array( - 'title' => t('Display all results for the specified field'), + 'title' => $this->t('Display all results for the specified field'), 'method' => 'defaultIgnore', ), 'default' => array( - 'title' => t('Provide default value'), + 'title' => $this->t('Provide default value'), 'method' => 'defaultDefault', 'form method' => 'defaultArgumentForm', 'has default argument' => TRUE, 'default only' => TRUE, // this can only be used for missing argument, not validation failure ), 'not found' => array( - 'title' => t('Hide view'), + 'title' => $this->t('Hide view'), 'method' => 'defaultNotFound', 'hard fail' => TRUE, // This is a hard fail condition ), 'summary' => array( - 'title' => t('Display a summary'), + 'title' => $this->t('Display a summary'), 'method' => 'defaultSummary', 'form method' => 'defaultSummaryForm', 'style plugin' => TRUE, ), 'empty' => array( - 'title' => t('Display contents of "No results found"'), + 'title' => $this->t('Display contents of "No results found"'), 'method' => 'defaultEmpty', ), 'access denied' => array( - 'title' => t('Display "Access Denied"'), + 'title' => $this->t('Display "Access Denied"'), 'method' => 'defaultAccessDenied', ), ); if ($this->view->display_handler->hasPath()) { - $defaults['not found']['title'] = t('Show "Page not found"'); + $defaults['not found']['title'] = $this->t('Show "Page not found"'); } if ($which) { @@ -481,9 +481,9 @@ public function defaultArgumentForm(&$form, FormStateInterface $form_state) { $form['default_argument_skip_url'] = array( '#type' => 'checkbox', - '#title' => t('Skip default argument for view URL'), + '#title' => $this->t('Skip default argument for view URL'), '#default_value' => $this->options['default_argument_skip_url'], - '#description' => t('Select whether to include this default argument when constructing the URL for this view. Skipping default arguments is useful e.g. in the case of feeds.') + '#description' => $this->t('Select whether to include this default argument when constructing the URL for this view. Skipping default arguments is useful e.g. in the case of feeds.') ); $form['default_argument_type'] = array( @@ -491,7 +491,7 @@ public function defaultArgumentForm(&$form, FormStateInterface $form_state) { '#suffix' => '', '#type' => 'select', '#id' => 'edit-options-default-argument-type', - '#title' => t('Type'), + '#title' => $this->t('Type'), '#default_value' => $this->options['default_argument_type'], '#states' => array( 'visible' => array( @@ -558,8 +558,8 @@ public function defaultSummaryForm(&$form, FormStateInterface $form_state) { ); $form['summary']['sort_order'] = array( '#type' => 'radios', - '#title' => t('Sort order'), - '#options' => array('asc' => t('Ascending'), 'desc' => t('Descending')), + '#title' => $this->t('Sort order'), + '#options' => array('asc' => $this->t('Ascending'), 'desc' => $this->t('Descending')), '#default_value' => $this->options['summary']['sort_order'], '#states' => array( 'visible' => array( @@ -569,11 +569,11 @@ public function defaultSummaryForm(&$form, FormStateInterface $form_state) { ); $form['summary']['number_of_records'] = array( '#type' => 'radios', - '#title' => t('Sort by'), + '#title' => $this->t('Sort by'), '#default_value' => $this->options['summary']['number_of_records'], '#options' => array( 0 => $this->getSortName(), - 1 => t('Number of records') + 1 => $this->t('Number of records') ), '#states' => array( 'visible' => array( @@ -584,7 +584,7 @@ public function defaultSummaryForm(&$form, FormStateInterface $form_state) { $form['summary']['format'] = array( '#type' => 'radios', - '#title' => t('Format'), + '#title' => $this->t('Format'), '#options' => $format_options, '#default_value' => $this->options['summary']['format'], '#states' => array( @@ -1054,7 +1054,7 @@ public function getPlugin($type = 'argument_default', $name = NULL) { * their argument is (e.g. alphabetical, numeric, date). */ public function getSortName() { - return t('Default sort', array(), array('context' => 'Sort order')); + return $this->t('Default sort', array(), array('context' => 'Sort order')); } /** only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/GroupByNumeric.php +++ b/core/modules/views/src/Plugin/views/argument/GroupByNumeric.php @@ -32,7 +32,7 @@ public function adminLabel($short = FALSE) { * {@inheritdoc} */ public function getSortName() { - return t('Numerical', array(), array('context' => 'Sort order')); + return $this->t('Numerical', array(), array('context' => 'Sort order')); } } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/LanguageArgument.php +++ b/core/modules/views/src/Plugin/views/argument/LanguageArgument.php @@ -47,7 +47,7 @@ function title() { */ function language($langcode) { $languages = $this->listLanguages(); - return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language'); + return isset($languages[$langcode]) ? $languages[$langcode] : $this->t('Unknown language'); } } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/ManyToOne.php +++ b/core/modules/views/src/Plugin/views/argument/ManyToOne.php @@ -69,23 +69,23 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { // allow + for or, , for and $form['break_phrase'] = array( '#type' => 'checkbox', - '#title' => t('Allow multiple values'), - '#description' => t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), + '#title' => $this->t('Allow multiple values'), + '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), '#fieldset' => 'more', ); $form['add_table'] = array( '#type' => 'checkbox', - '#title' => t('Allow multiple filter values to work together'), - '#description' => t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), + '#title' => $this->t('Allow multiple filter values to work together'), + '#description' => $this->t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), '#default_value' => !empty($this->options['add_table']), '#fieldset' => 'more', ); $form['require_value'] = array( '#type' => 'checkbox', - '#title' => t('Do not display items with no value in summary'), + '#title' => $this->t('Do not display items with no value in summary'), '#default_value' => !empty($this->options['require_value']), '#fieldset' => 'more', ); @@ -133,7 +133,7 @@ public function query($group_by = FALSE) { function title() { if (!$this->argument) { - return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized'); + return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : $this->t('Uncategorized'); } if (!empty($this->options['break_phrase'])) { @@ -148,11 +148,11 @@ function title() { // @todo -- both of these should check definition for alternate keywords. if (empty($this->value)) { - return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized'); + return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : $this->t('Uncategorized'); } if ($this->value === array(-1)) { - return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input'); + return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : $this->t('Invalid input'); } return implode($this->operator == 'or' ? ' + ' : ', ', $this->titleQuery()); only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/Null.php +++ b/core/modules/views/src/Plugin/views/argument/Null.php @@ -32,9 +32,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['must_not_be'] = array( '#type' => 'checkbox', - '#title' => t('Fail basic validation if any argument is given'), + '#title' => $this->t('Fail basic validation if any argument is given'), '#default_value' => !empty($this->options['must_not_be']), - '#description' => t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'), + '#description' => $this->t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'), '#fieldset' => 'more', ); only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/Numeric.php +++ b/core/modules/views/src/Plugin/views/argument/Numeric.php @@ -46,16 +46,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { // allow + for or, , for and $form['break_phrase'] = array( '#type' => 'checkbox', - '#title' => t('Allow multiple values'), - '#description' => t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), + '#title' => $this->t('Allow multiple values'), + '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), '#fieldset' => 'more', ); $form['not'] = array( '#type' => 'checkbox', - '#title' => t('Exclude'), - '#description' => t('If selected, the numbers entered for the filter will be excluded rather than limiting the view.'), + '#title' => $this->t('Exclude'), + '#description' => $this->t('If selected, the numbers entered for the filter will be excluded rather than limiting the view.'), '#default_value' => !empty($this->options['not']), '#fieldset' => 'more', ); @@ -63,7 +63,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { function title() { if (!$this->argument) { - return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized'); + return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : $this->t('Uncategorized'); } if (!empty($this->options['break_phrase'])) { @@ -77,11 +77,11 @@ function title() { } if (empty($this->value)) { - return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized'); + return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : $this->t('Uncategorized'); } if ($this->value === array(-1)) { - return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input'); + return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : $this->t('Invalid input'); } return implode($this->operator == 'or' ? ' + ' : ', ', $this->titleQuery()); @@ -125,7 +125,7 @@ public function query($group_by = FALSE) { * {@inheritdoc} */ public function getSortName() { - return t('Numerical', array(), array('context' => 'Sort order')); + return $this->t('Numerical', array(), array('context' => 'Sort order')); } } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/String.php +++ b/core/modules/views/src/Plugin/views/argument/String.php @@ -60,16 +60,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['glossary'] = array( '#type' => 'checkbox', - '#title' => t('Glossary mode'), - '#description' => t('Glossary mode applies a limit to the number of characters used in the filter value, which allows the summary view to act as a glossary.'), + '#title' => $this->t('Glossary mode'), + '#description' => $this->t('Glossary mode applies a limit to the number of characters used in the filter value, which allows the summary view to act as a glossary.'), '#default_value' => $this->options['glossary'], '#fieldset' => 'more', ); $form['limit'] = array( '#type' => 'textfield', - '#title' => t('Character limit'), - '#description' => t('How many characters of the filter value to filter against. If set to 1, all fields starting with the first letter in the filter value would be matched.'), + '#title' => $this->t('Character limit'), + '#description' => $this->t('How many characters of the filter value to filter against. If set to 1, all fields starting with the first letter in the filter value would be matched.'), '#default_value' => $this->options['limit'], '#states' => array( 'visible' => array( @@ -81,14 +81,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['case'] = array( '#type' => 'select', - '#title' => t('Case'), - '#description' => t('When printing the title and summary, how to transform the case of the filter value.'), + '#title' => $this->t('Case'), + '#description' => $this->t('When printing the title and summary, how to transform the case of the filter value.'), '#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['case'], '#fieldset' => 'more', @@ -96,14 +96,14 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['path_case'] = array( '#type' => 'select', - '#title' => t('Case in path'), - '#description' => t('When printing url paths, how to transform the case of the filter value. Do not use this unless with Postgres as it uses case sensitive comparisons.'), + '#title' => $this->t('Case in path'), + '#description' => $this->t('When printing url paths, how to transform the case of the filter value. Do not use this unless with Postgres as it uses case sensitive comparisons.'), '#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['path_case'], '#fieldset' => 'more', @@ -111,7 +111,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['transform_dash'] = array( '#type' => 'checkbox', - '#title' => t('Transform spaces to dashes in URL'), + '#title' => $this->t('Transform spaces to dashes in URL'), '#default_value' => $this->options['transform_dash'], '#fieldset' => 'more', ); @@ -119,15 +119,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { if (!empty($this->definition['many to one'])) { $form['add_table'] = array( '#type' => 'checkbox', - '#title' => t('Allow multiple filter values to work together'), - '#description' => t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), + '#title' => $this->t('Allow multiple filter values to work together'), + '#description' => $this->t('If selected, multiple instances of this filter can work together, as though multiple values were supplied to the same filter. This setting is not compatible with the "Reduce duplicates" setting.'), '#default_value' => !empty($this->options['add_table']), '#fieldset' => 'more', ); $form['require_value'] = array( '#type' => 'checkbox', - '#title' => t('Do not display items with no value in summary'), + '#title' => $this->t('Do not display items with no value in summary'), '#default_value' => !empty($this->options['require_value']), '#fieldset' => 'more', ); @@ -136,8 +136,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { // allow + for or, , for and $form['break_phrase'] = array( '#type' => 'checkbox', - '#title' => t('Allow multiple values'), - '#description' => t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), + '#title' => $this->t('Allow multiple values'), + '#description' => $this->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'), '#default_value' => !empty($this->options['break_phrase']), '#fieldset' => 'more', ); @@ -253,7 +253,7 @@ public function summaryArgument($data) { * {@inheritdoc} */ public function getSortName() { - return t('Alphabetical', array(), array('context' => 'Sort order')); + return $this->t('Alphabetical', array(), array('context' => 'Sort order')); } function title() { @@ -271,11 +271,11 @@ function title() { } if (empty($this->value)) { - return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized'); + return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : $this->t('Uncategorized'); } if ($this->value === array(-1)) { - return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input'); + return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : $this->t('Invalid input'); } return implode($this->operator == 'or' ? ' + ' : ', ', $this->titleQuery()); only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument/WeekDate.php +++ b/core/modules/views/src/Plugin/views/argument/WeekDate.php @@ -24,7 +24,7 @@ class WeekDate extends Date { */ public function summaryName($data) { $created = $data->{$this->name_alias}; - return t('Week @week', array('@week' => $created)); + return $this->t('Week @week', array('@week' => $created)); } } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument_default/ArgumentDefaultPluginBase.php @@ -98,7 +98,7 @@ protected function checkAccess(&$form, $option_name) { if (!$this->access()) { $form[$option_name]['#disabled'] = TRUE; $form[$option_name]['#value'] = $form[$this->option_name]['#default_value']; - $form[$option_name]['#description'] .= ' ' . t('Note: you do not have permission to modify this. If you change the default filter type, this setting will be lost and you will NOT be able to get it back.') . ''; + $form[$option_name]['#description'] .= ' ' . $this->t('Note: you do not have permission to modify this. If you change the default filter type, this setting will be lost and you will NOT be able to get it back.') . ''; } } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument_default/Fixed.php +++ b/core/modules/views/src/Plugin/views/argument_default/Fixed.php @@ -32,7 +32,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['argument'] = array( '#type' => 'textfield', - '#title' => t('Fixed value'), + '#title' => $this->t('Fixed value'), '#default_value' => $this->options['argument'], ); } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument_default/Raw.php +++ b/core/modules/views/src/Plugin/views/argument_default/Raw.php @@ -73,19 +73,19 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['index'] = array( '#type' => 'select', - '#title' => t('Path component'), + '#title' => $this->t('Path component'), '#default_value' => $this->options['index'], // range(1, 10) returns an array with: // - keys that count from 0 to match PHP array keys from explode(). // - values that count from 1 for display to humans. '#options' => range(1, 10), - '#description' => t('The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".'), + '#description' => $this->t('The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".'), ); $form['use_alias'] = array( '#type' => 'checkbox', - '#title' => t('Use path alias'), + '#title' => $this->t('Use path alias'), '#default_value' => $this->options['use_alias'], - '#description' => t('Use path alias instead of internal path.'), + '#description' => $this->t('Use path alias instead of internal path.'), ); } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php @@ -93,7 +93,7 @@ protected function checkAccess(&$form, $option_name) { if (!$this->access()) { $form[$option_name]['#disabled'] = TRUE; $form[$option_name]['#value'] = $form[$this->option_name]['#default_value']; - $form[$option_name]['#description'] .= ' ' . t('Note: you do not have permission to modify this. If you change the default filter type, this setting will be lost and you will NOT be able to get it back.') . ''; + $form[$option_name]['#description'] .= ' ' . $this->t('Note: you do not have permission to modify this. If you change the default filter type, this setting will be lost and you will NOT be able to get it back.') . ''; } } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php +++ b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php @@ -96,7 +96,7 @@ public function getResultsKey() { * access control. */ public function summaryTitle() { - return t('Unknown'); + return $this->t('Unknown'); } /** only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/cache/None.php +++ b/core/modules/views/src/Plugin/views/cache/None.php @@ -24,7 +24,7 @@ public function cacheStart() { } public function summaryTitle() { - return t('None'); + return $this->t('None'); } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/cache/Tag.php +++ b/core/modules/views/src/Plugin/views/cache/Tag.php @@ -24,7 +24,7 @@ class Tag extends CachePluginBase { * {@inheritdoc} */ public function summaryTitle() { - return t('Tag'); + return $this->t('Tag'); } /** only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/cache/Time.php +++ b/core/modules/views/src/Plugin/views/cache/Time.php @@ -80,21 +80,21 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $options = array(60, 300, 1800, 3600, 21600, 518400); $options = array_map(array($this->dateFormatter, 'formatInterval'), array_combine($options, $options)); - $options = array(-1 => t('Never cache')) + $options + array('custom' => t('Custom')); + $options = array(-1 => $this->t('Never cache')) + $options + array('custom' => $this->t('Custom')); $form['results_lifespan'] = array( '#type' => 'select', - '#title' => t('Query results'), - '#description' => t('The length of time raw query results should be cached.'), + '#title' => $this->t('Query results'), + '#description' => $this->t('The length of time raw query results should be cached.'), '#options' => $options, '#default_value' => $this->options['results_lifespan'], ); $form['results_lifespan_custom'] = array( '#type' => 'textfield', - '#title' => t('Seconds'), + '#title' => $this->t('Seconds'), '#size' => '25', '#maxlength' => '30', - '#description' => t('Length of time in seconds raw query results should be cached.'), + '#description' => $this->t('Length of time in seconds raw query results should be cached.'), '#default_value' => $this->options['results_lifespan_custom'], '#states' => array( 'visible' => array( @@ -104,17 +104,17 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); $form['output_lifespan'] = array( '#type' => 'select', - '#title' => t('Rendered output'), - '#description' => t('The length of time rendered HTML output should be cached.'), + '#title' => $this->t('Rendered output'), + '#description' => $this->t('The length of time rendered HTML output should be cached.'), '#options' => $options, '#default_value' => $this->options['output_lifespan'], ); $form['output_lifespan_custom'] = array( '#type' => 'textfield', - '#title' => t('Seconds'), + '#title' => $this->t('Seconds'), '#size' => '25', '#maxlength' => '30', - '#description' => t('Length of time in seconds rendered HTML output should be cached.'), + '#description' => $this->t('Length of time in seconds rendered HTML output should be cached.'), '#default_value' => $this->options['output_lifespan_custom'], '#states' => array( 'visible' => array( @@ -129,7 +129,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) { foreach ($custom_fields as $field) { $cache_options = $form_state->getValue('cache_options'); if ($cache_options[$field] == 'custom' && !is_numeric($cache_options[$field . '_custom'])) { - $form_state->setError($form[$field .'_custom'], t('Custom time values must be numeric.')); + $form_state->setError($form[$field .'_custom'], $this->t('Custom time values must be numeric.')); } } } only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/display/Attachment.php +++ b/core/modules/views/src/Plugin/views/display/Attachment.php @@ -56,9 +56,9 @@ public function execute() { public function attachmentPositions($position = NULL) { $positions = array( - 'before' => t('Before'), - 'after' => t('After'), - 'both' => t('Both'), + 'before' => $this->t('Before'), + 'after' => $this->t('After'), + 'both' => $this->t('Both'), ); if ($position) { @@ -78,7 +78,7 @@ public function optionsSummary(&$categories, &$options) { parent::optionsSummary($categories, $options); $categories['attachment'] = array( - 'title' => t('Attachment settings'), + 'title' => $this->t('Attachment settings'), 'column' => 'second', 'build' => array( '#weight' => -10, @@ -87,7 +87,7 @@ public function optionsSummary(&$categories, &$options) { $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); @@ -97,43 +97,43 @@ public function optionsSummary(&$categories, &$options) { } if (!isset($attach_to)) { - $attach_to = t('Not defined'); + $attach_to = $this->t('Not defined'); } $options['displays'] = array( 'category' => 'attachment', - 'title' => t('Attach to'), + 'title' => $this->t('Attach to'), 'value' => $attach_to, ); $options['attachment_position'] = array( 'category' => 'attachment', - 'title' => t('Attachment position'), + 'title' => $this->t('Attachment position'), 'value' => $this->attachmentPositions($this->getOption('attachment_position')), ); $options['inherit_arguments'] = array( 'category' => 'attachment', - 'title' => t('Inherit contextual filters'), - 'value' => $this->getOption('inherit_arguments') ? t('Yes') : t('No'), + 'title' => $this->t('Inherit contextual filters'), + 'value' => $this->getOption('inherit_arguments') ? $this->t('Yes') : $this->t('No'), ); $options['inherit_exposed_filters'] = array( 'category' => 'attachment', - 'title' => t('Inherit exposed filters'), - 'value' => $this->getOption('inherit_exposed_filters') ? t('Yes') : t('No'), + 'title' => $this->t('Inherit exposed filters'), + 'value' => $this->getOption('inherit_exposed_filters') ? $this->t('Yes') : $this->t('No'), ); $options['inherit_pager'] = array( 'category' => 'pager', - 'title' => t('Inherit pager'), - 'value' => $this->getOption('inherit_pager') ? t('Yes') : t('No'), + 'title' => $this->t('Inherit pager'), + 'value' => $this->getOption('inherit_pager') ? $this->t('Yes') : $this->t('No'), ); $options['render_pager'] = array( 'category' => 'pager', - 'title' => t('Render pager'), - 'value' => $this->getOption('render_pager') ? t('Yes') : t('No'), + 'title' => $this->t('Render pager'), + 'value' => $this->getOption('render_pager') ? $this->t('Yes') : $this->t('No'), ); } @@ -147,53 +147,53 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { switch ($form_state->get('section')) { case 'inherit_arguments': - $form['#title'] .= t('Inherit contextual filters'); + $form['#title'] .= $this->t('Inherit contextual filters'); $form['inherit_arguments'] = array( '#type' => 'checkbox', - '#title' => t('Inherit'), - '#description' => t('Should this display inherit its contextual filter values from the parent display to which it is attached?'), + '#title' => $this->t('Inherit'), + '#description' => $this->t('Should this display inherit its contextual filter values from the parent display to which it is attached?'), '#default_value' => $this->getOption('inherit_arguments'), ); break; case 'inherit_exposed_filters': - $form['#title'] .= t('Inherit exposed filters'); + $form['#title'] .= $this->t('Inherit exposed filters'); $form['inherit_exposed_filters'] = array( '#type' => 'checkbox', - '#title' => t('Inherit'), - '#description' => t('Should this display inherit its exposed filter values from the parent display to which it is attached?'), + '#title' => $this->t('Inherit'), + '#description' => $this->t('Should this display inherit its exposed filter values from the parent display to which it is attached?'), '#default_value' => $this->getOption('inherit_exposed_filters'), ); break; case 'inherit_pager': - $form['#title'] .= t('Inherit pager'); + $form['#title'] .= $this->t('Inherit pager'); $form['inherit_pager'] = array( '#type' => 'checkbox', - '#title' => t('Inherit'), - '#description' => t('Should this display inherit its paging values from the parent display to which it is attached?'), + '#title' => $this->t('Inherit'), + '#description' => $this->t('Should this display inherit its paging values from the parent display to which it is attached?'), '#default_value' => $this->getOption('inherit_pager'), ); break; case 'render_pager': - $form['#title'] .= t('Render pager'); + $form['#title'] .= $this->t('Render pager'); $form['render_pager'] = array( '#type' => 'checkbox', - '#title' => t('Render'), - '#description' => t('Should this display render the pager values? This is only meaningful if inheriting a pager.'), + '#title' => $this->t('Render'), + '#description' => $this->t('Should this display render the pager values? This is only meaningful if inheriting a pager.'), '#default_value' => $this->getOption('render_pager'), ); break; case 'attachment_position': - $form['#title'] .= t('Position'); + $form['#title'] .= $this->t('Position'); $form['attachment_position'] = array( - '#title' => t('Position'), + '#title' => $this->t('Position'), '#type' => 'radios', - '#description' => t('Attach before or after the parent display?'), + '#description' => $this->t('Attach before or after the parent display?'), '#options' => $this->attachmentPositions(), '#default_value' => $this->getOption('attachment_position'), ); 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) { if ($this->view->displayHandlers->has($display_id) && $this->view->displayHandlers->get($display_id)->acceptAttachments()) { @@ -201,9 +201,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { } } $form['displays'] = array( - '#title' => t('Displays'), + '#title' => $this->t('Displays'), '#type' => 'checkboxes', - '#description' => t('Select which display or displays this should attach to.'), + '#description' => $this->t('Select which display or displays this should attach to.'), '#options' => $displays, '#default_value' => $this->getOption('displays'), ); only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/display/Block.php +++ b/core/modules/views/src/Plugin/views/display/Block.php @@ -96,7 +96,7 @@ public function optionsSummary(&$categories, &$options) { parent::optionsSummary($categories, $options); $categories['block'] = array( - 'title' => t('Block settings'), + 'title' => $this->t('Block settings'), 'column' => 'second', 'build' => array( '#weight' => -10, @@ -105,18 +105,18 @@ public function optionsSummary(&$categories, &$options) { $block_description = strip_tags($this->getOption('block_description')); if (empty($block_description)) { - $block_description = t('None'); + $block_description = $this->t('None'); } $block_category = String::checkPlain($this->getOption('block_category')); $options['block_description'] = array( 'category' => 'block', - 'title' => t('Block name'), + 'title' => $this->t('Block name'), 'value' => views_ui_truncate($block_description, 24), ); $options['block_category'] = array( 'category' => 'block', - 'title' => t('Block category'), + 'title' => $this->t('Block category'), 'value' => views_ui_truncate($block_category, 24), ); @@ -124,14 +124,14 @@ public function optionsSummary(&$categories, &$options) { $options['allow'] = array( 'category' => 'block', - 'title' => t('Allow settings'), - 'value' => empty($filtered_allow) ? t('None') : t('Items per page'), + 'title' => $this->t('Allow settings'), + 'value' => empty($filtered_allow) ? $this->t('None') : $this->t('Items per page'), ); $options['block_hide_empty'] = array( 'category' => 'other', - 'title' => t('Hide block if the view output is empty'), - 'value' => $this->getOption('block_hide_empty') ? t('Hide') : t('Show'), + 'title' => $this->t('Hide block if the view output is empty'), + 'value' => $this->getOption('block_hide_empty') ? $this->t('Hide') : $this->t('Show'), ); } @@ -143,29 +143,29 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { switch ($form_state->get('section')) { case 'block_description': - $form['#title'] .= t('Block admin description'); + $form['#title'] .= $this->t('Block admin description'); $form['block_description'] = array( '#type' => 'textfield', - '#description' => t('This will appear as the name of this block in administer >> structure >> blocks.'), + '#description' => $this->t('This will appear as the name of this block in administer >> structure >> blocks.'), '#default_value' => $this->getOption('block_description'), ); break; case 'block_category': - $form['#title'] .= t('Block category'); + $form['#title'] .= $this->t('Block category'); $form['block_category'] = array( '#type' => 'textfield', '#autocomplete_route_name' => 'block.category_autocomplete', - '#description' => t('The category this block will appear under on the blocks placement page.', array('@href' => url('admin/structure/block'))), + '#description' => $this->t('The category this block will appear under on the blocks placement page.', array('@href' => url('admin/structure/block'))), '#default_value' => $this->getOption('block_category'), ); break; case 'block_hide_empty': - $form['#title'] .= t('Block empty settings'); + $form['#title'] .= $this->t('Block empty settings'); $form['block_hide_empty'] = array( - '#title' => t('Hide block if no result/empty text'), + '#title' => $this->t('Hide block if no result/empty text'), '#type' => 'checkbox', - '#description' => t('Hide the block if there is no result and no empty text and no header/footer which is shown on empty result'), + '#description' => $this->t('Hide the block if there is no result and no empty text and no header/footer which is shown on empty result'), '#default_value' => $this->getOption('block_hide_empty'), ); break; @@ -174,15 +174,15 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { if (!$this->usesExposed() && parent::usesExposed()) { $form['exposed_form_options']['warning'] = array( '#weight' => -10, - '#markup' => ' ', + '#markup' => ' ', ); } break; case 'allow': - $form['#title'] .= t('Allow settings in the block configuration'); + $form['#title'] .= $this->t('Allow settings in the block configuration'); $options = array( - 'items_per_page' => t('Items per page'), + 'items_per_page' => $this->t('Items per page'), ); $allow = array_filter($this->getOption('allow')); @@ -242,9 +242,9 @@ public function blockForm(ViewsBlock $block, array &$form, FormStateInterface $f case 'items_per_page': $form['override']['items_per_page'] = array( '#type' => 'select', - '#title' => t('Items per block'), + '#title' => $this->t('Items per block'), '#options' => array( - 'none' => t('@count (default setting)', array('@count' => $this->getPlugin('pager')->getItemsPerPage())), + 'none' => $this->t('@count (default setting)', array('@count' => $this->getPlugin('pager')->getItemsPerPage())), 5 => 5, 10 => 10, 20 => 20, only in patch2: unchanged: --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -1027,7 +1027,7 @@ public function optionLink($text, $section, $class = '', $title = '') { } if (!trim($text)) { - $text = t('Broken field'); + $text = $this->t('Broken field'); } if (empty($title)) { @@ -1072,27 +1072,27 @@ public function getArgumentsTokens() { public function optionsSummary(&$categories, &$options) { $categories = array( 'title' => array( - 'title' => t('Title'), + 'title' => $this->t('Title'), 'column' => 'first', ), 'format' => array( - 'title' => t('Format'), + 'title' => $this->t('Format'), 'column' => 'first', ), 'filters' => array( - 'title' => t('Filters'), + 'title' => $this->t('Filters'), 'column' => 'first', ), 'fields' => array( - 'title' => t('Fields'), + 'title' => $this->t('Fields'), 'column' => 'first', ), 'pager' => array( - 'title' => t('Pager'), + 'title' => $this->t('Pager'), 'column' => 'second', ), 'exposed' => array( - 'title' => t('Exposed form'), + 'title' => $this->t('Exposed form'), 'column' => 'third', 'build' => array( '#weight' => 1, @@ -1106,7 +1106,7 @@ public function optionsSummary(&$categories, &$options) { ), ), 'other' => array( - 'title' => t('Other'), + 'title' => $this->t('Other'), 'column' => 'third', 'build' => array( '#weight' => 2, @@ -1117,88 +1117,88 @@ public function optionsSummary(&$categories, &$options) { if ($this->display['id'] != 'default') { $options['display_id'] = array( 'category' => 'other', - 'title' => t('Machine Name'), + 'title' => $this->t('Machine Name'), 'value' => !empty($this->display['new_id']) ? String::checkPlain($this->display['new_id']) : String::checkPlain($this->display['id']), - 'desc' => t('Change the machine name of this display.'), + 'desc' => $this->t('Change the machine name of this display.'), ); } $display_comment = String::checkPlain(drupal_substr($this->getOption('display_comment'), 0, 10)); $options['display_comment'] = array( 'category' => 'other', - 'title' => t('Administrative comment'), - 'value' => !empty($display_comment) ? $display_comment : t('None'), - 'desc' => t('Comment or document this display.'), + 'title' => $this->t('Administrative comment'), + 'value' => !empty($display_comment) ? $display_comment : $this->t('None'), + 'desc' => $this->t('Comment or document this display.'), ); $title = strip_tags($this->getOption('title')); if (!$title) { - $title = t('None'); + $title = $this->t('None'); } $options['title'] = array( 'category' => 'title', - 'title' => t('Title'), + 'title' => $this->t('Title'), 'value' => views_ui_truncate($title, 32), - 'desc' => t('Change the title that this display will use.'), + 'desc' => $this->t('Change the title that this display will use.'), ); $style_plugin_instance = $this->getPlugin('style'); - $style_summary = empty($style_plugin_instance->definition['title']) ? t('Missing style plugin') : $style_plugin_instance->summaryTitle(); - $style_title = empty($style_plugin_instance->definition['title']) ? t('Missing style plugin') : $style_plugin_instance->pluginTitle(); + $style_summary = empty($style_plugin_instance->definition['title']) ? $this->t('Missing style plugin') : $style_plugin_instance->summaryTitle(); + $style_title = empty($style_plugin_instance->definition['title']) ? $this->t('Missing style plugin') : $style_plugin_instance->pluginTitle(); $options['style'] = array( 'category' => 'format', - 'title' => t('Format'), + 'title' => $this->t('Format'), 'value' => $style_title, 'setting' => $style_summary, - 'desc' => t('Change the way content is formatted.'), + 'desc' => $this->t('Change the way content is formatted.'), ); // This adds a 'Settings' link to the style_options setting if the style has options. if ($style_plugin_instance->usesOptions()) { - $options['style']['links']['style_options'] = t('Change settings for this format'); + $options['style']['links']['style_options'] = $this->t('Change settings for this format'); } if ($style_plugin_instance->usesRowPlugin()) { $row_plugin_instance = $this->getPlugin('row'); - $row_summary = empty($row_plugin_instance->definition['title']) ? t('Missing row plugin') : $row_plugin_instance->summaryTitle(); - $row_title = empty($row_plugin_instance->definition['title']) ? t('Missing row plugin') : $row_plugin_instance->pluginTitle(); + $row_summary = empty($row_plugin_instance->definition['title']) ? $this->t('Missing row plugin') : $row_plugin_instance->summaryTitle(); + $row_title = empty($row_plugin_instance->definition['title']) ? $this->t('Missing row plugin') : $row_plugin_instance->pluginTitle(); $options['row'] = array( 'category' => 'format', - 'title' => t('Show'), + 'title' => $this->t('Show'), 'value' => $row_title, 'setting' => $row_summary, - 'desc' => t('Change the way each row in the view is styled.'), + 'desc' => $this->t('Change the way each row in the view is styled.'), ); // This adds a 'Settings' link to the row_options setting if the row style has options. if ($row_plugin_instance->usesOptions()) { - $options['row']['links']['row_options'] = t('Change settings for this style'); + $options['row']['links']['row_options'] = $this->t('Change settings for this style'); } } if ($this->usesAJAX()) { $options['use_ajax'] = array( 'category' => 'other', - 'title' => t('Use AJAX'), - 'value' => $this->getOption('use_ajax') ? t('Yes') : t('No'), - 'desc' => t('Change whether or not this display will use AJAX.'), + 'title' => $this->t('Use AJAX'), + 'value' => $this->getOption('use_ajax') ? $this->t('Yes') : $this->t('No'), + 'desc' => $this->t('Change whether or not this display will use AJAX.'), ); } if ($this->usesAttachments()) { $options['hide_attachment_summary'] = array( 'category' => 'other', - 'title' => t('Hide attachments in summary'), - 'value' => $this->getOption('hide_attachment_summary') ? t('Yes') : t('No'), - 'desc' => t('Change whether or not to display attachments when displaying a contextual filter summary.'), + 'title' => $this->t('Hide attachments in summary'), + 'value' => $this->getOption('hide_attachment_summary') ? $this->t('Yes') : $this->t('No'), + 'desc' => $this->t('Change whether or not to display attachments when displaying a contextual filter summary.'), ); } if (!isset($this->definition['contextual links locations']) || !empty($this->definition['contextual links locations'])) { $options['show_admin_links'] = array( 'category' => 'other', - 'title' => t('Contextual links'), - 'value' => $this->getOption('show_admin_links') ? t('Shown') : t('Hidden'), - 'desc' => t('Change whether or not to display contextual links for this view.'), + 'title' => $this->t('Contextual links'), + 'value' => $this->getOption('show_admin_links') ? $this->t('Shown') : $this->t('Hidden'), + 'desc' => $this->t('Change whether or not to display contextual links for this view.'), ); } @@ -1212,27 +1212,27 @@ public function optionsSummary(&$categories, &$options) { $options['pager'] = array( 'category' => 'pager', - 'title' => t('Use pager'), + 'title' => $this->t('Use pager'), 'value' => $pager_plugin->pluginTitle(), 'setting' => $pager_str, - 'desc' => t("Change this display's pager setting."), + 'desc' => $this->t("Change this display's pager setting."), ); // If pagers aren't allowed, change the text of the item: if (!$this->usesPager()) { - $options['pager']['title'] = t('Items to display'); + $options['pager']['title'] = $this->t('Items to display'); } if ($pager_plugin->usesOptions()) { - $options['pager']['links']['pager_options'] = t('Change settings for this pager type.'); + $options['pager']['links']['pager_options'] = $this->t('Change settings for this pager type.'); } if ($this->usesMore()) { $options['use_more'] = array( 'category' => 'pager', - 'title' => t('More link'), - 'value' => $this->getOption('use_more') ? t('Yes') : t('No'), - 'desc' => t('Specify whether this display will provide a "more" link.'), + 'title' => $this->t('More link'), + 'value' => $this->getOption('use_more') ? $this->t('Yes') : $this->t('No'), + 'desc' => $this->t('Specify whether this display will provide a "more" link.'), ); } @@ -1240,26 +1240,26 @@ public function optionsSummary(&$categories, &$options) { if ($this->view->query->getAggregationInfo()) { $options['group_by'] = array( 'category' => 'other', - 'title' => t('Use aggregation'), - 'value' => $this->getOption('group_by') ? t('Yes') : t('No'), - 'desc' => t('Allow grouping and aggregation (calculation) of fields.'), + 'title' => $this->t('Use aggregation'), + 'value' => $this->getOption('group_by') ? $this->t('Yes') : $this->t('No'), + 'desc' => $this->t('Allow grouping and aggregation (calculation) of fields.'), ); } $options['query'] = array( 'category' => 'other', - 'title' => t('Query settings'), - 'value' => t('Settings'), - 'desc' => t('Allow to set some advanced settings for the query plugin'), + 'title' => $this->t('Query settings'), + 'value' => $this->t('Settings'), + 'desc' => $this->t('Allow to set some advanced settings for the query plugin'), ); $language_options = $this->listLanguages(LanguageInterface::STATE_ALL | LanguageInterface::STATE_SITE_DEFAULT | PluginBase::INCLUDE_NEGOTIATED); $options['field_langcode'] = array( 'category' => 'other', - 'title' => t('Field Language'), + 'title' => $this->t('Field Language'), 'value' => $language_options[$this->getOption('field_langcode')], - 'desc' => t('All fields that support translations will be displayed in the selected language.'), + 'desc' => $this->t('All fields that support translations will be displayed in the selected language.'), ); $access_plugin = $this->getPlugin('access'); @@ -1272,14 +1272,14 @@ public function optionsSummary(&$categories, &$options) { $options['access'] = array( 'category' => 'access', - 'title' => t('Access'), + 'title' => $this->t('Access'), 'value' => $access_plugin->pluginTitle(), 'setting' => $access_str, - 'desc' => t('Specify access control type for this display.'), + 'desc' => $this->t('Specify access control type for this display.'), ); if ($access_plugin->usesOptions()) { - $options['access']['links']['access_options'] = t('Change settings for this access type.'); + $options['access']['links']['access_options'] = $this->t('Change settings for this access type.'); } $cache_plugin = $this->getPlugin('cache'); @@ -1292,18 +1292,18 @@ public function optionsSummary(&$categories, &$options) { $options['cache'] = array( 'category' => 'other', - 'title' => t('Caching'), + 'title' => $this->t('Caching'), 'value' => $cache_plugin->pluginTitle(), 'setting' => $cache_str, - 'desc' => t('Specify caching type for this display.'), + 'desc' => $this->t('Specify caching type for this display.'), ); if ($cache_plugin->usesOptions()) { - $options['cache']['links']['cache_options'] = t('Change settings for this caching type.'); + $options['cache']['links']['cache_options'] = $this->t('Change settings for this caching type.'); } if ($access_plugin->usesOptions()) { - $options['access']['links']['access_options'] = t('Change settings for this access type.'); + $options['access']['links']['access_options'] = $this->t('Change settings for this access type.'); } if ($this->usesLinkDisplay()) { @@ -1323,18 +1323,18 @@ public function optionsSummary(&$categories, &$options) { $options['link_display'] = array( 'category' => 'pager', - 'title' => t('Link display'), + 'title' => $this->t('Link display'), 'value' => $link_display, - 'desc' => t('Specify which display or custom url this display will link to.'), + 'desc' => $this->t('Specify which display or custom url this display will link to.'), ); } if ($this->usesExposedFormInBlock()) { $options['exposed_block'] = array( 'category' => 'exposed', - 'title' => t('Exposed form in block'), - 'value' => $this->getOption('exposed_block') ? t('Yes') : t('No'), - 'desc' => t('Allow the exposed form to appear in a block instead of the view.'), + 'title' => $this->t('Exposed form in block'), + 'value' => $this->getOption('exposed_block') ? $this->t('Yes') : $this->t('No'), + 'desc' => $this->t('Allow the exposed form to appear in a block instead of the view.'), ); } @@ -1348,26 +1348,26 @@ public function optionsSummary(&$categories, &$options) { $options['exposed_form'] = array( 'category' => 'exposed', - 'title' => t('Exposed form style'), + 'title' => $this->t('Exposed form style'), 'value' => $exposed_form_plugin->pluginTitle(), 'setting' => $exposed_form_str, - 'desc' => t('Select the kind of exposed filter to use.'), + 'desc' => $this->t('Select the kind of exposed filter to use.'), ); if ($exposed_form_plugin->usesOptions()) { - $options['exposed_form']['links']['exposed_form_options'] = t('Exposed form settings for this exposed form style.'); + $options['exposed_form']['links']['exposed_form_options'] = $this->t('Exposed form settings for this exposed form style.'); } $css_class = String::checkPlain(trim($this->getOption('css_class'))); if (!$css_class) { - $css_class = t('None'); + $css_class = $this->t('None'); } $options['css_class'] = array( 'category' => 'other', - 'title' => t('CSS class'), + 'title' => $this->t('CSS class'), 'value' => $css_class, - 'desc' => t('Change the CSS class name(s) that will be added to this display.'), + 'desc' => $this->t('Change the CSS class name(s) that will be added to this display.'), ); foreach ($this->extender as $extender) { @@ -1399,93 +1399,93 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { switch ($section) { case 'display_id': - $form['#title'] .= t('The machine name of this display'); + $form['#title'] .= $this->t('The machine name of this display'); $form['display_id'] = array( '#type' => 'textfield', - '#title' => t('Machine name of the display'), + '#title' => $this->t('Machine name of the display'), '#default_value' => !empty($this->display['new_id']) ? $this->display['new_id'] : $this->display['id'], '#required' => TRUE, '#size' => 64, ); break; case 'display_title': - $form['#title'] .= t('The name and the description of this display'); + $form['#title'] .= $this->t('The name and the description of this display'); $form['display_title'] = array( - '#title' => t('Administrative name'), + '#title' => $this->t('Administrative name'), '#type' => 'textfield', '#default_value' => $this->display['display_title'], ); $form['display_description'] = array( - '#title' => t('Administrative description'), + '#title' => $this->t('Administrative description'), '#type' => 'textfield', '#default_value' => $this->getOption('display_description'), ); break; case 'display_comment': - $form['#title'] .= t('Administrative comment'); + $form['#title'] .= $this->t('Administrative comment'); $form['display_comment'] = array( '#type' => 'textarea', - '#title' => t('Administrative comment'), - '#description' => t('This description will only be seen within the administrative interface and can be used to document this display.'), + '#title' => $this->t('Administrative comment'), + '#description' => $this->t('This description will only be seen within the administrative interface and can be used to document this display.'), '#default_value' => $this->getOption('display_comment'), ); break; case 'title': - $form['#title'] .= t('The title of this view'); + $form['#title'] .= $this->t('The title of this view'); $form['title'] = array( - '#title' => t('Title'), + '#title' => $this->t('Title'), '#type' => 'textfield', - '#description' => t('This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc.'), + '#description' => $this->t('This title will be displayed with the view, wherever titles are normally displayed; i.e, as the page title, block title, etc.'), '#default_value' => $this->getOption('title'), '#maxlength' => 255, ); break; case 'css_class': - $form['#title'] .= t('CSS class'); + $form['#title'] .= $this->t('CSS class'); $form['css_class'] = array( '#type' => 'textfield', - '#title' => t('CSS class name(s)'), - '#description' => t('Multiples classes should be separated by spaces.'), + '#title' => $this->t('CSS class name(s)'), + '#description' => $this->t('Multiples classes should be separated by spaces.'), '#default_value' => $this->getOption('css_class'), ); break; case 'use_ajax': - $form['#title'] .= t('Use AJAX when available to load this view'); + $form['#title'] .= $this->t('Use AJAX when available to load this view'); $form['use_ajax'] = array( - '#description' => t('When viewing a view, things like paging, table sorting, and exposed filters will not trigger a page refresh.'), + '#description' => $this->t('When viewing a view, things like paging, table sorting, and exposed filters will not trigger a page refresh.'), '#type' => 'checkbox', - '#title' => t('Use AJAX'), + '#title' => $this->t('Use AJAX'), '#default_value' => $this->getOption('use_ajax') ? 1 : 0, ); break; case 'hide_attachment_summary': - $form['#title'] .= t('Hide attachments when displaying a contextual filter summary'); + $form['#title'] .= $this->t('Hide attachments when displaying a contextual filter summary'); $form['hide_attachment_summary'] = array( '#type' => 'checkbox', - '#title' => t('Hide attachments in summary'), + '#title' => $this->t('Hide attachments in summary'), '#default_value' => $this->getOption('hide_attachment_summary') ? 1 : 0, ); break; case 'show_admin_links': - $form['#title'] .= t('Show contextual links on this view.'); + $form['#title'] .= $this->t('Show contextual links on this view.'); $form['show_admin_links'] = array( '#type' => 'checkbox', - '#title' => t('Show contextual links'), + '#title' => $this->t('Show contextual links'), '#default_value' => $this->getOption('show_admin_links'), ); break; case 'use_more': - $form['#title'] .= t('Add a more link to the bottom of the display.'); + $form['#title'] .= $this->t('Add a more link to the bottom of the display.'); $form['use_more'] = array( '#type' => 'checkbox', - '#title' => t('Create more link'), - '#description' => t("This will add a more link to the bottom of this view, which will link to the page view. If you have more than one page view, the link will point to the display specified in 'Link display' section under pager. You can override the url at the link display setting."), + '#title' => $this->t('Create more link'), + '#description' => $this->t("This will add a more link to the bottom of this view, which will link to the page view. If you have more than one page view, the link will point to the display specified in 'Link display' section under pager. You can override the url at the link display setting."), '#default_value' => $this->getOption('use_more'), ); $form['use_more_always'] = array( '#type' => 'checkbox', - '#title' => t('Always display the more link'), - '#description' => t('Check this to display the more link even if there are no more items to display.'), + '#title' => $this->t('Always display the more link'), + '#description' => $this->t('Check this to display the more link even if there are no more items to display.'), '#default_value' => $this->getOption('use_more_always'), '#states' => array( 'visible' => array( @@ -1495,8 +1495,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); $form['use_more_text'] = array( '#type' => 'textfield', - '#title' => t('More link text'), - '#description' => t('The text to display for the more link.'), + '#title' => $this->t('More link text'), + '#description' => $this->t('The text to display for the more link.'), '#default_value' => $this->getOption('use_more_text'), '#states' => array( 'visible' => array( @@ -1506,16 +1506,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); break; case 'group_by': - $form['#title'] .= t('Allow grouping and aggregation (calculation) of fields.'); + $form['#title'] .= $this->t('Allow grouping and aggregation (calculation) of fields.'); $form['group_by'] = array( '#type' => 'checkbox', - '#title' => t('Aggregate'), - '#description' => t('If enabled, some fields may become unavailable. All fields that are selected for grouping will be collapsed to one record per distinct value. Other fields which are selected for aggregation will have the function run on them. For example, you can group nodes on title and count the number of nids in order to get a list of duplicate titles.'), + '#title' => $this->t('Aggregate'), + '#description' => $this->t('If enabled, some fields may become unavailable. All fields that are selected for grouping will be collapsed to one record per distinct value. Other fields which are selected for aggregation will have the function run on them. For example, you can group nodes on title and count the number of nids in order to get a list of duplicate titles.'), '#default_value' => $this->getOption('group_by'), ); break; case 'access': - $form['#title'] .= t('Access restrictions'); + $form['#title'] .= $this->t('Access restrictions'); $form['access'] = array( '#prefix' => '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('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))); only in patch2: unchanged: --- 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'), ), ); } only in patch2: unchanged: --- 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'), ); } only in patch2: unchanged: --- 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'], ); } only in patch2: unchanged: --- 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']), ); only in patch2: unchanged: --- 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); only in patch2: unchanged: --- 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( only in patch2: unchanged: --- 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.')); } } only in patch2: unchanged: --- 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'], ); } only in patch2: unchanged: --- 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']), ); only in patch2: unchanged: --- 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(); only in patch2: unchanged: --- 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) { only in patch2: unchanged: --- 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.')); } } } only in patch2: unchanged: --- 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.')); } } } only in patch2: unchanged: --- 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, ); only in patch2: unchanged: --- 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' => '