Constructs a new class instance. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object directly. Calling the trait's t() method or instantiating a new TranslatableMarkup object serves two purposes: - At run-time it translates user-visible text into the appropriate language. - Static analyzers detect calls to t() and new TranslatableMarkup, and add the first argument (the string to be translated) to the database of strings that need translation. These strings are expected to be in English, so the first argument should always be in English. To allow the site to be localized, it is important that all human-readable text that will be displayed on the site or sent to a user is made available in one of the ways supported by the @link https://www.drupal.org/node/322729 Localization API @endlink. See the @link https://www.drupal.org/node/322729 Localization API @endlink pages for more information, including recommendations on how to break up or not break up strings for translation. @section sec_translating_vars Translating Variables $string should always be an English literal string. $string should never contain a variable, such as: @code new TranslatableMarkup($text) @endcode There are several reasons for this: - Using a variable for $string that is user input is a security risk. - Using a variable for $string that has even guaranteed safe text (for example, user interface text provided literally in code), will not be picked up by the localization static text processor. (The parameter could be a variable if the entire string in $text has been passed into t() or new TranslatableMarkup() elsewhere as the first argument, but that strategy is not recommended.) It is especially important never to call new TranslatableMarkup($user_text) or t($user_text) where $user_text is some text that a user entered -- doing that can lead to cross-site scripting and other security problems. However, you can use variable substitution in your string, to put variable text such as user names or link URLs into translated text. Variable substitution looks like this: @code new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); @endcode Basically, you can put placeholders like @name into your string, and the method will substitute the sanitized values at translation time. (See the Localization API pages referenced above and the documentation of \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details about how to safely and correctly define variables in your string.) Translators can then rearrange the string as necessary for the language (e.g., in Spanish, it might be "blog de @name"). @param string $string A string containing the English text to translate. @param array $arguments (optional) An associative array of replacements to make after translation. Based on the first character of the key, the value is escaped and/or themed. See \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details. @param array $options (optional) An associative array of additional options, with the following elements: - 'langcode' (defaults to the current language): A language code, to translate to a language other than what is used to display the page. - 'context' (defaults to the empty context): The context the source string belongs to. @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation (optional) The string translation service. @throws \InvalidArgumentException Exception thrown when $string is not a string. @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() @ingroup sanitization Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
Magic __sleep() method to avoid serializing the string translator. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
Implements the magic __toString() method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
Returns the string length. @return int The length of the string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:227
Gets all arguments from this translated string. @return mixed[] The array of arguments. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
Gets a specific option from this translated string. @param string $name Option name. @return mixed The value of this option or empty string of option is not set. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
Gets all options from this translated string. @return mixed[] The array of options. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
Gets the untranslated string value stored in this translated string. @return string The string stored in this wrapper. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
Returns a representation of the object for use in JSON serialization. @return string The safe string content. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:118
Renders the object as a string. @return string The translated string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
Escapes a placeholder replacement value if needed. @param string|\Drupal\Component\Render\MarkupInterface $value A placeholder replacement value. @return string The properly escaped replacement value. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:264
Replaces placeholders in a string with values. @param string $string A string containing placeholders. The string itself is expected to be safe and correct HTML. Any unsafe content must be in $args and inserted via placeholders. @param array $args An associative array of replacements. Each array key should be the same as a placeholder in $string. The corresponding value should be a string or an object that implements \Drupal\Component\Render\MarkupInterface. The value replaces the placeholder in $string. Sanitization and formatting will be done before replacement. The type of sanitization and formatting depends on the first character of the key: - @variable: When the placeholder replacement value is: - A string, the replaced value in the returned string will be sanitized using \Drupal\Component\Utility\Html::escape(). - A MarkupInterface object, the replaced value in the returned string will not be sanitized. - A MarkupInterface object cast to a string, the replaced value in the returned string be forcibly sanitized using \Drupal\Component\Utility\Html::escape(). @code $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); @endcode Use this placeholder as the default choice for anything displayed on the site, but not within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - %variable: Use when the replacement value is to be wrapped in <em> tags. A call like: @code $string = "%output_text"; $arguments = ['%output_text' => 'text output here.']; $this->placeholderFormat($string, $arguments); @endcode makes the following HTML code: @code <em class="placeholder">text output here.</em> @endcode As with @variable, do not use this within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - :variable: Return value is escaped with \Drupal\Component\Utility\Html::escape() and filtered for dangerous protocols using UrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes: @code // Secure (with quotes): $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); // Insecure (without quotes): $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); @endcode When ":variable" comes from arbitrary user input, the result is secure, but not guaranteed to be a valid URL (which means the resulting output could fail HTML validation). To guarantee a valid URL, use Url::fromUri($user_input)->toString() (which either throws an exception or returns a well-formed URL) before passing the result into a ":variable" placeholder. @return string A formatted HTML string with the placeholders replaced. @ingroup sanitization @see \Drupal\Core\StringTranslation\TranslatableMarkup @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup @see \Drupal\Component\Utility\Html::escape() @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() @see \Drupal\Core\Url::fromUri() Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:194
For test purposes, wrap die() in an overridable method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
Gets the string translation service. @return \Drupal\Core\StringTranslation\TranslationInterface The string translation service. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
Constructs a new class instance. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object directly. Calling the trait's t() method or instantiating a new TranslatableMarkup object serves two purposes: - At run-time it translates user-visible text into the appropriate language. - Static analyzers detect calls to t() and new TranslatableMarkup, and add the first argument (the string to be translated) to the database of strings that need translation. These strings are expected to be in English, so the first argument should always be in English. To allow the site to be localized, it is important that all human-readable text that will be displayed on the site or sent to a user is made available in one of the ways supported by the @link https://www.drupal.org/node/322729 Localization API @endlink. See the @link https://www.drupal.org/node/322729 Localization API @endlink pages for more information, including recommendations on how to break up or not break up strings for translation. @section sec_translating_vars Translating Variables $string should always be an English literal string. $string should never contain a variable, such as: @code new TranslatableMarkup($text) @endcode There are several reasons for this: - Using a variable for $string that is user input is a security risk. - Using a variable for $string that has even guaranteed safe text (for example, user interface text provided literally in code), will not be picked up by the localization static text processor. (The parameter could be a variable if the entire string in $text has been passed into t() or new TranslatableMarkup() elsewhere as the first argument, but that strategy is not recommended.) It is especially important never to call new TranslatableMarkup($user_text) or t($user_text) where $user_text is some text that a user entered -- doing that can lead to cross-site scripting and other security problems. However, you can use variable substitution in your string, to put variable text such as user names or link URLs into translated text. Variable substitution looks like this: @code new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); @endcode Basically, you can put placeholders like @name into your string, and the method will substitute the sanitized values at translation time. (See the Localization API pages referenced above and the documentation of \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details about how to safely and correctly define variables in your string.) Translators can then rearrange the string as necessary for the language (e.g., in Spanish, it might be "blog de @name"). @param string $string A string containing the English text to translate. @param array $arguments (optional) An associative array of replacements to make after translation. Based on the first character of the key, the value is escaped and/or themed. See \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details. @param array $options (optional) An associative array of additional options, with the following elements: - 'langcode' (defaults to the current language): A language code, to translate to a language other than what is used to display the page. - 'context' (defaults to the empty context): The context the source string belongs to. @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation (optional) The string translation service. @throws \InvalidArgumentException Exception thrown when $string is not a string. @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() @ingroup sanitization Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
Magic __sleep() method to avoid serializing the string translator. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
Implements the magic __toString() method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
Returns the string length. @return int The length of the string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:227
Gets all arguments from this translated string. @return mixed[] The array of arguments. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
Gets a specific option from this translated string. @param string $name Option name. @return mixed The value of this option or empty string of option is not set. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
Gets all options from this translated string. @return mixed[] The array of options. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
Gets the untranslated string value stored in this translated string. @return string The string stored in this wrapper. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
Returns a representation of the object for use in JSON serialization. @return string The safe string content. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:118
Renders the object as a string. @return string The translated string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
Escapes a placeholder replacement value if needed. @param string|\Drupal\Component\Render\MarkupInterface $value A placeholder replacement value. @return string The properly escaped replacement value. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:264
Replaces placeholders in a string with values. @param string $string A string containing placeholders. The string itself is expected to be safe and correct HTML. Any unsafe content must be in $args and inserted via placeholders. @param array $args An associative array of replacements. Each array key should be the same as a placeholder in $string. The corresponding value should be a string or an object that implements \Drupal\Component\Render\MarkupInterface. The value replaces the placeholder in $string. Sanitization and formatting will be done before replacement. The type of sanitization and formatting depends on the first character of the key: - @variable: When the placeholder replacement value is: - A string, the replaced value in the returned string will be sanitized using \Drupal\Component\Utility\Html::escape(). - A MarkupInterface object, the replaced value in the returned string will not be sanitized. - A MarkupInterface object cast to a string, the replaced value in the returned string be forcibly sanitized using \Drupal\Component\Utility\Html::escape(). @code $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); @endcode Use this placeholder as the default choice for anything displayed on the site, but not within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - %variable: Use when the replacement value is to be wrapped in <em> tags. A call like: @code $string = "%output_text"; $arguments = ['%output_text' => 'text output here.']; $this->placeholderFormat($string, $arguments); @endcode makes the following HTML code: @code <em class="placeholder">text output here.</em> @endcode As with @variable, do not use this within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - :variable: Return value is escaped with \Drupal\Component\Utility\Html::escape() and filtered for dangerous protocols using UrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes: @code // Secure (with quotes): $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); // Insecure (without quotes): $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); @endcode When ":variable" comes from arbitrary user input, the result is secure, but not guaranteed to be a valid URL (which means the resulting output could fail HTML validation). To guarantee a valid URL, use Url::fromUri($user_input)->toString() (which either throws an exception or returns a well-formed URL) before passing the result into a ":variable" placeholder. @return string A formatted HTML string with the placeholders replaced. @ingroup sanitization @see \Drupal\Core\StringTranslation\TranslatableMarkup @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup @see \Drupal\Component\Utility\Html::escape() @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() @see \Drupal\Core\Url::fromUri() Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:194
For test purposes, wrap die() in an overridable method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
Gets the string translation service. @return \Drupal\Core\StringTranslation\TranslationInterface The string translation service. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
Constructs a new class instance. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object directly. Calling the trait's t() method or instantiating a new TranslatableMarkup object serves two purposes: - At run-time it translates user-visible text into the appropriate language. - Static analyzers detect calls to t() and new TranslatableMarkup, and add the first argument (the string to be translated) to the database of strings that need translation. These strings are expected to be in English, so the first argument should always be in English. To allow the site to be localized, it is important that all human-readable text that will be displayed on the site or sent to a user is made available in one of the ways supported by the @link https://www.drupal.org/node/322729 Localization API @endlink. See the @link https://www.drupal.org/node/322729 Localization API @endlink pages for more information, including recommendations on how to break up or not break up strings for translation. @section sec_translating_vars Translating Variables $string should always be an English literal string. $string should never contain a variable, such as: @code new TranslatableMarkup($text) @endcode There are several reasons for this: - Using a variable for $string that is user input is a security risk. - Using a variable for $string that has even guaranteed safe text (for example, user interface text provided literally in code), will not be picked up by the localization static text processor. (The parameter could be a variable if the entire string in $text has been passed into t() or new TranslatableMarkup() elsewhere as the first argument, but that strategy is not recommended.) It is especially important never to call new TranslatableMarkup($user_text) or t($user_text) where $user_text is some text that a user entered -- doing that can lead to cross-site scripting and other security problems. However, you can use variable substitution in your string, to put variable text such as user names or link URLs into translated text. Variable substitution looks like this: @code new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); @endcode Basically, you can put placeholders like @name into your string, and the method will substitute the sanitized values at translation time. (See the Localization API pages referenced above and the documentation of \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details about how to safely and correctly define variables in your string.) Translators can then rearrange the string as necessary for the language (e.g., in Spanish, it might be "blog de @name"). @param string $string A string containing the English text to translate. @param array $arguments (optional) An associative array of replacements to make after translation. Based on the first character of the key, the value is escaped and/or themed. See \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details. @param array $options (optional) An associative array of additional options, with the following elements: - 'langcode' (defaults to the current language): A language code, to translate to a language other than what is used to display the page. - 'context' (defaults to the empty context): The context the source string belongs to. @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation (optional) The string translation service. @throws \InvalidArgumentException Exception thrown when $string is not a string. @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() @ingroup sanitization Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
Magic __sleep() method to avoid serializing the string translator. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
Implements the magic __toString() method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
Returns the string length. @return int The length of the string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:227
Gets all arguments from this translated string. @return mixed[] The array of arguments. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
Gets a specific option from this translated string. @param string $name Option name. @return mixed The value of this option or empty string of option is not set. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
Gets all options from this translated string. @return mixed[] The array of options. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
Gets the untranslated string value stored in this translated string. @return string The string stored in this wrapper. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
Returns a representation of the object for use in JSON serialization. @return string The safe string content. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:118
Renders the object as a string. @return string The translated string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
Escapes a placeholder replacement value if needed. @param string|\Drupal\Component\Render\MarkupInterface $value A placeholder replacement value. @return string The properly escaped replacement value. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:264
Replaces placeholders in a string with values. @param string $string A string containing placeholders. The string itself is expected to be safe and correct HTML. Any unsafe content must be in $args and inserted via placeholders. @param array $args An associative array of replacements. Each array key should be the same as a placeholder in $string. The corresponding value should be a string or an object that implements \Drupal\Component\Render\MarkupInterface. The value replaces the placeholder in $string. Sanitization and formatting will be done before replacement. The type of sanitization and formatting depends on the first character of the key: - @variable: When the placeholder replacement value is: - A string, the replaced value in the returned string will be sanitized using \Drupal\Component\Utility\Html::escape(). - A MarkupInterface object, the replaced value in the returned string will not be sanitized. - A MarkupInterface object cast to a string, the replaced value in the returned string be forcibly sanitized using \Drupal\Component\Utility\Html::escape(). @code $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); @endcode Use this placeholder as the default choice for anything displayed on the site, but not within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - %variable: Use when the replacement value is to be wrapped in <em> tags. A call like: @code $string = "%output_text"; $arguments = ['%output_text' => 'text output here.']; $this->placeholderFormat($string, $arguments); @endcode makes the following HTML code: @code <em class="placeholder">text output here.</em> @endcode As with @variable, do not use this within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - :variable: Return value is escaped with \Drupal\Component\Utility\Html::escape() and filtered for dangerous protocols using UrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes: @code // Secure (with quotes): $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); // Insecure (without quotes): $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); @endcode When ":variable" comes from arbitrary user input, the result is secure, but not guaranteed to be a valid URL (which means the resulting output could fail HTML validation). To guarantee a valid URL, use Url::fromUri($user_input)->toString() (which either throws an exception or returns a well-formed URL) before passing the result into a ":variable" placeholder. @return string A formatted HTML string with the placeholders replaced. @ingroup sanitization @see \Drupal\Core\StringTranslation\TranslatableMarkup @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup @see \Drupal\Component\Utility\Html::escape() @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() @see \Drupal\Core\Url::fromUri() Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:194
For test purposes, wrap die() in an overridable method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
Gets the string translation service. @return \Drupal\Core\StringTranslation\TranslationInterface The string translation service. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
Constructs a new class instance. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object directly. Calling the trait's t() method or instantiating a new TranslatableMarkup object serves two purposes: - At run-time it translates user-visible text into the appropriate language. - Static analyzers detect calls to t() and new TranslatableMarkup, and add the first argument (the string to be translated) to the database of strings that need translation. These strings are expected to be in English, so the first argument should always be in English. To allow the site to be localized, it is important that all human-readable text that will be displayed on the site or sent to a user is made available in one of the ways supported by the @link https://www.drupal.org/node/322729 Localization API @endlink. See the @link https://www.drupal.org/node/322729 Localization API @endlink pages for more information, including recommendations on how to break up or not break up strings for translation. @section sec_translating_vars Translating Variables $string should always be an English literal string. $string should never contain a variable, such as: @code new TranslatableMarkup($text) @endcode There are several reasons for this: - Using a variable for $string that is user input is a security risk. - Using a variable for $string that has even guaranteed safe text (for example, user interface text provided literally in code), will not be picked up by the localization static text processor. (The parameter could be a variable if the entire string in $text has been passed into t() or new TranslatableMarkup() elsewhere as the first argument, but that strategy is not recommended.) It is especially important never to call new TranslatableMarkup($user_text) or t($user_text) where $user_text is some text that a user entered -- doing that can lead to cross-site scripting and other security problems. However, you can use variable substitution in your string, to put variable text such as user names or link URLs into translated text. Variable substitution looks like this: @code new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); @endcode Basically, you can put placeholders like @name into your string, and the method will substitute the sanitized values at translation time. (See the Localization API pages referenced above and the documentation of \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details about how to safely and correctly define variables in your string.) Translators can then rearrange the string as necessary for the language (e.g., in Spanish, it might be "blog de @name"). @param string $string A string containing the English text to translate. @param array $arguments (optional) An associative array of replacements to make after translation. Based on the first character of the key, the value is escaped and/or themed. See \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details. @param array $options (optional) An associative array of additional options, with the following elements: - 'langcode' (defaults to the current language): A language code, to translate to a language other than what is used to display the page. - 'context' (defaults to the empty context): The context the source string belongs to. @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation (optional) The string translation service. @throws \InvalidArgumentException Exception thrown when $string is not a string. @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() @ingroup sanitization Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
Magic __sleep() method to avoid serializing the string translator. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
Implements the magic __toString() method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
Returns the string length. @return int The length of the string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:227
Gets all arguments from this translated string. @return mixed[] The array of arguments. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
Gets a specific option from this translated string. @param string $name Option name. @return mixed The value of this option or empty string of option is not set. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
Gets all options from this translated string. @return mixed[] The array of options. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
Gets the untranslated string value stored in this translated string. @return string The string stored in this wrapper. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
Returns a representation of the object for use in JSON serialization. @return string The safe string content. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:118
Renders the object as a string. @return string The translated string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
Escapes a placeholder replacement value if needed. @param string|\Drupal\Component\Render\MarkupInterface $value A placeholder replacement value. @return string The properly escaped replacement value. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:264
Replaces placeholders in a string with values. @param string $string A string containing placeholders. The string itself is expected to be safe and correct HTML. Any unsafe content must be in $args and inserted via placeholders. @param array $args An associative array of replacements. Each array key should be the same as a placeholder in $string. The corresponding value should be a string or an object that implements \Drupal\Component\Render\MarkupInterface. The value replaces the placeholder in $string. Sanitization and formatting will be done before replacement. The type of sanitization and formatting depends on the first character of the key: - @variable: When the placeholder replacement value is: - A string, the replaced value in the returned string will be sanitized using \Drupal\Component\Utility\Html::escape(). - A MarkupInterface object, the replaced value in the returned string will not be sanitized. - A MarkupInterface object cast to a string, the replaced value in the returned string be forcibly sanitized using \Drupal\Component\Utility\Html::escape(). @code $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); @endcode Use this placeholder as the default choice for anything displayed on the site, but not within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - %variable: Use when the replacement value is to be wrapped in <em> tags. A call like: @code $string = "%output_text"; $arguments = ['%output_text' => 'text output here.']; $this->placeholderFormat($string, $arguments); @endcode makes the following HTML code: @code <em class="placeholder">text output here.</em> @endcode As with @variable, do not use this within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - :variable: Return value is escaped with \Drupal\Component\Utility\Html::escape() and filtered for dangerous protocols using UrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes: @code // Secure (with quotes): $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); // Insecure (without quotes): $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); @endcode When ":variable" comes from arbitrary user input, the result is secure, but not guaranteed to be a valid URL (which means the resulting output could fail HTML validation). To guarantee a valid URL, use Url::fromUri($user_input)->toString() (which either throws an exception or returns a well-formed URL) before passing the result into a ":variable" placeholder. @return string A formatted HTML string with the placeholders replaced. @ingroup sanitization @see \Drupal\Core\StringTranslation\TranslatableMarkup @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup @see \Drupal\Component\Utility\Html::escape() @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() @see \Drupal\Core\Url::fromUri() Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:194
For test purposes, wrap die() in an overridable method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
Gets the string translation service. @return \Drupal\Core\StringTranslation\TranslationInterface The string translation service. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
Constructs a new class instance. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object directly. Calling the trait's t() method or instantiating a new TranslatableMarkup object serves two purposes: - At run-time it translates user-visible text into the appropriate language. - Static analyzers detect calls to t() and new TranslatableMarkup, and add the first argument (the string to be translated) to the database of strings that need translation. These strings are expected to be in English, so the first argument should always be in English. To allow the site to be localized, it is important that all human-readable text that will be displayed on the site or sent to a user is made available in one of the ways supported by the @link https://www.drupal.org/node/322729 Localization API @endlink. See the @link https://www.drupal.org/node/322729 Localization API @endlink pages for more information, including recommendations on how to break up or not break up strings for translation. @section sec_translating_vars Translating Variables $string should always be an English literal string. $string should never contain a variable, such as: @code new TranslatableMarkup($text) @endcode There are several reasons for this: - Using a variable for $string that is user input is a security risk. - Using a variable for $string that has even guaranteed safe text (for example, user interface text provided literally in code), will not be picked up by the localization static text processor. (The parameter could be a variable if the entire string in $text has been passed into t() or new TranslatableMarkup() elsewhere as the first argument, but that strategy is not recommended.) It is especially important never to call new TranslatableMarkup($user_text) or t($user_text) where $user_text is some text that a user entered -- doing that can lead to cross-site scripting and other security problems. However, you can use variable substitution in your string, to put variable text such as user names or link URLs into translated text. Variable substitution looks like this: @code new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); @endcode Basically, you can put placeholders like @name into your string, and the method will substitute the sanitized values at translation time. (See the Localization API pages referenced above and the documentation of \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details about how to safely and correctly define variables in your string.) Translators can then rearrange the string as necessary for the language (e.g., in Spanish, it might be "blog de @name"). @param string $string A string containing the English text to translate. @param array $arguments (optional) An associative array of replacements to make after translation. Based on the first character of the key, the value is escaped and/or themed. See \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details. @param array $options (optional) An associative array of additional options, with the following elements: - 'langcode' (defaults to the current language): A language code, to translate to a language other than what is used to display the page. - 'context' (defaults to the empty context): The context the source string belongs to. @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation (optional) The string translation service. @throws \InvalidArgumentException Exception thrown when $string is not a string. @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() @ingroup sanitization Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
Magic __sleep() method to avoid serializing the string translator. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
Implements the magic __toString() method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
Returns the string length. @return int The length of the string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:227
Gets all arguments from this translated string. @return mixed[] The array of arguments. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
Gets a specific option from this translated string. @param string $name Option name. @return mixed The value of this option or empty string of option is not set. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
Gets all options from this translated string. @return mixed[] The array of options. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
Gets the untranslated string value stored in this translated string. @return string The string stored in this wrapper. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
Returns a representation of the object for use in JSON serialization. @return string The safe string content. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:118
Renders the object as a string. @return string The translated string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
Escapes a placeholder replacement value if needed. @param string|\Drupal\Component\Render\MarkupInterface $value A placeholder replacement value. @return string The properly escaped replacement value. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:264
Replaces placeholders in a string with values. @param string $string A string containing placeholders. The string itself is expected to be safe and correct HTML. Any unsafe content must be in $args and inserted via placeholders. @param array $args An associative array of replacements. Each array key should be the same as a placeholder in $string. The corresponding value should be a string or an object that implements \Drupal\Component\Render\MarkupInterface. The value replaces the placeholder in $string. Sanitization and formatting will be done before replacement. The type of sanitization and formatting depends on the first character of the key: - @variable: When the placeholder replacement value is: - A string, the replaced value in the returned string will be sanitized using \Drupal\Component\Utility\Html::escape(). - A MarkupInterface object, the replaced value in the returned string will not be sanitized. - A MarkupInterface object cast to a string, the replaced value in the returned string be forcibly sanitized using \Drupal\Component\Utility\Html::escape(). @code $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); @endcode Use this placeholder as the default choice for anything displayed on the site, but not within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - %variable: Use when the replacement value is to be wrapped in <em> tags. A call like: @code $string = "%output_text"; $arguments = ['%output_text' => 'text output here.']; $this->placeholderFormat($string, $arguments); @endcode makes the following HTML code: @code <em class="placeholder">text output here.</em> @endcode As with @variable, do not use this within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - :variable: Return value is escaped with \Drupal\Component\Utility\Html::escape() and filtered for dangerous protocols using UrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes: @code // Secure (with quotes): $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); // Insecure (without quotes): $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); @endcode When ":variable" comes from arbitrary user input, the result is secure, but not guaranteed to be a valid URL (which means the resulting output could fail HTML validation). To guarantee a valid URL, use Url::fromUri($user_input)->toString() (which either throws an exception or returns a well-formed URL) before passing the result into a ":variable" placeholder. @return string A formatted HTML string with the placeholders replaced. @ingroup sanitization @see \Drupal\Core\StringTranslation\TranslatableMarkup @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup @see \Drupal\Component\Utility\Html::escape() @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() @see \Drupal\Core\Url::fromUri() Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:194
For test purposes, wrap die() in an overridable method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
Gets the string translation service. @return \Drupal\Core\StringTranslation\TranslationInterface The string translation service. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
Constructs a new class instance. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object directly. Calling the trait's t() method or instantiating a new TranslatableMarkup object serves two purposes: - At run-time it translates user-visible text into the appropriate language. - Static analyzers detect calls to t() and new TranslatableMarkup, and add the first argument (the string to be translated) to the database of strings that need translation. These strings are expected to be in English, so the first argument should always be in English. To allow the site to be localized, it is important that all human-readable text that will be displayed on the site or sent to a user is made available in one of the ways supported by the @link https://www.drupal.org/node/322729 Localization API @endlink. See the @link https://www.drupal.org/node/322729 Localization API @endlink pages for more information, including recommendations on how to break up or not break up strings for translation. @section sec_translating_vars Translating Variables $string should always be an English literal string. $string should never contain a variable, such as: @code new TranslatableMarkup($text) @endcode There are several reasons for this: - Using a variable for $string that is user input is a security risk. - Using a variable for $string that has even guaranteed safe text (for example, user interface text provided literally in code), will not be picked up by the localization static text processor. (The parameter could be a variable if the entire string in $text has been passed into t() or new TranslatableMarkup() elsewhere as the first argument, but that strategy is not recommended.) It is especially important never to call new TranslatableMarkup($user_text) or t($user_text) where $user_text is some text that a user entered -- doing that can lead to cross-site scripting and other security problems. However, you can use variable substitution in your string, to put variable text such as user names or link URLs into translated text. Variable substitution looks like this: @code new TranslatableMarkup("@name's blog", array('@name' => $account->getDisplayName())); @endcode Basically, you can put placeholders like @name into your string, and the method will substitute the sanitized values at translation time. (See the Localization API pages referenced above and the documentation of \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details about how to safely and correctly define variables in your string.) Translators can then rearrange the string as necessary for the language (e.g., in Spanish, it might be "blog de @name"). @param string $string A string containing the English text to translate. @param array $arguments (optional) An associative array of replacements to make after translation. Based on the first character of the key, the value is escaped and/or themed. See \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details. @param array $options (optional) An associative array of additional options, with the following elements: - 'langcode' (defaults to the current language): A language code, to translate to a language other than what is used to display the page. - 'context' (defaults to the empty context): The context the source string belongs to. @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation (optional) The string translation service. @throws \InvalidArgumentException Exception thrown when $string is not a string. @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() @see \Drupal\Core\StringTranslation\StringTranslationTrait::t() @ingroup sanitization Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:129
Magic __sleep() method to avoid serializing the string translator. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:203
Implements the magic __toString() method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:13
Returns the string length. @return int The length of the string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:227
Gets all arguments from this translated string. @return mixed[] The array of arguments. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:178
Gets a specific option from this translated string. @param string $name Option name. @return mixed The value of this option or empty string of option is not set. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:158
Gets all options from this translated string. @return mixed[] The array of options. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:168
Gets the untranslated string value stored in this translated string. @return string The string stored in this wrapper. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:145
Returns a representation of the object for use in JSON serialization. @return string The safe string content. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:118
Renders the object as a string. @return string The translated string. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:188
Escapes a placeholder replacement value if needed. @param string|\Drupal\Component\Render\MarkupInterface $value A placeholder replacement value. @return string The properly escaped replacement value. Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:264
Replaces placeholders in a string with values. @param string $string A string containing placeholders. The string itself is expected to be safe and correct HTML. Any unsafe content must be in $args and inserted via placeholders. @param array $args An associative array of replacements. Each array key should be the same as a placeholder in $string. The corresponding value should be a string or an object that implements \Drupal\Component\Render\MarkupInterface. The value replaces the placeholder in $string. Sanitization and formatting will be done before replacement. The type of sanitization and formatting depends on the first character of the key: - @variable: When the placeholder replacement value is: - A string, the replaced value in the returned string will be sanitized using \Drupal\Component\Utility\Html::escape(). - A MarkupInterface object, the replaced value in the returned string will not be sanitized. - A MarkupInterface object cast to a string, the replaced value in the returned string be forcibly sanitized using \Drupal\Component\Utility\Html::escape(). @code $this->placeholderFormat('This will force HTML-escaping of the replacement value: @text', ['@text' => (string) $safe_string_interface_object)); @endcode Use this placeholder as the default choice for anything displayed on the site, but not within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - %variable: Use when the replacement value is to be wrapped in <em> tags. A call like: @code $string = "%output_text"; $arguments = ['%output_text' => 'text output here.']; $this->placeholderFormat($string, $arguments); @endcode makes the following HTML code: @code <em class="placeholder">text output here.</em> @endcode As with @variable, do not use this within HTML attributes, JavaScript, or CSS. Doing so is a security risk. - :variable: Return value is escaped with \Drupal\Component\Utility\Html::escape() and filtered for dangerous protocols using UrlHelper::stripDangerousProtocols(). Use this when using the "href" attribute, ensuring the attribute value is always wrapped in quotes: @code // Secure (with quotes): $this->placeholderFormat('<a href=":url">@variable</a>', [':url' => $url, '@variable' => $variable]); // Insecure (without quotes): $this->placeholderFormat('<a href=:url>@variable</a>', [':url' => $url, '@variable' => $variable]); @endcode When ":variable" comes from arbitrary user input, the result is secure, but not guaranteed to be a valid URL (which means the resulting output could fail HTML validation). To guarantee a valid URL, use Url::fromUri($user_input)->toString() (which either throws an exception or returns a well-formed URL) before passing the result into a ":variable" placeholder. @return string A formatted HTML string with the placeholders replaced. @ingroup sanitization @see \Drupal\Core\StringTranslation\TranslatableMarkup @see \Drupal\Core\StringTranslation\PluralTranslatableMarkup @see \Drupal\Component\Utility\Html::escape() @see \Drupal\Component\Utility\UrlHelper::stripDangerousProtocols() @see \Drupal\Core\Url::fromUri() Inherited from Drupal\Component\Render\FormattableMarkup Defined in <ROOT>/core/lib/Drupal/Component/Render/FormattableMarkup.php:194
For test purposes, wrap die() in an overridable method. Defined in <ROOT>/core/lib/Drupal/Component/Utility/ToStringTrait.php:31
Gets the string translation service. @return \Drupal\Core\StringTranslation\TranslationInterface The string translation service. Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php:213
{@inheritdoc} Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityType.php:32
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:30
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php:65
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:901
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:443
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:346
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:603
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:618
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:718
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:909
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:689
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:703
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:696
{@inheritdoc} Inherited from Drupal\Component\Plugin\Definition\PluginDefinition Defined in <ROOT>/core/lib/Drupal/Component/Plugin/Definition/PluginDefinition.php:49
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:782
{@inheritdoc} Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityType.php:62
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:886
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:815
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:761
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:523
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:841
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:848
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:464
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:457
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:407
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:400
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:768
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:667
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:639
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:632
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:552
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:855
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:862
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:775
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:423
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:625
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:804
{@inheritdoc} Inherited from Drupal\Component\Plugin\Definition\PluginDefinition Defined in <ROOT>/core/lib/Drupal/Component/Plugin/Definition/PluginDefinition.php:56
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:747
{@inheritdoc} Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityType.php:109
{@inheritdoc} Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityType.php:85
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:754
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:596
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:793
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:497
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:826
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:574
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:538
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:482
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:415
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:682
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:647
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:567
{@inheritdoc} Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityType.php:117
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:545
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:589
{@inheritdoc} Inherited from Drupal\Component\Plugin\Definition\PluginDefinition Defined in <ROOT>/core/lib/Drupal/Component/Plugin/Definition/PluginDefinition.php:34
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:879
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:372
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:393
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:386
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:739
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:379
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:450
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:732
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:359
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:610
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:430
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:893
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:530
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:474
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:674
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:655
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:559
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:504
Sets the string translation service to use. @param \Drupal\Core\StringTranslation\TranslationInterface $translation The string translation service. @return $this Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php:118
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:833
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:581
{@inheritdoc} Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/Entity/EntityType.php:725
{@inheritdoc} @throws \InvalidArgumentException If the provided class does not implement \Drupal\Core\Entity\ContentEntityStorageInterface. @see \Drupal\Core\Entity\ContentEntityStorageInterface Defined in <ROOT>/core/lib/Drupal/Core/Entity/ContentEntityType.php:75
Formats a string containing a count of items. @see \Drupal\Core\StringTranslation\TranslationInterface::formatPlural() Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php:79
Returns the number of plurals supported by a given language. @see \Drupal\locale\PluralFormulaInterface::getNumberOfPlurals() Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php:88
Gets the string translation service. @return \Drupal\Core\StringTranslation\TranslationInterface The string translation service. Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php:102
Translates a string to the current language or to a given language. See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines. In order for strings to be localized, make them available in one of the ways supported by the @link https://www.drupal.org/node/322729 Localization API @endlink. When possible, use the \Drupal\Core\StringTranslation\StringTranslationTrait $this->t(). Otherwise create a new \Drupal\Core\StringTranslation\TranslatableMarkup object. @param string $string A string containing the English text to translate. @param array $args (optional) An associative array of replacements to make after translation. Based on the first character of the key, the value is escaped and/or themed. See \Drupal\Component\Render\FormattableMarkup::placeholderFormat() for details. @param array $options (optional) An associative array of additional options, with the following elements: - 'langcode' (defaults to the current language): A language code, to translate to a language other than what is used to display the page. - 'context' (defaults to the empty context): The context the source string belongs to. See the @link i18n Internationalization topic @endlink for more information about string contexts. @return \Drupal\Core\StringTranslation\TranslatableMarkup An object that, when cast to a string, returns the translated string. @see \Drupal\Component\Render\FormattableMarkup::placeholderFormat() @see \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() @ingroup sanitization Inherited from Drupal\Core\Entity\EntityType Defined in <ROOT>/core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php:70