PhpExtractor
class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
PhpExtractor extracts translation messages from a PHP template.
Constants
MESSAGE_TOKEN |
|
METHOD_ARGUMENTS_TOKEN |
|
DOMAIN_TOKEN |
|
Properties
protected array | $sequences | The sequence that captures translation messages. |
Methods
bool
canBeExtracted(string $file)
No description
array
extractFromDirectory(string|array $directory)
No description
extract(string|array $resource, MessageCatalogue $catalog)
Extracts translation messages from files, a file or a directory to the catalogue.
setPrefix(string $prefix)
Sets the prefix that should be used for new found messages.
string
normalizeToken(mixed $token)
Normalizes a token.
Details
extract(string|array $resource, MessageCatalogue $catalog)
Extracts translation messages from files, a file or a directory to the catalogue.
protected
parseTokens(array $tokens, MessageCatalogue $catalog)
Extracts trans message from PHP tokens.