Inheritance diagram for TranslationImportXaraya:
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 43 of file TranslationImportXaraya.php.
Public Member Functions | |
__construct () | |
ProcessDir (RecursiveDirectoryIterator $dirIterator, TranslationProject $parentProject) | |
Import ($localeName) | |
Private Member Functions | |
ImportFile ($fullName, TranslationProject $thisProject) | |
Private Attributes | |
$LocaleID |
TranslationImportXaraya::__construct | ( | ) |
Class to import Xaraya locale files.
Definition at line 51 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 167 of file TranslationImportXaraya.php.
References TranslationProject::$LocaleIDCache, GetConfigVar(), and ProcessDir().
TranslationImportXaraya::ImportFile | ( | $ | fullName, | |
TranslationProject $ | thisProject | |||
) | [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 62 of file TranslationImportXaraya.php.
References TranslationProject::GetID(), TranslationProject::GetLocaleID(), TranslationProject::Save(), TranslationProject::SetDocument(), 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, so it can have a nicer name than "xml" or whatever the first dir would be. Pass the root project's (usually called "Xaraya") ID 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 ImportFile().
Referenced by Import().
TranslationImportXaraya::$LocaleID [private] |
Definition at line 45 of file TranslationImportXaraya.php.