eZ Publish  [4.2]
eZTranslatorGroup Class Reference

Allows for picking translator handlers according to context. More...

+ Inheritance diagram for eZTranslatorGroup:
+ Collaboration diagram for eZTranslatorGroup:

List of all members.

Public Member Functions

 eZTranslatorGroup ($is_key_based)
 findKey ($key)
 findMessage ($context, $source, $comment=null)
 handlerCount ()
 keyPick ($key)
 keyTranslate ($key)
 pick ($context, $source, $comment)
 registerHandler ($handler)
 translate ($context, $source, $comment=null)

Public Attributes

 $Handlers
 The array of grouped handlers.

Detailed Description

Allows for picking translator handlers according to context.

Definition at line 41 of file eztranslatorgroup.php.


Member Function Documentation

eZTranslatorGroup::eZTranslatorGroup ( is_key_based)

Constructor

Definition at line 46 of file eztranslatorgroup.php.

Referenced by eZRandomTranslator\eZRandomTranslator().

eZTranslatorGroup::findKey ( key) [pure virtual]
Returns:
the translation message for the key $key or null if the key does not exist.

This function must overridden if isKeyBased() is true.

Implements eZTranslatorHandler.

Definition at line 58 of file eztranslatorgroup.php.

eZTranslatorGroup::findMessage ( context,
source,
comment = null 
) [pure virtual]
Returns:
the translation message for $source and $context or null if the key does not exist.

If you know the translation key use findKey() instead.

This function must overridden if isKeyBased() is true.

Implements eZTranslatorHandler.

Definition at line 78 of file eztranslatorgroup.php.

eZTranslatorGroup::handlerCount ( )
Returns:
the number of registered handlers.

Definition at line 149 of file eztranslatorgroup.php.

Referenced by eZRandomTranslator\keyPick(), and eZRandomTranslator\pick().

eZTranslatorGroup::keyPick ( key) [pure virtual]

Reimplement this to pick one of the registered handlers based on $key.

Returns:
-1 for no handler or a number within the handler range (starting from 0).
See also:
pick

Implemented in eZRandomTranslator.

Definition at line 132 of file eztranslatorgroup.php.

Referenced by findKey(), and keyTranslate().

eZTranslatorGroup::keyTranslate ( key) [pure virtual]
Returns:
the translation string for $key or null if the translation does not exist.
See also:
findMessage, findKey

Implements eZTranslatorHandler.

Definition at line 114 of file eztranslatorgroup.php.

eZTranslatorGroup::pick ( context,
source,
comment 
) [pure virtual]

Reimplement this to pick one of the registered handlers based on $context, $source and $comment.

Returns:
-1 for no handler or a number within the handler range (starting from 0).
See also:
keyPick

Implemented in eZRandomTranslator.

Definition at line 142 of file eztranslatorgroup.php.

Referenced by findMessage(), and translate().

eZTranslatorGroup::registerHandler ( handler)

Registers the handler object $handler.

Definition at line 157 of file eztranslatorgroup.php.

eZTranslatorGroup::translate ( context,
source,
comment = null 
) [pure virtual]
Returns:
the translation string for $source and $context or null if the translation does not exist.
See also:
findMessage, findKey

Implements eZTranslatorHandler.

Definition at line 96 of file eztranslatorgroup.php.


Member Data Documentation

eZTranslatorGroup::$Handlers

The array of grouped handlers.

Definition at line 170 of file eztranslatorgroup.php.


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