XarayaTranslationMemory
1.6
|
Public Member Functions | |
__construct () | |
FixEntity ($text) | |
Export ($localeName, $silentMode=false) | |
Protected Attributes | |
$ProjectName = "Xaraya" | |
$XmlNameSpace = "http://xaraya.com/2002/ns/translations" | |
Private Member Functions | |
& | ExportProject (TranslationProject $project) |
ProcessRecursive ($dir, ProjectIterator $projectIterator) | |
CheckCodeFiles (TranslationProject $project) | |
LogError ($msg) | |
Private Attributes | |
$RootTimeStamp | |
$SilentMode | |
$ErrorLogFile | |
$XarayaRoot | |
Recreates the Xaraya locale files from the database
Does exactly the opposite than TranslationImportXaraya. Note, that dead projects won't be exported.
Exporting will try to find corresponding php/xt/xd files for the created XML files and write a note to xartm_errors.txt if no corresponding code file can be found. Unless you know the purpose of the reported XML file (e.g. it's a module you currently did not install to the export directory's Xaraya), you should delete those .xml files.
Definition at line 34 of file TranslationExportXaraya.php.
TranslationExportXaraya::__construct | ( | ) |
Definition at line 51 of file TranslationExportXaraya.php.
|
private |
Check if corresponding Xaraya code files for a translation file still exists.
Writes to $this->ErrorLogFile if file not found. Note: some locale files don't have a Xaraya code file (e.g. fuzzy, core, common) so they are ignored by this check.
$project | Which project's orignial Xaraya file to check. |
Definition at line 209 of file TranslationExportXaraya.php.
References ProjectIterator\$ProjectList, TranslationProject\GetID(), TranslationProject\GetLocaleID(), TranslationProject\GetName(), and LogError().
Referenced by ProcessRecursive().
TranslationExportXaraya::Export | ( | $localeName, | |
$silentMode = false |
|||
) |
Export finished Xaraya translations of the selected locale into the selected directory.
Exporting will process all projects in the given locale's Xaraya root, create a language pack directory strucure on the $CONFIG configured destination.
$localeName | string Name of the locale to be exported (e.g. "hu_HU.utf-8"). |
$silentMode | bool true value suppresses all output messages. |
Implements ITranslationExport.
Definition at line 328 of file TranslationExportXaraya.php.
References TranslationProject\$LocaleIDCache, ProjectIterator\ClearCache(), GetConfigVar(), and ProcessRecursive().
|
private |
Export the translation strings of one project and return as updated document xml string.
Gets the passed project's strings from the database and puts them in the project's $Skeleton document, returns the resulting string.
$project | The TranslationProject to created exported XML file for. |
Definition at line 64 of file TranslationExportXaraya.php.
References FixEntity(), TranslationProject\GetID(), and TranslationProject\GetSkeleton().
Referenced by ProcessRecursive().
TranslationExportXaraya::FixEntity | ( | $text | ) |
Fix string for using in XML output. This may need changes with other DOMDocument versions.
Becuase the current domdocument actions look broken, thus we need to fix some things here.
$text | The text to escape. |
Definition at line 120 of file TranslationExportXaraya.php.
Referenced by ExportProject().
|
private |
Write one message to the error log file.
Definition at line 313 of file TranslationExportXaraya.php.
Referenced by CheckCodeFiles().
|
private |
Create directories and translated files according to the project tree and strings database.
Calls ->ExportProject() on all translation projects recurisvely from the given root. This is a recursive function which calls itself for subdirectories.
$dir | String, the directory where the subdirectories and files should be created. |
$projectIterator | The iterator initialized with the root project from where we export. |
Definition at line 138 of file TranslationExportXaraya.php.
References CheckCodeFiles(), ExportProject(), ProjectIterator\getChildren(), and ProjectIterator\hasChildren().
Referenced by Export().
|
private |
Write errors to this file, xartm_errors.txt in locale's root.
Definition at line 46 of file TranslationExportXaraya.php.
|
protected |
Definition at line 36 of file TranslationExportXaraya.php.
|
private |
Timestamp of the root project, older projects won't be exported as they are consdered to be dead projects
Definition at line 40 of file TranslationExportXaraya.php.
|
private |
Supress all messages while exporting?
Definition at line 43 of file TranslationExportXaraya.php.
|
private |
Root folder of Xaraya install (../../ from locale) for code file existance checking.
Definition at line 49 of file TranslationExportXaraya.php.
|
protected |
Definition at line 37 of file TranslationExportXaraya.php.