class TranslationWrapper in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php \Drupal\Core\StringTranslation\TranslationWrapper
Provides translatable string class.
Hierarchy
- class \Drupal\Component\Render\FormattableMarkup implements \Drupal\Component\Render\Countable, MarkupInterface
- class \Drupal\Core\StringTranslation\TranslatableMarkup uses ToStringTrait
- class \Drupal\Core\StringTranslation\TranslationWrapper
- class \Drupal\Core\StringTranslation\TranslatableMarkup uses ToStringTrait
Expanded class hierarchy of TranslationWrapper
Deprecated
in drupal:8.0.0 and is removed from drupal:10.0.0. Use the \Drupal\Core\StringTranslation\TranslatableMarkup class instead.
See also
https://www.drupal.org/node/2571255
1 file declares its use of TranslationWrapper
- TranslationWrapperTest.php in core/
tests/ Drupal/ Tests/ Core/ StringTranslation/ TranslationWrapperTest.php
File
- core/
lib/ Drupal/ Core/ StringTranslation/ TranslationWrapper.php, line 13
Namespace
Drupal\Core\StringTranslationView source
class TranslationWrapper extends TranslatableMarkup {
/**
* {@inheritdoc}
*/
public function __construct($string, array $arguments = [], array $options = [], TranslationInterface $string_translation = NULL) {
@trigger_error(__CLASS__ . ' is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the \\Drupal\\Core\\StringTranslation\\TranslatableMarkup class instead. See https://www.drupal.org/node/2571255', E_USER_DEPRECATED);
parent::__construct($string, $arguments, $options, $string_translation);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FormattableMarkup:: |
protected | property | The arguments to replace placeholders with. | |
FormattableMarkup:: |
protected | property | The string containing placeholders. | |
FormattableMarkup:: |
public | function | Returns a representation of the object for use in JSON serialization. | |
FormattableMarkup:: |
protected static | function | Escapes a placeholder replacement value if needed. | |
FormattableMarkup:: |
protected static | function | Replaces placeholders in a string with values. | |
ToStringTrait:: |
protected | function | For test purposes, wrap die() in an overridable method. | |
ToStringTrait:: |
public | function | Implements the magic __toString() method. | |
TranslatableMarkup:: |
protected | property | The translation options. | |
TranslatableMarkup:: |
protected | property | The string translation service. | |
TranslatableMarkup:: |
protected | property | The translated markup without placeholder replacements. | |
TranslatableMarkup:: |
public | function |
Returns the string length. Overrides FormattableMarkup:: |
|
TranslatableMarkup:: |
public | function | Gets all arguments from this translated string. | |
TranslatableMarkup:: |
public | function | Gets a specific option from this translated string. | |
TranslatableMarkup:: |
public | function | Gets all options from this translated string. | |
TranslatableMarkup:: |
protected | function | Gets the string translation service. | |
TranslatableMarkup:: |
public | function | Gets the untranslated string value stored in this translated string. | |
TranslatableMarkup:: |
public | function |
Renders the object as a string. Overrides ToStringTrait:: |
1 |
TranslatableMarkup:: |
public | function | Magic __sleep() method to avoid serializing the string translator. | 1 |
TranslationWrapper:: |
public | function |
Constructs a new class instance. Overrides TranslatableMarkup:: |