XarayaTranslationMemory
1.6
|
Public Member Functions | |
__construct () | |
ProcessDir (RecursiveDirectoryIterator $dirIterator, TranslationProject $parentProject) | |
Import ($localeName) | |
Protected Attributes | |
$ProjectName = "Xaraya" | |
$XmlNameSpace = "http://xaraya.com/2002/ns/translations" | |
Private Member Functions | |
ImportFile ($fullName, TranslationProject $thisProject) | |
Private Attributes | |
$LocaleID | |
Imports a Xaraya translation from locale files into the database.
Importing Xaraya works the following way:
Directories will be created as projects without documents, XML files will be stored as projects with document. XML files are parsed for English and Translated strings.
If directory or file project already exist, the timestamp and in the later case the original and skeleton documents are updated. (Name, parentid and localeid identifies the existing projects.) If the timestamp of a project is smaller than the root project's, that project was not found while the last import, thus won't be exported and considered to be dead project file.
If the same project contains the same English original string already, the string entry will be updated. If there is no such string yet in this project, a new string will be created and indexed.
Definition at line 41 of file TranslationImportXaraya.php.
TranslationImportXaraya::__construct | ( | ) |
Class to import Xaraya locale files.
Definition at line 52 of file TranslationImportXaraya.php.
TranslationImportXaraya::Import | ( | $localeName | ) |
Start importing the the selected directory into the selected locale.
Uses $CONFIG['import_dir'] to find the files.
$localeName | The locale name which translation locale files should be imported. |
Implements TranslationImport.
Definition at line 190 of file TranslationImportXaraya.php.
References TranslationProject\$LocaleIDCache, ProjectIterator\ClearCache(), GetConfigVar(), and ProcessDir().
|
private |
Imports one translation XML file into the databse.
$fullName | The path and name of the file to import. |
$thisProject | The project in which this one will be stored. |
Definition at line 63 of file TranslationImportXaraya.php.
References TranslationProject\GetID(), TranslationProject\GetLocaleID(), TranslationProject\Save(), TranslationProject\SetDocument(), TranslationString\SetRowOrder(), and TranslationProject\SetSkeleton().
Referenced by ProcessDir().
TranslationImportXaraya::ProcessDir | ( | RecursiveDirectoryIterator | $dirIterator, |
TranslationProject | $parentProject | ||
) |
Recursively process a complete dir and call ImportFile() for each XML file.
The root project must be created before this function is called! Pass the root project to this function!
$dirIterator | A directory iterator initialized with the start dir, usually your Xaraya locale's dir. |
$parentProject | The parent project, in which this new subprojects will be created. |
Definition at line 131 of file TranslationImportXaraya.php.
References TranslationProject\GetID(), TranslationProject\GetLocaleID(), TranslationProject\GetRootID(), and ImportFile().
Referenced by Import().
|
private |
Definition at line 46 of file TranslationImportXaraya.php.
|
protected |
Definition at line 43 of file TranslationImportXaraya.php.
|
protected |
Definition at line 44 of file TranslationImportXaraya.php.