diff --git a/core/lib/Drupal/Core/Template/TwigExtension.php b/core/lib/Drupal/Core/Template/TwigExtension.php index 9c981ae..b54e49b 100644 --- a/core/lib/Drupal/Core/Template/TwigExtension.php +++ b/core/lib/Drupal/Core/Template/TwigExtension.php @@ -35,7 +35,7 @@ public function getFilters() { /** * Fake filters equivalent to "raw" and only used in the trans tag. * - * These filters are necessary to identify the type type of prefix to use + * These filters are necessary to identify the type of prefix to use * when passing tokens to t() from a trans tag. */ 'passthrough' => new \Twig_SimpleFilter('passthrough', 'twig_raw_filter'), diff --git a/core/lib/Drupal/Core/Template/TwigNodeTrans.php b/core/lib/Drupal/Core/Template/TwigNodeTrans.php index fa9f63b..c49be83 100644 --- a/core/lib/Drupal/Core/Template/TwigNodeTrans.php +++ b/core/lib/Drupal/Core/Template/TwigNodeTrans.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\Core\Template\TwigNodeTrans. + * Contains \Drupal\Core\Template\TwigNodeTrans. * * @see https://github.com/fabpot/Twig-extensions */ @@ -10,7 +10,8 @@ namespace Drupal\Core\Template; /** - * A trans tag. + * The 'trans' tag allows the content string to be passed to the translation + * system for internationalization. */ class TwigNodeTrans extends \Twig_Node { public function __construct(\Twig_NodeInterface $body, \Twig_NodeInterface $plural = NULL, \Twig_Node_Expression $count = NULL, $lineno, $tag = NULL) { @@ -139,14 +140,10 @@ protected function compileString(\Twig_NodeInterface $body) { } $args = $n->getNode('arguments')->getNode(0); - /** - * Default prefix passed to t(), escapes printed token. - */ + // Default prefix passed to t(), escapes printed token. $argPrefix = '@'; - /** - * Detect if one of the "fake" filters for the trans tag is applied. - */ + // Detect if one of the "fake" filters for the trans tag is applied. while ($args instanceof \Twig_Node_Expression_Filter) { switch ($args->getNode('filter')->getAttribute('value')) { case 'passthrough': diff --git a/core/lib/Drupal/Core/Template/TwigTransTokenParser.php b/core/lib/Drupal/Core/Template/TwigTransTokenParser.php index d8dd72e..a45f1d1 100644 --- a/core/lib/Drupal/Core/Template/TwigTransTokenParser.php +++ b/core/lib/Drupal/Core/Template/TwigTransTokenParser.php @@ -2,13 +2,22 @@ /** * @file - * Definition of Drupal\Core\Template\TwigTransTokenParser. + * Contains \Drupal\Core\Template\TwigTransTokenParser. * * @see https://github.com/fabpot/Twig-extensions */ namespace Drupal\Core\Template; +/** + * A class that defines the Twig 'trans' token parser for Drupal. + * + * The token parser converts a token stream created from template source + * code into an Abstract Syntax Tree (AST). The AST will later be compiled + * into PHP code usable for runtime execution of the template. + * + * @see core\vendor\twig\twig\lib\Twig\TokenParser.php + */ class TwigTransTokenParser extends \Twig_TokenParser { /** * {@inheritdoc}