diff --git a/core/lib/Drupal/Core/Render/Element/Actions.php b/core/lib/Drupal/Core/Render/Element/Actions.php
index 3b8b10b..1f94466 100644
--- a/core/lib/Drupal/Core/Render/Element/Actions.php
+++ b/core/lib/Drupal/Core/Render/Element/Actions.php
@@ -17,7 +17,7 @@
  * $form['actions'] = array('#type' => 'actions');
  * $form['actions']['submit'] = array(
  *   '#type' => 'submit',
- *   '#value' => t('Save'),
+ *   '#value' => $this->t('Save'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Checkbox.php b/core/lib/Drupal/Core/Render/Element/Checkbox.php
index 266af5a..c9b8817 100644
--- a/core/lib/Drupal/Core/Render/Element/Checkbox.php
+++ b/core/lib/Drupal/Core/Render/Element/Checkbox.php
@@ -15,7 +15,7 @@
  * @code
  * $form['copy'] = array(
  *   '#type' => 'checkbox',
- *   '#title' => t('Send me a copy'),
+ *   '#title' => $this->t('Send me a copy'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Checkboxes.php b/core/lib/Drupal/Core/Render/Element/Checkboxes.php
index 989c0e6..8487a09 100644
--- a/core/lib/Drupal/Core/Render/Element/Checkboxes.php
+++ b/core/lib/Drupal/Core/Render/Element/Checkboxes.php
@@ -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
diff --git a/core/lib/Drupal/Core/Render/Element/Color.php b/core/lib/Drupal/Core/Render/Element/Color.php
index 7cffdcd..7c705a8 100644
--- a/core/lib/Drupal/Core/Render/Element/Color.php
+++ b/core/lib/Drupal/Core/Render/Element/Color.php
@@ -16,7 +16,7 @@
  * @code
  * $form['color'] = array(
  *   '#type' => 'color',
- *   '#title' => 'Color',
+ *   '#title' => $this->('Color'),
  *   '#default_value' => '#ffffff',
  * );
  * @endcode
diff --git a/core/lib/Drupal/Core/Render/Element/Container.php b/core/lib/Drupal/Core/Render/Element/Container.php
index 8a2aa12..b594103 100644
--- a/core/lib/Drupal/Core/Render/Element/Container.php
+++ b/core/lib/Drupal/Core/Render/Element/Container.php
@@ -15,7 +15,7 @@
  * @code
  * $form['needs_accommodation'] = array(
  *   '#type' => 'checkbox',
- *   '#title' => 'Need Special Accommodations?',
+ *   '#title' => $this->('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
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Date.php b/core/lib/Drupal/Core/Render/Element/Date.php
index e322e71..e318a23 100644
--- a/core/lib/Drupal/Core/Render/Element/Date.php
+++ b/core/lib/Drupal/Core/Render/Element/Date.php
@@ -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
diff --git a/core/lib/Drupal/Core/Render/Element/Details.php b/core/lib/Drupal/Core/Render/Element/Details.php
index bd0f959..ae25d34 100644
--- a/core/lib/Drupal/Core/Render/Element/Details.php
+++ b/core/lib/Drupal/Core/Render/Element/Details.php
@@ -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
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Email.php b/core/lib/Drupal/Core/Render/Element/Email.php
index 72e1107..4b4da7b 100644
--- a/core/lib/Drupal/Core/Render/Element/Email.php
+++ b/core/lib/Drupal/Core/Render/Element/Email.php
@@ -15,7 +15,7 @@
  * @code
  * $form['email'] = array(
  *   '#type' => 'email',
- *   '#title' => t('Email'),
+ *   '#title' => $this->t('Email'),
  * );
  * @end
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Fieldset.php b/core/lib/Drupal/Core/Render/Element/Fieldset.php
index f21b7de..4556df1 100644
--- a/core/lib/Drupal/Core/Render/Element/Fieldset.php
+++ b/core/lib/Drupal/Core/Render/Element/Fieldset.php
@@ -9,12 +9,12 @@
  * @code
  * $form['author'] = array(
  *   '#type' => 'fieldset',
- *   '#title' => 'Author',
+ *   '#title' => $this->('Author'),
  * );
  *
  * $form['author']['name'] = array(
  *   '#type' => 'textfield',
- *   '#title' => t('Name'),
+ *   '#title' => $this->t('Name'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Number.php b/core/lib/Drupal/Core/Render/Element/Number.php
index b9a19da..b2fbb11 100644
--- a/core/lib/Drupal/Core/Render/Element/Number.php
+++ b/core/lib/Drupal/Core/Render/Element/Number.php
@@ -21,7 +21,7 @@
  * @code
  * $form['quantity'] = array(
  *   '#type' => 'number',
- *   '#title' => t('Quantity'),
+ *   '#title' => $this->t('Quantity'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Password.php b/core/lib/Drupal/Core/Render/Element/Password.php
index 4eb0be8..4c3e6c8 100644
--- a/core/lib/Drupal/Core/Render/Element/Password.php
+++ b/core/lib/Drupal/Core/Render/Element/Password.php
@@ -12,7 +12,7 @@
  * @code
  * $form['pass'] = array(
  *   '#type' => 'password',
- *   '#title => t('Password'),
+ *   '#title => $this->t('Password'),
  *   '#size' => 25,
  * );
  * @endcode
diff --git a/core/lib/Drupal/Core/Render/Element/PasswordConfirm.php b/core/lib/Drupal/Core/Render/Element/PasswordConfirm.php
index 83c97a5..6ebc750 100644
--- a/core/lib/Drupal/Core/Render/Element/PasswordConfirm.php
+++ b/core/lib/Drupal/Core/Render/Element/PasswordConfirm.php
@@ -14,7 +14,7 @@
  * @code
  * $form['pass'] = array(
  *   '#type' => 'password_confirm',
- *   '#title' => t('Password'),
+ *   '#title' => $this->t('Password'),
  *   '#size' => 25,
  * );
  * @endcode
diff --git a/core/lib/Drupal/Core/Render/Element/Radios.php b/core/lib/Drupal/Core/Render/Element/Radios.php
index 478bd44..e7179f4 100644
--- a/core/lib/Drupal/Core/Render/Element/Radios.php
+++ b/core/lib/Drupal/Core/Render/Element/Radios.php
@@ -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
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Range.php b/core/lib/Drupal/Core/Render/Element/Range.php
index acc5277..a4eace6 100644
--- a/core/lib/Drupal/Core/Render/Element/Range.php
+++ b/core/lib/Drupal/Core/Render/Element/Range.php
@@ -19,7 +19,7 @@
  * @code
  * $form['quantity'] = array(
  *   '#type' => 'number',
- *   '#title' => t('Quantity'),
+ *   '#title' => $this->t('Quantity'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Search.php b/core/lib/Drupal/Core/Render/Element/Search.php
index f1b3b84..45333c5 100644
--- a/core/lib/Drupal/Core/Render/Element/Search.php
+++ b/core/lib/Drupal/Core/Render/Element/Search.php
@@ -11,7 +11,7 @@
  * @code
  * $form['search'] = array(
  *   '#type' => 'search',
- *   '#title' => t('Search'),
+ *   '#title' => $this->t('Search'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Select.php b/core/lib/Drupal/Core/Render/Element/Select.php
index eeb12bd..f78dfa9 100644
--- a/core/lib/Drupal/Core/Render/Element/Select.php
+++ b/core/lib/Drupal/Core/Render/Element/Select.php
@@ -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
diff --git a/core/lib/Drupal/Core/Render/Element/Table.php b/core/lib/Drupal/Core/Render/Element/Table.php
index b05d4ad..2da6ef9 100644
--- a/core/lib/Drupal/Core/Render/Element/Table.php
+++ b/core/lib/Drupal/Core/Render/Element/Table.php
@@ -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]),
    *   );
    * }
diff --git a/core/lib/Drupal/Core/Render/Element/Tableselect.php b/core/lib/Drupal/Core/Render/Element/Tableselect.php
index 62f2ff2..75c7aa4 100644
--- a/core/lib/Drupal/Core/Render/Element/Tableselect.php
+++ b/core/lib/Drupal/Core/Render/Element/Tableselect.php
@@ -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->('How to Learn Drupal'),
+   *         'content_type' => $this->('Article'),
    *         'status' => 'published',
    *         '#attributes' => array('class' => array('article-row')),
    *       ),
    *       array(
-   *         'title' => 'Privacy Policy',
-   *         'content_type' => 'Page',
+   *         'title' => $this->('Privacy Policy'),
+   *         'content_type' => $this->('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
    *
diff --git a/core/lib/Drupal/Core/Render/Element/Tel.php b/core/lib/Drupal/Core/Render/Element/Tel.php
index 2c849bc..02b071d 100644
--- a/core/lib/Drupal/Core/Render/Element/Tel.php
+++ b/core/lib/Drupal/Core/Render/Element/Tel.php
@@ -14,7 +14,7 @@
  * @code
  * $form['phone'] = array(
  *   '#type' => 'tel',
- *   '#title' => t('Phone'),
+ *   '#title' => $this->t('Phone'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Textarea.php b/core/lib/Drupal/Core/Render/Element/Textarea.php
index fc661e8..6adb18c 100644
--- a/core/lib/Drupal/Core/Render/Element/Textarea.php
+++ b/core/lib/Drupal/Core/Render/Element/Textarea.php
@@ -17,7 +17,7 @@
  * @code
  * $form['text'] = array(
  *   '#type' => 'textarea',
- *   '#title' => t('Text'),
+ *   '#title' => $this->t('Text'),
  * );
  * @endcode
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Textfield.php b/core/lib/Drupal/Core/Render/Element/Textfield.php
index 4a47363..1cb35e8 100644
--- a/core/lib/Drupal/Core/Render/Element/Textfield.php
+++ b/core/lib/Drupal/Core/Render/Element/Textfield.php
@@ -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,
diff --git a/core/lib/Drupal/Core/Render/Element/Url.php b/core/lib/Drupal/Core/Render/Element/Url.php
index 666ec71..33d91ed 100644
--- a/core/lib/Drupal/Core/Render/Element/Url.php
+++ b/core/lib/Drupal/Core/Render/Element/Url.php
@@ -16,7 +16,7 @@
  * @code
  * $form['homepage'] = array(
  *   '#type' => 'url',
- *   '#title' => t('Home Page'),
+ *   '#title' => $this->t('Home Page'),
  *   '#size' => 30,
  *   ...
  * );
diff --git a/core/lib/Drupal/Core/Render/Element/VerticalTabs.php b/core/lib/Drupal/Core/Render/Element/VerticalTabs.php
index 73d9f31..f1fbfad 100644
--- a/core/lib/Drupal/Core/Render/Element/VerticalTabs.php
+++ b/core/lib/Drupal/Core/Render/Element/VerticalTabs.php
@@ -24,24 +24,24 @@
  *
  * $form['author'] = array(
  *   '#type' => 'details',
- *   '#title' => 'Author',
+ *   '#title' => $this->('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
  *
diff --git a/core/lib/Drupal/Core/Render/Element/Weight.php b/core/lib/Drupal/Core/Render/Element/Weight.php
index bfb2a22..a6ecbee 100644
--- a/core/lib/Drupal/Core/Render/Element/Weight.php
+++ b/core/lib/Drupal/Core/Render/Element/Weight.php
@@ -18,7 +18,7 @@
  * @code
  * $form['weight'] = array(
  *   '#type' => 'weight',
- *   '#title' => t('Weight'),
+ *   '#title' => $this->t('Weight'),
  *   '#default_value' => $edit['weight'],
  *   '#delta' => 10,
  * );
