Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / StringTranslation / TranslatableMarkup.php
index 80162125850fc95314e7cab8444fccfee5e8b3ca..dcff3fc3b23169f9f7a2441805685521346f3d66 100644 (file)
@@ -4,7 +4,6 @@ namespace Drupal\Core\StringTranslation;
 
 use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Component\Utility\ToStringTrait;
-use Drupal\Component\Utility\Unicode;
 
 /**
  * Provides translatable markup class.
@@ -23,13 +22,6 @@ class TranslatableMarkup extends FormattableMarkup {
 
   use ToStringTrait;
 
-  /**
-   * The string to be translated.
-   *
-   * @var string
-   */
-  protected $string;
-
   /**
    * The translated markup without placeholder replacements.
    *
@@ -139,8 +131,7 @@ class TranslatableMarkup extends FormattableMarkup {
       $message = $string instanceof TranslatableMarkup ? '$string ("' . $string->getUntranslatedString() . '") must be a string.' : '$string ("' . (string) $string . '") must be a string.';
       throw new \InvalidArgumentException($message);
     }
-    $this->string = $string;
-    $this->arguments = $arguments;
+    parent::__construct($string, $arguments);
     $this->options = $options;
     $this->stringTranslation = $string_translation;
   }
@@ -234,7 +225,7 @@ class TranslatableMarkup extends FormattableMarkup {
    *   The length of the string.
    */
   public function count() {
-    return Unicode::strlen($this->render());
+    return mb_strlen($this->render());
   }
 
 }