ezcTemplateTranslationExtractor is capable of creating or updating translation files by extracting translatable strings from templates.
To run the extractor, please use the file "runextractor.php", inside this package.
To extract new translatable strings from a template file, use the following synopsis:
The -t / --templates parameter points to the template files. The -o / --overwrite option specifies if existing files should be overwritten instead of being updated. The argument for the program specifies the directory, where the translation files will be stored or updated.
For help information simply call
Source for this file: /TemplateTranslationTiein/src/extractor.php
Version: | //autogen// |
PROGRAM_DESCRIPTION
= 'Extracts translatable strings from eZ Components template files. The directory to save the translation files to is provided as an argument.'
|
Program description for help text. |
public ezcTemplateTranslationExtractor |
__construct(
)
Create a new generator. |
public array(string=>array(ezcTranslationData)) |
getTranslationsFromTemplate(
$filename
)
Get translation array with translation data for each context from the template. |
public array(string=>ezcTranslationData) |
getTranslationsFromTsFile(
$contextName
)
Get translations for given context. |
public void |
run(
)
Run the generator. |
public string |
unifyFilepath(
$pathname
, $templatePath
)
Unifies directory seperator accross platforms and strips path to the template dir to get the possibility to run this script from different template locations. |
Create a new generator.
This method initializes the necessary objects to run the application.
Get translation array with translation data for each context from the template.
Name | Type | Description |
---|---|---|
$filename |
string |
Get translations for given context.
Name | Type | Description |
---|---|---|
$contextName |
string |
Run the generator.
Process the given options and generates translation files.
Unifies directory seperator accross platforms and strips path to the template dir to get the possibility to run this script from different template locations.
Name | Type | Description |
---|---|---|
$pathname |
string | |
$templatePath |
string |