diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php index 9b0eb65..55aec11 100644 --- a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php @@ -113,26 +113,38 @@ public function isRevisionable(); public function isQueryable(); /** - * Returns the human-readable label for the field. + * Returns a human readable label. * - * @return string - * The field label. + * @return string|null + * The label string or NULL if no label is available. */ public function getLabel(); /** - * Returns the human-readable description for the field. + * Returns an untranslated human readable label. * - * This is displayed in addition to the label in places where additional - * descriptive information is helpful. For example, as help text below the - * form element in entity edit forms. + * @return string + * The untranslated label, or NULL if no description is available. + */ + public function getUntranslatedLabel(); + + /** + * Returns a human readable description. * * @return string|null - * The field description, or NULL if no description is available. + * The description string or NULL if no description is available. */ public function getDescription(); /** + * Returns an untranslated human readable description. + * + * @return string|null + * The untranslated description, or NULL if no description is available. + */ + public function getUntranslatedDescription(); + + /** * Gets an options provider for the given field item property. * * @param string $property_name diff --git a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php index 1285cb7..12b3d64 100644 --- a/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php +++ b/core/lib/Drupal/Core/StringTranslation/TranslationWrapper.php @@ -7,6 +7,8 @@ namespace Drupal\Core\StringTranslation; +use Drupal\Component\Utility\String; + /** * Provides a class to wrap a translatable string. * @@ -67,7 +69,7 @@ public function __toString() { } /** - * Renders the object as a string. + * Renders the object as a translated string. * * @return string * The translated string. @@ -77,6 +79,26 @@ public function render() { } /** + * Returns the source string untranslated. + * + * @return string + * The untranslated string. + */ + public function getUntranslatedString() { + return $this->string; + } + + /** + * Returns the arguments. + * + * @return array + * The arguments. + */ + public function getArguments() { + return $this->arguments; + } + + /** * Magic __sleep() method to avoid serializing the string translator. */ public function __sleep() { diff --git a/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php b/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php index d7df9db..3c294d4 100644 --- a/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php +++ b/core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php @@ -62,8 +62,8 @@ public function getDataType(); /** * Returns a human readable label. * - * @return string - * The label. + * @return string|null + * The label string or NULL if no label is available. */ public function getLabel(); @@ -71,7 +71,7 @@ public function getLabel(); * Returns an untranslated human readable label. * * @return string - * The label. + * The untranslated label, or NULL if no description is available. */ public function getUntranslatedLabel(); @@ -79,7 +79,7 @@ public function getUntranslatedLabel(); * Returns a human readable description. * * @return string|null - * The description, or NULL if no description is available. + * The description string or NULL if no description is available. */ public function getDescription(); @@ -87,7 +87,7 @@ public function getDescription(); * Returns an untranslated human readable description. * * @return string|null - * The description, or NULL if no description is available. + * The untranslated description, or NULL if no description is available. */ public function getUntranslatedDescription();