use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\ToStringTrait;
-use Drupal\Component\Utility\Unicode;
/**
* Provides translatable markup class.
use ToStringTrait;
- /**
- * The string to be translated.
- *
- * @var string
- */
- protected $string;
-
/**
* The translated markup without placeholder replacements.
*
$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;
}
* The length of the string.
*/
public function count() {
- return Unicode::strlen($this->render());
+ return mb_strlen($this->render());
}
}