W3cubDocs

/Drupal 8

class Translation

Defines a translatable annotation object.

Some metadata within an annotation needs to be translatable. This class supports that need by allowing both the translatable string and, if specified, a context for that string. The string (with optional context) is passed into t().

Hierarchy

Related topics

Annotation for translatable text
Describes how to put translatable UI text into annotations.
Annotations
Annotations for class discovery and metadata description.

File

core/lib/Drupal/Core/Annotation/Translation.php, line 53

Namespace

Drupal\Core\Annotation

Members

Name Modifiers Type Description
AnnotationBase::$class protected property The class used for this annotated class.
AnnotationBase::$id public property The annotated class ID.
AnnotationBase::$provider protected property The provider of the annotated class.
AnnotationBase::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
AnnotationBase::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
AnnotationBase::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
AnnotationBase::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
AnnotationBase::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Translation::$translation protected property The string translation object.
Translation::get public function Gets the value of an annotation. Overrides AnnotationInterface::get
Translation::__construct public function Constructs a new class instance.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Annotation!Translation.php/class/Translation/8.1.x