diff --git a/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php b/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php
new file mode 100644
index 0000000..d98245c
--- /dev/null
+++ b/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\StringTranslation\StringTranslationTrait.
+ */
+
+namespace Drupal\Core\StringTranslation;
+
+/**
+ * Provides a t() method to use when translating strings in class context.
+ *
+ * The recommended/supported way to work with injected translation in Drupal 8
+ * so that our string extractor can find strings is by using a protected t()
+ * method inside the class.
+ * \Drupal\Core\Form\FormBase and \Drupal\Core\Controller\ControllerBase already
+ * provide one.
+ * If your class is neither a controller or form, a t() method should be created
+ * and connected with the injected string_translation service.
+ * If your module depends on PHP 5.4 you can use this trait instead.
+ *
+ * @link https://drupal.org/node/2079611 provides examples. @endlink
+ */
+trait StringTranslationTrait {
+
+  /**
+   * The translation manager.
+   *
+   * @var \Drupal\Core\StringTranslation\TranslationInterface
+   */
+  protected $translationManager;
+
+  /**
+   * Translates a string to the current language or to a given language.
+   *
+   * See the t() documentation for details.
+   */
+  protected function t($string, array $args = array(), array $options = array()) {
+    return $this->getTranslationManager()->translate($string, $args, $options);
+  }
+
+  /**
+   * Gets the translation manager.
+   *
+   * @return \Drupal\Core\StringTranslation\TranslationInterface
+   *   The translation manager.
+   */
+  protected function getTranslationManager() {
+    if (!$this->translationManager) {
+      $this->translationManager = \Drupal::service('string_translation');
+    }
+    return $this->translationManager;
+  }
+
+ /**
+   * Sets the string translation service to use.
+   *
+   * @param \Drupal\Core\StringTranslation\TranslationInterface $translation
+   *   The string translation service.
+   */
+  public function setTranslationManager(TranslationInterface $translation) {
+    $this->translationManager = $translation;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/StringTranslation/StringTranslationTraitMock.php b/core/lib/Drupal/Core/StringTranslation/StringTranslationTraitMock.php
new file mode 100644
index 0000000..87003d3
--- /dev/null
+++ b/core/lib/Drupal/Core/StringTranslation/StringTranslationTraitMock.php
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\StringTranslation\StringTranslationTraitMock.
+ */
+
+namespace Drupal\Core\StringTranslation;
+
+/**
+ * A mock class that uses the StringTranslationTrait for unit tests.
+ */
+class StringTranslationTraitMock {
+
+  use StringTranslationTrait;
+
+}
diff --git a/core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php b/core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php
new file mode 100644
index 0000000..ca588b3
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\StringTranslation\StringTranslationTraitTest.
+ */
+
+namespace Drupal\Tests\Core\StringTranslation;
+
+use Drupal\Tests\UnitTestCase;
+use Drupal\Core\StringTranslation\StringTranslationTraitMock;
+
+/**
+ * Tests the string translation trait.
+ *
+ * @see \Drupal\Core\StringTranslation\StringTranslationTrait
+ *
+ * @group Drupal
+ * @group StringTranslation
+ */
+class StringTranslationTraitTest extends UnitTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'String translation trait',
+      'description' => 'Tests the string translation trait.',
+      'group' => 'StringTranslation',
+    );
+  }
+
+  public function testT() {
+    if (version_compare(PHP_VERSION, '5.4.0', '<')) {
+      return;
+    }
+    $method = (new \ReflectionClass('\Drupal\Core\StringTranslation\StringTranslationTraitMock'))->getMethod('t');
+    $method->setAccessible(TRUE);
+
+    $translation = new StringTranslationTraitMock();
+    $translation->setTranslationManager($this->getStringTranslationStub());
+    $this->assertEquals('something', $method->invoke($translation, 'something'));
+  }
+
+}
