// For all special processing, we want to remove variables, set statements,
// and assorted Twig expression calls (if, do, etc.).
if ($node instanceof SetNode ||
$node instanceof PrintNode ||
$node instanceof AbstractExpression
) { return NULL;
} if ($node instanceof TwigNodeTrans
) { // Count the number of translated chunks.
$this_chunk =
$processing['chunk_count'
] + 1;
static::
setStateValue('chunk_count',
$this_chunk);
if ($this_chunk >
$processing['max_chunk'
]) { static::
setStateValue('max_chunk',
$this_chunk);
} if ($processing['manner'
] == 'remove_translated'
) { // Remove all translated text.
return NULL;
} elseif ($processing['manner'
] == 'replace_translated'
) { // Replace with a dummy string.
$node =
new TextNode('dummy', 0
);
}