diff -u b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php --- b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php @@ -62,6 +62,9 @@ * (optional) An array of additional options. */ public function __construct($string, array $arguments = array(), array $options = array()) { + assert('$string !== \'\' && (empty($arguments) || strtr($string, $arguments) !== \'\')', 'Empty strings cannot be translated.'); + assert('empty($arguments) || strtr($string, $arguments) != implode($arguments)', 'Unnecessary translation: ' . $string); + // @todo assert that $string is a string. $this->string = $string; $this->arguments = $arguments; $this->options = $options; @@ -117,9 +120,6 @@ * The translated string. */ public function render() { - if ($this->string === '') { - return ''; - } return $this->getStringTranslation()->renderTranslatedString($this); }