Issue #2341313 by dawehner: Convert all t() calls to $this->t() in views.
parent
c303b2ce95
commit
81e675a570
|
@ -48,7 +48,7 @@ class TitleLink extends FieldPluginBase {
|
|||
*/
|
||||
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']),
|
||||
);
|
||||
|
|
|
@ -55,12 +55,12 @@ class Rss extends RowPluginBase {
|
|||
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'],
|
||||
);
|
||||
|
|
|
@ -62,7 +62,7 @@ class UserUid extends ArgumentPluginBase {
|
|||
$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 @@ class UserUid extends ArgumentPluginBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSortName() {
|
||||
return t('Numerical', array(), array('context' => 'Sort order'));
|
||||
return $this->t('Numerical', array(), array('context' => 'Sort order'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,13 +63,13 @@ class Comment extends FieldPluginBase {
|
|||
*/
|
||||
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'],
|
||||
);
|
||||
|
|
|
@ -36,9 +36,9 @@ class EntityLink extends FieldPluginBase {
|
|||
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);
|
||||
|
|
|
@ -73,7 +73,7 @@ class Link extends FieldPluginBase {
|
|||
'#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 @@ class Link extends FieldPluginBase {
|
|||
* 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();
|
||||
|
|
|
@ -47,7 +47,7 @@ class LinkApprove extends Link {
|
|||
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;
|
||||
|
|
|
@ -39,7 +39,7 @@ class LinkDelete extends Link {
|
|||
* 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;
|
||||
|
|
|
@ -31,8 +31,8 @@ class LinkEdit extends Link {
|
|||
|
||||
$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 @@ class LinkEdit extends Link {
|
|||
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'])) {
|
||||
|
|
|
@ -39,7 +39,7 @@ class LinkReply extends Link {
|
|||
* 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;
|
||||
|
|
|
@ -28,11 +28,11 @@ class NodeComment extends FieldPluginBase {
|
|||
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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,8 +85,8 @@ class NodeNewComments extends Numeric {
|
|||
|
||||
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'],
|
||||
);
|
||||
|
|
|
@ -42,7 +42,7 @@ class Username extends FieldPluginBase {
|
|||
|
||||
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'],
|
||||
);
|
||||
|
|
|
@ -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'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class Rss extends RowPluginBase {
|
|||
|
||||
$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 @@ class Rss extends RowPluginBase {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 @@ class Comment extends WizardPluginBase {
|
|||
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,
|
||||
);
|
||||
|
|
|
@ -87,9 +87,9 @@ class ContactLink extends Link {
|
|||
*/
|
||||
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 @@ class ContactLink extends Link {
|
|||
$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'])) {
|
||||
|
|
|
@ -36,7 +36,7 @@ class TranslationLink extends FieldPluginBase {
|
|||
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 @@ class TranslationLink extends FieldPluginBase {
|
|||
*/
|
||||
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');
|
||||
|
|
|
@ -44,18 +44,18 @@ class ContextualLinks extends FieldPluginBase {
|
|||
$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'],
|
||||
);
|
||||
|
|
|
@ -51,7 +51,7 @@ class DblogMessage extends FieldPluginBase {
|
|||
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'],
|
||||
);
|
||||
|
|
|
@ -165,14 +165,14 @@ class EntityReference extends DisplayPluginBase {
|
|||
// 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class EntityReference extends Fields {
|
|||
parent::buildOptionsForm($form, $form_state);
|
||||
|
||||
// Expand the description of the 'Inline field' checkboxes.
|
||||
$form['inline']['#description'] .= '<br />' . t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
|
||||
$form['inline']['#description'] .= '<br />' . $this->t("<strong>Note:</strong> In 'Entity Reference' displays, all fields will be displayed inline unless an explicit selection of inline fields is made here." );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,11 +61,11 @@ class EntityReference extends StylePluginBase {
|
|||
$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,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class FieldList extends Numeric {
|
|||
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(
|
||||
|
|
|
@ -56,7 +56,7 @@ class ListString extends String {
|
|||
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(
|
||||
|
|
|
@ -459,16 +459,16 @@ class Field extends FieldPluginBase {
|
|||
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 @@ class Field extends FieldPluginBase {
|
|||
);
|
||||
|
||||
$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 @@ class Field extends FieldPluginBase {
|
|||
|
||||
$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 @@ class Field extends FieldPluginBase {
|
|||
}
|
||||
$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 @@ class Field extends FieldPluginBase {
|
|||
|
||||
$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 @@ class Field extends FieldPluginBase {
|
|||
'#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 @@ class Field extends FieldPluginBase {
|
|||
':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 @@ class Field extends FieldPluginBase {
|
|||
':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' => '</div>',
|
||||
|
@ -648,14 +648,14 @@ class Field extends FieldPluginBase {
|
|||
|
||||
$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 @@ class Field extends FieldPluginBase {
|
|||
// 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 @@ class Field extends FieldPluginBase {
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ class Extension extends FieldPluginBase {
|
|||
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'],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ class File extends FieldPluginBase {
|
|||
*/
|
||||
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']),
|
||||
);
|
||||
|
|
|
@ -27,7 +27,7 @@ class FileMime extends File {
|
|||
|
||||
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']),
|
||||
);
|
||||
|
|
|
@ -25,8 +25,8 @@ class Uri extends File {
|
|||
|
||||
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']),
|
||||
);
|
||||
|
|
|
@ -60,7 +60,7 @@ class HistoryUserTimestamp extends Node {
|
|||
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']),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class HistoryUserTimestamp extends FilterPluginBase {
|
|||
$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 @@ class HistoryUserTimestamp extends FilterPluginBase {
|
|||
|
||||
public function adminSummary() {
|
||||
if (!empty($this->options['exposed'])) {
|
||||
return t('exposed');
|
||||
return $this->t('exposed');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class Type extends String {
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,10 +30,10 @@ class Language extends Node {
|
|||
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'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class Link extends FieldPluginBase {
|
|||
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 @@ class Link extends FieldPluginBase {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class LinkDelete extends Link {
|
|||
$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;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class LinkEdit extends Link {
|
|||
$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;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ class Node extends FieldPluginBase {
|
|||
*/
|
||||
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']),
|
||||
);
|
||||
|
|
|
@ -21,7 +21,7 @@ class NodeBulkForm extends BulkForm {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function emptySelectedMessage() {
|
||||
return t('No content selected.');
|
||||
return $this->t('No content selected.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ class Path extends FieldPluginBase {
|
|||
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',
|
||||
);
|
||||
}
|
||||
|
|
|
@ -44,8 +44,8 @@ class Revision extends Node {
|
|||
*/
|
||||
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']),
|
||||
);
|
||||
|
|
|
@ -65,7 +65,7 @@ class RevisionLink extends Link {
|
|||
$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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,7 +53,7 @@ class RevisionLinkDelete extends RevisionLink {
|
|||
$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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class RevisionLinkRevert extends RevisionLink {
|
|||
$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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ class Type extends Node {
|
|||
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 @@ class Type extends Node {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class Rss extends RowPluginBase {
|
|||
|
||||
$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 @@ class Rss extends RowPluginBase {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 @@ class Node extends WizardPluginBase {
|
|||
*/
|
||||
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 @@ class Node extends WizardPluginBase {
|
|||
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 @@ class Node extends WizardPluginBase {
|
|||
// 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,
|
||||
|
|
|
@ -225,7 +225,7 @@ class RestExport extends PathPluginBase {
|
|||
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 @@ class RestExport extends PathPluginBase {
|
|||
);
|
||||
|
||||
$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.
|
||||
|
|
|
@ -79,8 +79,8 @@ class DataFieldRow extends RowPluginBase {
|
|||
|
||||
$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 @@ class DataFieldRow extends RowPluginBase {
|
|||
'#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 @@ class DataFieldRow extends RowPluginBase {
|
|||
*/
|
||||
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 @@ class DataFieldRow extends RowPluginBase {
|
|||
// 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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,8 +94,8 @@ class Serializer extends StylePluginBase {
|
|||
|
||||
$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'],
|
||||
);
|
||||
|
|
|
@ -74,7 +74,7 @@ class Search extends FilterPluginBase {
|
|||
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'),
|
||||
|
|
|
@ -38,7 +38,7 @@ class SearchRow extends RowPluginBase {
|
|||
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'],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -96,23 +96,23 @@ class BulkForm extends FieldPluginBase {
|
|||
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 @@ class BulkForm extends FieldPluginBase {
|
|||
'#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 @@ class BulkForm extends FieldPluginBase {
|
|||
* Message displayed when no items are selected.
|
||||
*/
|
||||
protected function emptySelectedMessage() {
|
||||
return t('No items selected.');
|
||||
return $this->t('No items selected.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,15 +36,15 @@ class IndexTidDepth extends ArgumentPluginBase {
|
|||
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 @@ class IndexTidDepth extends ArgumentPluginBase {
|
|||
return String::checkPlain($term->getName());
|
||||
}
|
||||
// TODO review text
|
||||
return t('No name');
|
||||
return $this->t('No name');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class Taxonomy extends Numeric {
|
|||
}
|
||||
}
|
||||
// TODO review text
|
||||
return t('No name');
|
||||
return $this->t('No name');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class VocabularyVid extends Numeric {
|
|||
return String::checkPlain($vocabulary->label());
|
||||
}
|
||||
|
||||
return t('No vocabulary');
|
||||
return $this->t('No vocabulary');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -59,18 +59,18 @@ class Tid extends ArgumentDefaultPluginBase {
|
|||
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 @@ class Tid extends ArgumentDefaultPluginBase {
|
|||
|
||||
$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 @@ class Tid extends ArgumentDefaultPluginBase {
|
|||
|
||||
$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(
|
||||
|
|
|
@ -59,7 +59,7 @@ class TermName extends Entity {
|
|||
|
||||
$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'],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class LinkEdit extends FieldPluginBase {
|
|||
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 @@ class LinkEdit extends FieldPluginBase {
|
|||
'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()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,14 +51,14 @@ class Taxonomy extends FieldPluginBase {
|
|||
*/
|
||||
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']),
|
||||
);
|
||||
|
|
|
@ -52,14 +52,14 @@ class TaxonomyIndexTid extends PrerenderList {
|
|||
*/
|
||||
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 @@ class TaxonomyIndexTid extends PrerenderList {
|
|||
|
||||
$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 @@ class TaxonomyIndexTid extends PrerenderList {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -71,9 +71,9 @@ class TaxonomyIndexTid extends ManyToOne {
|
|||
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 @@ class TaxonomyIndexTid extends ManyToOne {
|
|||
|
||||
$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 @@ class TaxonomyIndexTid extends ManyToOne {
|
|||
$vocabulary = entity_load('taxonomy_vocabulary', $this->options['vid']);
|
||||
if (empty($vocabulary) && $this->options['limit']) {
|
||||
$form['markup'] = array(
|
||||
'#markup' => '<div class="form-item">' . t('An invalid vocabulary is selected. Please change it in the options.') . '</div>',
|
||||
'#markup' => '<div class="form-item">' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '</div>',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ class TaxonomyIndexTid extends ManyToOne {
|
|||
}
|
||||
|
||||
$form['value'] = array(
|
||||
'#title' => $this->options['limit'] ? t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->label())) : t('Select terms'),
|
||||
'#title' => $this->options['limit'] ? $this->t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->label())) : $this->t('Select terms'),
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => $default,
|
||||
);
|
||||
|
@ -193,7 +193,7 @@ class TaxonomyIndexTid extends ManyToOne {
|
|||
}
|
||||
$form['value'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => $this->options['limit'] ? t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->label())) : t('Select terms'),
|
||||
'#title' => $this->options['limit'] ? $this->t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->label())) : $this->t('Select terms'),
|
||||
'#multiple' => TRUE,
|
||||
'#options' => $options,
|
||||
'#size' => min(9, count($options)),
|
||||
|
@ -342,7 +342,7 @@ class TaxonomyIndexTid extends ManyToOne {
|
|||
}
|
||||
$form['error_message'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Display error message'),
|
||||
'#title' => $this->t('Display error message'),
|
||||
'#default_value' => !empty($this->options['error_message']),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class TaxonomyIndexTidDepth extends TaxonomyIndexTid {
|
|||
|
||||
public function operatorOptions($which = 'title') {
|
||||
return array(
|
||||
'or' => t('Is one of'),
|
||||
'or' => $this->t('Is one of'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -40,9 +40,9 @@ class TaxonomyIndexTidDepth extends TaxonomyIndexTid {
|
|||
|
||||
$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).'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,10 +54,10 @@ class NodeTermData extends RelationshipPluginBase {
|
|||
|
||||
$form['vids'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Vocabularies'),
|
||||
'#title' => $this->t('Vocabularies'),
|
||||
'#options' => $options,
|
||||
'#default_value' => $this->options['vids'],
|
||||
'#description' => t('Choose which vocabularies you wish to relate. Remember that every term found will create a new record, so this relationship is best used on just one vocabulary that has only one term per node.'),
|
||||
'#description' => $this->t('Choose which vocabularies you wish to relate. Remember that every term found will create a new record, so this relationship is best used on just one vocabulary that has only one term per node.'),
|
||||
);
|
||||
parent::buildOptionsForm($form, $form_state);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class Permission extends AccessPluginBase {
|
|||
return $permissions[$this->options['perm']]['title'];
|
||||
}
|
||||
|
||||
return t($this->options['perm']);
|
||||
return $this->t($this->options['perm']);
|
||||
}
|
||||
|
||||
|
||||
|
@ -115,9 +115,9 @@ class Permission extends AccessPluginBase {
|
|||
$form['perm'] = array(
|
||||
'#type' => 'select',
|
||||
'#options' => $perms,
|
||||
'#title' => t('Permission'),
|
||||
'#title' => $this->t('Permission'),
|
||||
'#default_value' => $this->options['perm'],
|
||||
'#description' => t('Only users with the selected permission flag will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.'),
|
||||
'#description' => $this->t('Only users with the selected permission flag will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,10 +50,10 @@ class Role extends AccessPluginBase {
|
|||
public function summaryTitle() {
|
||||
$count = count($this->options['role']);
|
||||
if ($count < 1) {
|
||||
return t('No role(s) selected');
|
||||
return $this->t('No role(s) selected');
|
||||
}
|
||||
elseif ($count > 1) {
|
||||
return t('Multiple roles');
|
||||
return $this->t('Multiple roles');
|
||||
}
|
||||
else {
|
||||
$rids = user_role_names();
|
||||
|
@ -74,10 +74,10 @@ class Role extends AccessPluginBase {
|
|||
parent::buildOptionsForm($form, $form_state);
|
||||
$form['role'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Role'),
|
||||
'#title' => $this->t('Role'),
|
||||
'#default_value' => $this->options['role'],
|
||||
'#options' => array_map('\Drupal\Component\Utility\String::checkPlain', user_role_names()),
|
||||
'#description' => t('Only the checked roles will be able to access this display. Note that users with "access all views" can see any view, regardless of role.'),
|
||||
'#description' => $this->t('Only the checked roles will be able to access this display. Note that users with "access all views" can see any view, regardless of role.'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class Role extends AccessPluginBase {
|
|||
$role = array_filter($role);
|
||||
|
||||
if (!$role) {
|
||||
$form_state->setError($form['role'], t('You must select at least one role if type is "by role"'));
|
||||
$form_state->setError($form['role'], $this->t('You must select at least one role if type is "by role"'));
|
||||
}
|
||||
|
||||
$form_state->setValue(array('access_options', 'role'), $role);
|
||||
|
|
|
@ -40,7 +40,7 @@ class User extends ArgumentDefaultPluginBase {
|
|||
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
|
||||
$form['user'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Also look for a node and use the node author'),
|
||||
'#title' => $this->t('Also look for a node and use the node author'),
|
||||
'#default_value' => $this->options['user'],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class Link extends FieldPluginBase {
|
|||
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);
|
||||
|
@ -87,7 +87,7 @@ class Link extends FieldPluginBase {
|
|||
* The acutal rendered text (without the link) of this field.
|
||||
*/
|
||||
protected function renderLink(EntityInterface $entity, ResultRow $values) {
|
||||
$text = !empty($this->options['text']) ? $this->options['text'] : t('View');
|
||||
$text = !empty($this->options['text']) ? $this->options['text'] : $this->t('View');
|
||||
|
||||
$this->options['alter']['make_link'] = TRUE;
|
||||
$this->options['alter']['path'] = $entity->getSystemPath();
|
||||
|
|
|
@ -26,7 +26,7 @@ class LinkCancel extends Link {
|
|||
if ($entity && $entity->access('delete')) {
|
||||
$this->options['alter']['make_link'] = TRUE;
|
||||
|
||||
$text = !empty($this->options['text']) ? $this->options['text'] : t('Cancel account');
|
||||
$text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Cancel account');
|
||||
|
||||
$this->options['alter']['path'] = $entity->getSystemPath('cancel-form');
|
||||
$this->options['alter']['query'] = drupal_get_destination();
|
||||
|
|
|
@ -26,7 +26,7 @@ class LinkEdit extends Link {
|
|||
if ($entity && $entity->access('update')) {
|
||||
$this->options['alter']['make_link'] = TRUE;
|
||||
|
||||
$text = !empty($this->options['text']) ? $this->options['text'] : t('Edit');
|
||||
$text = !empty($this->options['text']) ? $this->options['text'] : $this->t('Edit');
|
||||
|
||||
$this->options['alter']['path'] = $entity->getSystemPath('edit-form');
|
||||
$this->options['alter']['query'] = drupal_get_destination();
|
||||
|
|
|
@ -28,12 +28,12 @@ class Mail extends User {
|
|||
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
|
||||
parent::buildOptionsForm($form, $form_state);
|
||||
$form['link_to_user'] = array(
|
||||
'#title' => t('Link this field'),
|
||||
'#title' => $this->t('Link this field'),
|
||||
'#type' => 'radios',
|
||||
'#options' => array(
|
||||
0 => t('No link'),
|
||||
'user' => t('To the user'),
|
||||
'mailto' => t("With a mailto:"),
|
||||
0 => $this->t('No link'),
|
||||
'user' => $this->t('To the user'),
|
||||
'mailto' => $this->t("With a mailto:"),
|
||||
),
|
||||
'#default_value' => $this->options['link_to_user'],
|
||||
);
|
||||
|
|
|
@ -53,19 +53,19 @@ class Name extends User {
|
|||
parent::buildOptionsForm($form, $form_state);
|
||||
|
||||
$form['format_username'] = array(
|
||||
'#title' => t('Use formatted username'),
|
||||
'#title' => $this->t('Use formatted username'),
|
||||
'#type' => 'checkbox',
|
||||
'#default_value' => !empty($this->options['format_username']),
|
||||
'#description' => t('If checked, the username will be formatted by the system. If unchecked, it will be displayed raw.'),
|
||||
'#description' => $this->t('If checked, the username will be formatted by the system. If unchecked, it will be displayed raw.'),
|
||||
);
|
||||
$form['overwrite_anonymous'] = array(
|
||||
'#title' => t('Overwrite the value to display for anonymous users'),
|
||||
'#title' => $this->t('Overwrite the value to display for anonymous users'),
|
||||
'#type' => 'checkbox',
|
||||
'#default_value' => !empty($this->options['overwrite_anonymous']),
|
||||
'#description' => t('Enable to display different text for anonymous users.'),
|
||||
'#description' => $this->t('Enable to display different text for anonymous users.'),
|
||||
);
|
||||
$form['anonymous_text'] = array(
|
||||
'#title' => t('Text to display for anonymous users'),
|
||||
'#title' => $this->t('Text to display for anonymous users'),
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => $this->options['anonymous_text'],
|
||||
'#states' => array(
|
||||
|
|
|
@ -119,8 +119,8 @@ class Permissions extends PrerenderList {
|
|||
|
||||
/*
|
||||
protected function documentSelfTokens(&$tokens) {
|
||||
$tokens['[' . $this->options['id'] . '-role' . ']'] = t('The name of the role.');
|
||||
$tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.');
|
||||
$tokens['[' . $this->options['id'] . '-role' . ']'] = $this->t('The name of the role.');
|
||||
$tokens['[' . $this->options['id'] . '-rid' . ']'] = $this->t('The role ID of the role.');
|
||||
}
|
||||
|
||||
protected function addSelfTokens(&$tokens, $item) {
|
||||
|
|
|
@ -101,8 +101,8 @@ class Roles extends PrerenderList {
|
|||
}
|
||||
|
||||
protected function documentSelfTokens(&$tokens) {
|
||||
$tokens['[' . $this->options['id'] . '-role' . ']'] = t('The name of the role.');
|
||||
$tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role machine-name of the role.');
|
||||
$tokens['[' . $this->options['id'] . '-role' . ']'] = $this->t('The name of the role.');
|
||||
$tokens['[' . $this->options['id'] . '-rid' . ']'] = $this->t('The role machine-name of the role.');
|
||||
}
|
||||
|
||||
protected function addSelfTokens(&$tokens, $item) {
|
||||
|
|
|
@ -44,8 +44,8 @@ class User extends FieldPluginBase {
|
|||
*/
|
||||
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
|
||||
$form['link_to_user'] = array(
|
||||
'#title' => t('Link this field to its user'),
|
||||
'#description' => t("Enable to override this field's links."),
|
||||
'#title' => $this->t('Link this field to its user'),
|
||||
'#description' => $this->t("Enable to override this field's links."),
|
||||
'#type' => 'checkbox',
|
||||
'#default_value' => $this->options['link_to_user'],
|
||||
);
|
||||
|
|
|
@ -31,7 +31,7 @@ class UserBulkForm extends BulkForm {
|
|||
foreach ($this->view->result as $row_index => $result) {
|
||||
$account = $result->_entity;
|
||||
if ($account instanceof UserInterface) {
|
||||
$form[$this->options['id']][$row_index]['#title'] = t('Update the user %name', array('%name' => $account->label()));
|
||||
$form[$this->options['id']][$row_index]['#title'] = $this->t('Update the user %name', array('%name' => $account->label()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class UserBulkForm extends BulkForm {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function emptySelectedMessage() {
|
||||
return t('No users selected.');
|
||||
return $this->t('No users selected.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -74,17 +74,17 @@ class UserData extends FieldPluginBase {
|
|||
}
|
||||
|
||||
$form['data_module'] = array(
|
||||
'#title' => t('Module name'),
|
||||
'#title' => $this->t('Module name'),
|
||||
'#type' => 'select',
|
||||
'#description' => t('The module which sets this user data.'),
|
||||
'#description' => $this->t('The module which sets this user data.'),
|
||||
'#default_value' => $this->options['data_module'],
|
||||
'#options' => $names,
|
||||
);
|
||||
|
||||
$form['data_name'] = array(
|
||||
'#title' => t('Name'),
|
||||
'#title' => $this->t('Name'),
|
||||
'#type' => 'textfield',
|
||||
'#description' => t('The name of the data key.'),
|
||||
'#description' => $this->t('The name of the data key.'),
|
||||
'#default_value' => $this->options['data_name'],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class Current extends BooleanOperator {
|
|||
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
|
||||
parent::init($view, $display, $options);
|
||||
|
||||
$this->value_value = t('Is the logged in user');
|
||||
$this->value_value = $this->t('Is the logged in user');
|
||||
}
|
||||
|
||||
public function query() {
|
||||
|
|
|
@ -40,8 +40,8 @@ class Name extends InOperator {
|
|||
$default_value = implode(', ', $values);
|
||||
$form['value'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Usernames'),
|
||||
'#description' => t('Enter a comma separated list of user names.'),
|
||||
'#title' => $this->t('Usernames'),
|
||||
'#description' => $this->t('Enter a comma separated list of user names.'),
|
||||
'#default_value' => $default_value,
|
||||
'#autocomplete_route_name' => 'user.autocomplete_anonymous',
|
||||
);
|
||||
|
|
|
@ -28,8 +28,8 @@ class Roles extends ManyToOne {
|
|||
*/
|
||||
function operators() {
|
||||
$operators = parent::operators();
|
||||
$operators['empty']['title'] = t("Only has the 'authenticated user' role");
|
||||
$operators['not empty']['title'] = t("Has roles in addition to 'authenticated user'");
|
||||
$operators['empty']['title'] = $this->t("Only has the 'authenticated user' role");
|
||||
$operators['not empty']['title'] = $this->t("Has roles in addition to 'authenticated user'");
|
||||
return $operators;
|
||||
}
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ abstract class HandlerBase extends PluginBase implements ViewsHandlerInterface {
|
|||
|
||||
$form['admin_label'] = array(
|
||||
'#type' => 'details',
|
||||
'#title' => t('Administrative title'),
|
||||
'#title' =>$this->t('Administrative title'),
|
||||
'#weight' => 150,
|
||||
);
|
||||
$form['admin_label']['admin_label'] = array(
|
||||
|
@ -297,7 +297,7 @@ abstract class HandlerBase extends PluginBase implements ViewsHandlerInterface {
|
|||
// belongs in "Administrative title" fieldset at the bottom of the form.
|
||||
$form['more'] = array(
|
||||
'#type' => 'details',
|
||||
'#title' => t('More'),
|
||||
'#title' => $this->t('More'),
|
||||
'#weight' => 200,
|
||||
);
|
||||
// Allow to alter the default values brought into the form.
|
||||
|
|
|
@ -123,7 +123,7 @@ abstract class PluginBase extends ComponentPluginBase implements ContainerFactor
|
|||
* @code
|
||||
* 'option_name' => array(
|
||||
* - 'default' => default value,
|
||||
* - 'translatable' => (optional) TRUE/FALSE (wrap in t() on export if true),
|
||||
* - 'translatable' => (optional) TRUE/FALSE (wrap in $this->t() on export if true),
|
||||
* - 'contains' => (optional) array of items this contains, with its own
|
||||
* defaults, etc. If contains is set, the default will be ignored and
|
||||
* assumed to be array().
|
||||
|
@ -251,7 +251,7 @@ abstract class PluginBase extends ComponentPluginBase implements ContainerFactor
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function summaryTitle() {
|
||||
return t('Settings');
|
||||
return $this->t('Settings');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -323,7 +323,7 @@ abstract class PluginBase extends ComponentPluginBase implements ContainerFactor
|
|||
|
||||
$form['global_tokens'] = array(
|
||||
'#type' => 'details',
|
||||
'#title' => t('Available global token replacements'),
|
||||
'#title' => $this->t('Available global token replacements'),
|
||||
);
|
||||
$form['global_tokens']['list'] = array(
|
||||
'#theme' => 'item_list',
|
||||
|
@ -410,7 +410,7 @@ abstract class PluginBase extends ComponentPluginBase implements ContainerFactor
|
|||
if ($id == 'site_default') {
|
||||
$id = '***LANGUAGE_' . $id . '***';
|
||||
}
|
||||
$list[$id] = t($language->name);
|
||||
$list[$id] = $this->t($language->name);
|
||||
}
|
||||
|
||||
// Add in negotiated languages, if requested.
|
||||
|
@ -422,7 +422,7 @@ abstract class PluginBase extends ComponentPluginBase implements ContainerFactor
|
|||
// IDs by '***LANGUAGE_...***', to avoid query collisions.
|
||||
if (isset($type['name'])) {
|
||||
$id = '***LANGUAGE_' . $id . '***';
|
||||
$list[$id] = t('Language selected for !type', array('!type' => $type['name']));
|
||||
$list[$id] = $this->t('Language selected for !type', array('!type' => $type['name']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ abstract class AccessPluginBase extends PluginBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function summaryTitle() {
|
||||
return t('Unknown');
|
||||
return $this->t('Unknown');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,7 +27,7 @@ class None extends AccessPluginBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function summaryTitle() {
|
||||
return t('Unrestricted');
|
||||
return $this->t('Unrestricted');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -88,7 +88,7 @@ abstract class AreaPluginBase extends HandlerBase {
|
|||
if ($form_state->get('type') != 'empty') {
|
||||
$form['empty'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Display even if view has no result'),
|
||||
'#title' => $this->t('Display even if view has no result'),
|
||||
'#default_value' => isset($this->options['empty']) ? $this->options['empty'] : 0,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,20 +61,20 @@ class Entity extends TokenizeAreaPluginBase {
|
|||
$form['view_mode'] = array(
|
||||
'#type' => 'select',
|
||||
'#options' => \Drupal::entityManager()->getViewModeOptions($this->entityType),
|
||||
'#title' => t('View mode'),
|
||||
'#title' => $this->t('View mode'),
|
||||
'#default_value' => $this->options['view_mode'],
|
||||
);
|
||||
|
||||
$form['entity_id'] = array(
|
||||
'#title' => t('ID'),
|
||||
'#title' => $this->t('ID'),
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => $this->options['entity_id'],
|
||||
);
|
||||
|
||||
$form['bypass_access'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Bypass access checks'),
|
||||
'#description' => t('If enabled, access permissions for rendering the entity are not checked.'),
|
||||
'#title' => $this->t('Bypass access checks'),
|
||||
'#description' => $this->t('If enabled, access permissions for rendering the entity are not checked.'),
|
||||
'#default_value' => !empty($this->options['bypass_access']),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -48,11 +48,11 @@ class HTTPStatusCode extends AreaPluginBase {
|
|||
|
||||
// Add the HTTP status code, so it's easier for people to find it.
|
||||
array_walk($options, function($title, $code) use(&$options) {
|
||||
$options[$code] = t('@code (!title)', array('@code' => $code, '!title' => $title));
|
||||
$options[$code] = $this->t('@code (!title)', array('@code' => $code, '!title' => $title));
|
||||
});
|
||||
|
||||
$form['status_code'] = array(
|
||||
'#title' => t('HTTP status code'),
|
||||
'#title' => $this->t('HTTP status code'),
|
||||
'#type' => 'select',
|
||||
'#default_value' => $this->options['status_code'],
|
||||
'#options' => $options,
|
||||
|
|
|
@ -55,11 +55,11 @@ class Result extends AreaPluginBase {
|
|||
);
|
||||
$list = drupal_render($item_list);
|
||||
$form['content'] = array(
|
||||
'#title' => t('Display'),
|
||||
'#title' => $this->t('Display'),
|
||||
'#type' => 'textarea',
|
||||
'#rows' => 3,
|
||||
'#default_value' => $this->options['content'],
|
||||
'#description' => t('You may use HTML code in this field. The following tokens are supported:') . $list,
|
||||
'#description' => $this->t('You may use HTML code in this field. The following tokens are supported:') . $list,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class Text extends TokenizeAreaPluginBase {
|
|||
parent::buildOptionsForm($form, $form_state);
|
||||
|
||||
$form['content'] = array(
|
||||
'#title' => t('Content'),
|
||||
'#title' => $this->t('Content'),
|
||||
'#type' => 'text_format',
|
||||
'#default_value' => $this->options['content'],
|
||||
'#rows' => 6,
|
||||
|
|
|
@ -34,7 +34,7 @@ class TextCustom extends TokenizeAreaPluginBase {
|
|||
parent::buildOptionsForm($form, $form_state);
|
||||
|
||||
$form['content'] = array(
|
||||
'#title' => t('Content'),
|
||||
'#title' => $this->t('Content'),
|
||||
'#type' => 'textarea',
|
||||
'#default_value' => $this->options['content'],
|
||||
'#rows' => 6,
|
||||
|
|
|
@ -36,9 +36,9 @@ class Title extends AreaPluginBase {
|
|||
|
||||
$form['title'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Overridden title'),
|
||||
'#title' => $this->t('Overridden title'),
|
||||
'#default_value' => $this->options['title'],
|
||||
'#description' => t('Override the title of this view when it is empty. The available global tokens below can be used here.'),
|
||||
'#description' => $this->t('Override the title of this view when it is empty. The available global tokens below can be used here.'),
|
||||
);
|
||||
|
||||
// Don't use the AreaPluginBase tokenForm method, we don't want row tokens.
|
||||
|
|
|
@ -46,7 +46,7 @@ abstract class TokenizeAreaPluginBase extends AreaPluginBase {
|
|||
public function tokenForm(&$form, FormStateInterface $form_state) {
|
||||
$form['tokenize'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => t('Use replacement tokens from the first row'),
|
||||
'#title' => $this->t('Use replacement tokens from the first row'),
|
||||
'#default_value' => $this->options['tokenize'],
|
||||
);
|
||||
|
||||
|
@ -58,14 +58,14 @@ abstract class TokenizeAreaPluginBase extends AreaPluginBase {
|
|||
|
||||
$count = 0; // This lets us prepare the key as we want it printed.
|
||||
foreach ($this->view->display_handler->getHandlers('argument') as $handler) {
|
||||
$options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->adminLabel()));
|
||||
$options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->adminLabel()));
|
||||
$options[t('Arguments')]['%' . ++$count] = $this->t('@argument title', array('@argument' => $handler->adminLabel()));
|
||||
$options[t('Arguments')]['!' . $count] = $this->t('@argument input', array('@argument' => $handler->adminLabel()));
|
||||
}
|
||||
|
||||
if (!empty($options)) {
|
||||
$form['tokens'] = array(
|
||||
'#type' => 'details',
|
||||
'#title' => t('Replacement patterns'),
|
||||
'#title' => $this->t('Replacement patterns'),
|
||||
'#open' => TRUE,
|
||||
'#id' => 'edit-options-token-help',
|
||||
'#states' => array(
|
||||
|
@ -75,7 +75,7 @@ abstract class TokenizeAreaPluginBase extends AreaPluginBase {
|
|||
),
|
||||
);
|
||||
$form['tokens']['help'] = array(
|
||||
'#markup' => '<p>' . 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.') . '</p>',
|
||||
'#markup' => '<p>' . $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.') . '</p>',
|
||||
);
|
||||
foreach (array_keys($options) as $type) {
|
||||
if (!empty($options[$type])) {
|
||||
|
|
|
@ -84,21 +84,21 @@ class View extends AreaPluginBase {
|
|||
|
||||
$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.'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ use Drupal\views\Views;
|
|||
* - 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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
'#markup' => '<div class="clearfix"></div>',
|
||||
);
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
);
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
// 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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
'#suffix' => '</div>',
|
||||
'#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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
);
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
);
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
|
||||
$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 @@ abstract class ArgumentPluginBase extends HandlerBase {
|
|||
* 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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,7 +32,7 @@ class GroupByNumeric extends ArgumentPluginBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSortName() {
|
||||
return t('Numerical', array(), array('context' => 'Sort order'));
|
||||
return $this->t('Numerical', array(), array('context' => 'Sort order'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class LanguageArgument extends ArgumentPluginBase {
|
|||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -69,23 +69,23 @@ class ManyToOne extends ArgumentPluginBase {
|
|||
// 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 @@ class ManyToOne extends ArgumentPluginBase {
|
|||
|
||||
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 @@ class ManyToOne extends ArgumentPluginBase {
|
|||
// @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());
|
||||
|
|
|
@ -32,9 +32,9 @@ class Null extends ArgumentPluginBase {
|
|||
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',
|
||||
);
|
||||
|
||||
|
|
|
@ -46,16 +46,16 @@ class Numeric extends ArgumentPluginBase {
|
|||
// 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 @@ class Numeric extends ArgumentPluginBase {
|
|||
|
||||
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 @@ class Numeric extends ArgumentPluginBase {
|
|||
}
|
||||
|
||||
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 @@ class Numeric extends ArgumentPluginBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSortName() {
|
||||
return t('Numerical', array(), array('context' => 'Sort order'));
|
||||
return $this->t('Numerical', array(), array('context' => 'Sort order'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -60,16 +60,16 @@ class String extends ArgumentPluginBase {
|
|||
|
||||
$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 @@ class String extends ArgumentPluginBase {
|
|||
|
||||
$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 @@ class String extends ArgumentPluginBase {
|
|||
|
||||
$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 @@ class String extends ArgumentPluginBase {
|
|||
|
||||
$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 @@ class String extends ArgumentPluginBase {
|
|||
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 @@ class String extends ArgumentPluginBase {
|
|||
// 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 @@ class String extends ArgumentPluginBase {
|
|||
* {@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 @@ class String extends ArgumentPluginBase {
|
|||
}
|
||||
|
||||
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());
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue