eZTSTranslator Class Reference
[Translation]

This provides internationalization using XML (.ts) files. More...

Inheritance diagram for eZTSTranslator:

eZTranslatorHandler List of all members.

Public Methods

 eZTSTranslator ($file=null,$root=false,$useCache=true)
 setOverrideDir ($dir)
findKey ($key)
findMessage ($context,$source,$comment=null)
keyTranslate ($key)
translate ($context,$source,$comment=null)
 insert ($context,$source,$translation,$comment=null)
 remove ($context,$source,$message=null)
 removeKey ($key)

Static Public Methods

 exists ($file,$root=false)
initialize ($file,$root=false,$useCache=true)
 overrideDir ()

Private Attributes

 Messages

Detailed Description

This provides internationalization using XML (.ts) files.

Definition at line eztstranslator.php.


Constructor & Destructor Documentation

eZTSTranslator::eZTSTranslator   file = null,
  root = false,
  useCache = true
 

Construct the translator and loads the translation file $file if it is set and exists.

Definition at line eztstranslator.php.

References Messages.

Referenced by initialize().


Member Function Documentation

eZTSTranslator::exists   file,
  root = false
[static]
 

Returns:
true if the translation file exists.

Definition at line eztstranslator.php.

& eZTSTranslator::findKey   key [virtual]
 

Reimplemented for internal reasons; the API is not affected.

Implements eZTranslatorHandler.

Definition at line eztstranslator.php.

References Messages.

Referenced by keyTranslate().

& eZTSTranslator::findMessage   context,
  source,
  comment = null
[virtual]
 

Reimplemented for internal reasons; the API is not affected.

Implements eZTranslatorHandler.

Definition at line eztstranslator.php.

References eZTranslatorManager::instance().

Referenced by translate().

& eZTSTranslator::initialize   file,
  root = false,
  useCache = true
[static]
 

Initialize the ts translator if this is not allready done.

Definition at line eztstranslator.php.

References eZTranslatorManager::instance().

eZTSTranslator::insert   context,
  source,
  translation,
  comment = null
 

Inserts the $translation for the $context and $source as a translation message and returns the key for the message. If $comment is non-null it will be included in the message.

If the translation message exists no new message is created and the existing key is returned.

Definition at line eztstranslator.php.

References Messages.

& eZTSTranslator::keyTranslate   key [virtual]
 

Reimplemented for internal reasons; the API is not affected.

Implements eZTranslatorHandler.

Definition at line eztstranslator.php.

References findKey().

eZTSTranslator::overrideDir   [static]
 

Returns:
the override directory, if no directory has been set "override" is returned.
The override directory is relative to the rootDir().

Definition at line eztstranslator.php.

eZTSTranslator::remove   context,
  source,
  message = null
 

Removes the translation message with $context and $source. Returns true if the message was removed, false otherwise.

If you have the translation key use removeKey() instead.

Definition at line eztstranslator.php.

References eZTranslatorManager::instance().

eZTSTranslator::removeKey   key
 

Removes the translation message with $key. Returns true if the message was removed, false otherwise.

Definition at line eztstranslator.php.

eZTSTranslator::setOverrideDir   dir
 

Sets the override directory to $dir.

Definition at line eztstranslator.php.

& eZTSTranslator::translate   context,
  source,
  comment = null
[virtual]
 

Reimplemented for internal reasons; the API is not affected.

Implements eZTranslatorHandler.

Definition at line eztstranslator.php.

References findMessage().


Member Data Documentation

eZTSTranslator::Messages [private]
 

Contains the hash table with message translations

Definition at line eztstranslator.php.

Referenced by insert().


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

Exponential