Commit a325159d authored by jhodgdon's avatar jhodgdon

Issue #1969970 by dawehner, jhodgdon, webchick, EclipseGc, tim.plunkett:...

Issue #1969970 by dawehner, jhodgdon, webchick, EclipseGc, tim.plunkett: Documentation for translatable plugin properties on annotations
parent 891f4c5d
......@@ -9,6 +9,28 @@
use Drupal\Component\Annotation\AnnotationInterface;
/**
* @defgroup plugin_translatable Translatable plugin metadata
*
* @{
* When providing plugin annotation, properties whose values are displayed in
* the user interface should be made translatable. Much the same as how user
* interface text elsewhere is wrapped in t() to make it translatable, in plugin
* annotation, wrap translatable strings in the @ Translation() annotation.
* For example:
* @code
* title = @ Translation("Title of the plugin"),
* @endcode
* Remove spaces after @ in your actual plugin - these are put into this sample
* code so that it is not recognized as annotation.
*
* You will also need to make sure that your class file includes the line:
* @code
* use Drupal\Core\Annotation\Translation;
* @endcode
* @}
*/
/**
* Defines a translatable annotation object.
*
......@@ -18,6 +40,8 @@
* around the traditional t() function in drupal.
*
* @Annotation
*
* @ingroup plugin_translatable
*/
class Translation implements AnnotationInterface {
......
......@@ -94,14 +94,18 @@ class EntityType extends Plugin {
/**
* The human-readable name of the type.
*
* @var string
* @ingroup plugin_translatable
*
* @var \Drupal\Core\Annotation\Translation
*/
public $label;
/**
* The human-readable name of the entity bundles, e.g. Vocabulary.
*
* @var string
* @ingroup plugin_translatable
*
* @var \Drupal\Core\Annotation\Translation
*/
public $bundle_label;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment