PluralTranslation
class PluralTranslation extends AnnotationBase (View source)
Defines an annotation object for strings that require plural forms.
Note that the return values for both 'singular' and 'plural' keys needs to be passed to \Drupal\Core\StringTranslation\TranslationInterface::formatPlural().
For example, the annotation can look like this:
Properties
| string | $id | The annotated class ID. |
from AnnotationBase |
| protected string | $class | The class used for this annotated class. |
from AnnotationBase |
| protected string | $provider | The provider of the annotated class. |
from AnnotationBase |
| protected string | $singular | The string for the singular case. |
|
| protected string | $plural | The string for the plural case. |
|
| protected string | $context | The context the source strings belong to. |
Methods
Sets the name of the provider of the annotated class.
Constructs a new class instance.
Gets the value of an annotation.
Details
string
getProvider()
Gets the name of the provider of the annotated class.
setProvider(string $provider)
Sets the name of the provider of the annotated class.
string
getId()
Gets the unique ID for this annotated class.
string
getClass()
Gets the class of the annotated class.
setClass(string $class)
Sets the class of the annotated class.
__construct(array $values)
Constructs a new class instance.
get()
Gets the value of an annotation.