XarayaTranslationMemory  1.6
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
TranslationImportXaraya Class Reference
Inheritance diagram for TranslationImportXaraya:
TranslationImport TranslationImportXarigami

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __construct()

TranslationImportXaraya::__construct ( )

Class to import Xaraya locale files.

Definition at line 52 of file TranslationImportXaraya.php.

Member Function Documentation

◆ Import()

TranslationImportXaraya::Import (   $localeName)

Start importing the the selected directory into the selected locale.

Uses $CONFIG['import_dir'] to find the files.

Parameters
$localeNameThe 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().

◆ ImportFile()

TranslationImportXaraya::ImportFile (   $fullName,
TranslationProject  $thisProject 
)
private

Imports one translation XML file into the databse.

Parameters
$fullNameThe path and name of the file to import.
$thisProjectThe 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().

◆ 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!

Parameters
$dirIteratorA directory iterator initialized with the start dir, usually your Xaraya locale's dir.
$parentProjectThe 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().

Member Data Documentation

◆ $LocaleID

TranslationImportXaraya::$LocaleID
private

Definition at line 46 of file TranslationImportXaraya.php.

◆ $ProjectName

TranslationImportXaraya::$ProjectName = "Xaraya"
protected

Definition at line 43 of file TranslationImportXaraya.php.

◆ $XmlNameSpace

TranslationImportXaraya::$XmlNameSpace = "http://xaraya.com/2002/ns/translations"
protected

Definition at line 44 of file TranslationImportXaraya.php.


The documentation for this class was generated from the following file: