Commit 6b26b0cd authored by alexpott's avatar alexpott

Issue #2709411 by dagmar, jhodgdon: t() is used in an inconsistent way on...

Issue #2709411 by dagmar, jhodgdon: t() is used in an inconsistent way on Drupal\Core\Render\Element documentation
parent 2b4da58b
......@@ -17,7 +17,7 @@
* $form['actions'] = array('#type' => 'actions');
* $form['actions']['submit'] = array(
* '#type' => 'submit',
* '#value' => t('Save'),
* '#value' => $this->t('Save'),
* );
* @endcode
*
......
......@@ -15,7 +15,7 @@
* @code
* $form['copy'] = array(
* '#type' => 'checkbox',
* '#title' => t('Send me a copy'),
* '#title' => $this->t('Send me a copy'),
* );
* @endcode
*
......
......@@ -17,8 +17,8 @@
* @code
* $form['high_school']['tests_taken'] = array(
* '#type' => 'checkboxes',
* '#options' => array('SAT' => t('SAT'), 'ACT' => t('ACT'))),
* '#title' => t('What standardized tests did you take?'),
* '#options' => array('SAT' => $this->t('SAT'), 'ACT' => $this->t('ACT'))),
* '#title' => $this->t('What standardized tests did you take?'),
* ...
* );
* @endcode
......
......@@ -16,7 +16,7 @@
* @code
* $form['color'] = array(
* '#type' => 'color',
* '#title' => 'Color',
* '#title' => $this->t('Color'),
* '#default_value' => '#ffffff',
* );
* @endcode
......
......@@ -15,7 +15,7 @@
* @code
* $form['needs_accommodation'] = array(
* '#type' => 'checkbox',
* '#title' => 'Need Special Accommodations?',
* '#title' => $this->t('Need Special Accommodations?'),
* );
*
* $form['accommodation'] = array(
......@@ -32,7 +32,7 @@
*
* $form['accommodation']['diet'] = array(
* '#type' => 'textfield',
* '#title' => t('Dietary Restrictions'),
* '#title' => $this->t('Dietary Restrictions'),
* );
* @endcode
*
......
......@@ -15,7 +15,7 @@
* @code
* $form['expiration'] = array(
* '#type' => 'date',
* '#title' => t('Content expiration'),
* '#title' => $this->t('Content expiration'),
* '#default_value' => array('year' => 2020, 'month' => 2, 'day' => 15,)
* );
* @endcode
......
......@@ -20,12 +20,12 @@
* @code
* $form['author'] = array(
* '#type' => 'details',
* '#title' => 'Author',
* '#title' => $this->t('Author'),
* );
*
* $form['author']['name'] = array(
* '#type' => 'textfield',
* '#title' => t('Name'),
* '#title' => $this->t('Name'),
* );
* @endcode
*
......
......@@ -15,7 +15,7 @@
* @code
* $form['email'] = array(
* '#type' => 'email',
* '#title' => t('Email'),
* '#title' => $this->t('Email'),
* );
* @end
*
......
......@@ -9,12 +9,12 @@
* @code
* $form['author'] = array(
* '#type' => 'fieldset',
* '#title' => 'Author',
* '#title' => $this->t('Author'),
* );
*
* $form['author']['name'] = array(
* '#type' => 'textfield',
* '#title' => t('Name'),
* '#title' => $this->t('Name'),
* );
* @endcode
*
......
......@@ -21,7 +21,7 @@
* @code
* $form['quantity'] = array(
* '#type' => 'number',
* '#title' => t('Quantity'),
* '#title' => $this->t('Quantity'),
* );
* @endcode
*
......
......@@ -12,7 +12,7 @@
* @code
* $form['pass'] = array(
* '#type' => 'password',
* '#title => t('Password'),
* '#title => $this->t('Password'),
* '#size' => 25,
* );
* @endcode
......
......@@ -14,7 +14,7 @@
* @code
* $form['pass'] = array(
* '#type' => 'password_confirm',
* '#title' => t('Password'),
* '#title' => $this->t('Password'),
* '#size' => 25,
* );
* @endcode
......
......@@ -16,9 +16,9 @@
* @code
* $form['settings']['active'] = array(
* '#type' => 'radios',
* '#title' => t('Poll status'),
* '#title' => $this->t('Poll status'),
* '#default_value' => 1,
* '#options' => array(0 => t('Closed'), 1 => t('Active')),
* '#options' => array(0 => $this->t('Closed'), 1 => $this->t('Active')),
* );
* @endcode
*
......
......@@ -19,7 +19,7 @@
* @code
* $form['quantity'] = array(
* '#type' => 'number',
* '#title' => t('Quantity'),
* '#title' => $this->t('Quantity'),
* );
* @endcode
*
......
......@@ -11,7 +11,7 @@
* @code
* $form['search'] = array(
* '#type' => 'search',
* '#title' => t('Search'),
* '#title' => $this->t('Search'),
* );
* @endcode
*
......
......@@ -21,14 +21,14 @@
* @code
* $form['example_select'] = [
* '#type' => 'select',
* '#title' => t('Select element'),
* '#title' => $this->t('Select element'),
* '#options' => [
* '1' => t('One'),
* '1' => $this->t('One'),
* '2' => [
* '2.1' => t('Two point one'),
* '2.2' => t('Two point two'),
* '2.1' => $this->t('Two point one'),
* '2.2' => $this->t('Two point two'),
* ],
* '3' => t('Three'),
* '3' => $this->t('Three'),
* ],
* ];
* @endcode
......
......@@ -29,20 +29,20 @@
* @code
* $form['contacts'] = array(
* '#type' => 'table',
* '#caption' => 'Sample Table',
* '#header' => array('Name', 'Phone'),
* '#caption' => $this->t('Sample Table'),
* '#header' => array($this->t('Name'), $this->t('Phone')),
* );
*
* for ($i=1; $i<=4; $i++) {
* $form['contacts'][$i]['name'] = array(
* '#type' => 'textfield',
* '#title' => t('Name'),
* '#title' => $this->t('Name'),
* '#title_display' => 'invisible',
* );
*
* $form['contacts'][$i]['phone'] = array(
* '#type' => 'tel',
* '#title' => t('Phone'),
* '#title' => $this->t('Phone'),
* '#title_display' => 'invisible',
* );
* }
......@@ -279,7 +279,7 @@ public static function validateTable(&$element, FormStateInterface $form_state,
* @code
* $form['table'] = array(
* '#type' => 'table',
* '#header' => array(t('Title'), array('data' => t('Operations'), 'colspan' => '1')),
* '#header' => array($this->t('Title'), array('data' => $this->t('Operations'), 'colspan' => '1')),
* // Optionally, to add tableDrag support:
* '#tabledrag' => array(
* array(
......@@ -301,7 +301,7 @@ public static function validateTable(&$element, FormStateInterface $form_state,
* $form['table'][$row]['#attributes']['class'][] = 'draggable';
* $form['table'][$row]['weight'] = array(
* '#type' => 'textfield',
* '#title' => t('Weight for @title', array('@title' => $thing['title'])),
* '#title' => $this->t('Weight for @title', array('@title' => $thing['title'])),
* '#title_display' => 'invisible',
* '#size' => 4,
* '#default_value' => $thing['weight'],
......@@ -312,7 +312,7 @@ public static function validateTable(&$element, FormStateInterface $form_state,
* // attribute in #header above.
* $form['table'][$row]['edit'] = array(
* '#type' => 'link',
* '#title' => t('Edit'),
* '#title' => $this->t('Edit'),
* '#url' => Url::fromRoute('entity.test_entity.edit_form', ['test_entity' => $row]),
* );
* }
......
......@@ -26,8 +26,8 @@
* Usage example:
* @code
* $header = [
* 'first_name' => t('First Name'),
* 'last_name' => t('Last Name'),
* 'first_name' => $this->t('First Name'),
* 'last_name' => $this->t('Last Name'),
* ];
*
* $options = [
......@@ -40,7 +40,7 @@
* '#type' => 'tableselect',
* '#header' => $header,
* '#options' => $options,
* '#empty' => t('No users found'),
* '#empty' => $this->t('No users found'),
* );
* @endcode
*
......@@ -118,28 +118,28 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
* @code
* $options = array(
* array(
* 'title' => 'How to Learn Drupal',
* 'content_type' => 'Article',
* 'title' => $this->t('How to Learn Drupal'),
* 'content_type' => $this->t('Article'),
* 'status' => 'published',
* '#attributes' => array('class' => array('article-row')),
* ),
* array(
* 'title' => 'Privacy Policy',
* 'content_type' => 'Page',
* 'title' => $this->t('Privacy Policy'),
* 'content_type' => $this->t('Page'),
* 'status' => 'published',
* '#attributes' => array('class' => array('page-row')),
* ),
* );
* $header = array(
* 'title' => t('Title'),
* 'content_type' => t('Content type'),
* 'status' => t('Status'),
* 'title' => $this->t('Title'),
* 'content_type' => $this->t('Content type'),
* 'status' => $this->t('Status'),
* );
* $form['table'] = array(
* '#type' => 'tableselect',
* '#header' => $header,
* '#options' => $options,
* '#empty' => t('No content available.'),
* '#empty' => $this->t('No content available.'),
* );
* @endcode
*
......
......@@ -14,7 +14,7 @@
* @code
* $form['phone'] = array(
* '#type' => 'tel',
* '#title' => t('Phone'),
* '#title' => $this->t('Phone'),
* );
* @endcode
*
......
......@@ -17,7 +17,7 @@
* @code
* $form['text'] = array(
* '#type' => 'textarea',
* '#title' => t('Text'),
* '#title' => $this->t('Text'),
* );
* @endcode
*
......
......@@ -20,7 +20,7 @@
* @code
* $form['title'] = array(
* '#type' => 'textfield',
* '#title' => t('Subject'),
* '#title' => $this->t('Subject'),
* '#default_value' => $node->title,
* '#size' => 60,
* '#maxlength' => 128,
......
......@@ -16,7 +16,7 @@
* @code
* $form['homepage'] = array(
* '#type' => 'url',
* '#title' => t('Home Page'),
* '#title' => $this->t('Home Page'),
* '#size' => 30,
* ...
* );
......
......@@ -24,24 +24,24 @@
*
* $form['author'] = array(
* '#type' => 'details',
* '#title' => 'Author',
* '#title' => $this->t('Author'),
* '#group' => 'information',
* );
*
* $form['author']['name'] = array(
* '#type' => 'textfield',
* '#title' => t('Name'),
* '#title' => $this->t('Name'),
* );
*
* $form['publication'] = array(
* '#type' => 'details',
* '#title' => t('Publication'),
* '#title' => $this->t('Publication'),
* '#group' => 'information',
* );
*
* $form['publication']['publisher'] = array(
* '#type' => 'textfield',
* '#title' => t('Publisher'),
* '#title' => $this->t('Publisher'),
* );
* @endcode
*
......
......@@ -18,7 +18,7 @@
* @code
* $form['weight'] = array(
* '#type' => 'weight',
* '#title' => t('Weight'),
* '#title' => $this->t('Weight'),
* '#default_value' => $edit['weight'],
* '#delta' => 10,
* );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment