A visiter that can be used to extract translatable strings from a template.
Implements the ezcTemplateTstNodeVisiter interface for visiting the nodes and extracting translatable strings from them. It can be used like:
Source for this file: /TemplateTranslationTiein/src/visitors/string_extracter.php
ezcTemplateTstWalker | --ezcTemplateTranslationStringExtracter
Version: | //autogen// |
protected array(string=>array(ezcTranslationData) |
$strings
Contans an array of arrays, where the key is the context, and the value an array of ezcTranslationData elements. |
public string |
$translationContext
Contains the active default translation context |
public ezcTemplateTranslationStringExtracter |
__construct(
$parser
)
Initialize the transformer, after this send this object to the accept() method on a node. |
public array(string=>array(ezcTranslationData)) |
getStrings(
)
Returns an array of translation objects indexed by context |
public array(string=>ezcTranslation) |
getTranslation(
)
Returns an array of translation datamaps indexed by context |
public string |
visitLiteralTstNode(
$type
)
Transform the literal from a TST node to a string. |
public void |
visitTranslationContextTstNode(
$node
)
visitTranslationContextTstNode |
public void |
visitTranslationTstNode(
$node
)
visitTranslationTstNode |
Initialize the transformer, after this send this object to the accept() method on a node.
Name | Type | Description |
---|---|---|
$parser |
ezcTemplateParser | The main parser object. |
Returns an array of translation objects indexed by context
Returns an array of translation datamaps indexed by context
Transform the literal from a TST node to a string.
The text will transformed by processing the escape sequences according to the type which is either ezcTemplateLiteralTstNode::SINGLE_QUOTE or ezcTemplateLiteralTstNode::DOUBLE_QUOTE.
Name | Type | Description |
---|---|---|
$type |
ezcTemplateLiteralTstNode |
visitTranslationContextTstNode
Name | Type | Description |
---|---|---|
$node |
ezcTemplateTranslationContextTstNode |
visitTranslationTstNode
Name | Type | Description |
---|---|---|
$node |
ezcTemplateTranslationTstNode |