Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztranslatorgroup.php
Go to the documentation of this file.
1 <?php
19 class eZTranslatorGroup extends eZTranslatorHandler
20 {
21 public function __construct( $is_key_based )
22 {
23 parent::__construct( $is_key_based );
24 $this->Handlers = array();
25 }
26
33 function findKey( $key )
34 {
35 $num = $this->keyPick( $key );
36 if ( $num >=0 and $num <= count( $this->Handlers ) )
37 {
38 $handler = $this->Handlers[$num];
39 return $handler->findKey( $key );
40 }
41 $retValue = null;
42 return $retValue;
43 }
44
53 function findMessage( $context, $source, $comment = null )
54 {
55 $num = $this->pick( $context, $source, $comment );
56 if ( $num >=0 and $num <= count( $this->Handlers ) )
57 {
58 $handler = $this->Handlers[$num];
59 return $handler->findMessage( $context, $source, $comment );
60 }
61 $retValue = null;
62 return $retValue;
63 }
64
71 function translate( $context, $source, $comment = null )
72 {
73 $num = $this->pick( $context, $source, $comment );
74 if ( $num >=0 and $num <= count( $this->Handlers ) )
75 {
76 $handler = $this->Handlers[$num];
77 return $handler->translate( $context, $source, $comment );
78 }
79
80 return null;
81 }
82
89 function keyTranslate( $key )
90 {
91 $num = $this->keyPick( $key );
92 if ( $num >=0 and $num <= count( $this->Handlers ) )
93 {
94 $handler = $this->Handlers[$num];
95 return $handler->keyTranslate( $key );
96 }
97
98 return null;
99 }
100
107 function keyPick( $key )
108 {
109 }
110
117 function pick( $context, $source, $comment )
118 {
119 }
120
124 function handlerCount()
125 {
126 return count( $this->Handlers );
127 }
128
132 function registerHandler( $handler )
133 {
134 if ( !$this->isKeyBased() and $handler->isKeyBased() )
135 {
136 eZDebug::writeError( "Cannot register keybased handler for non-keybased group", "eZTranslatorGroup" );
137 return false;
138 }
139 $this->Handlers[] = $handler;
140 return true;
141 }
142
145 public $Handlers;
146 }
147
148 ?>
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:546
eZTranslatorGroup
Allows for picking translator handlers according to context.
Definition: eztranslatorgroup.php:20
eZTranslatorGroup\handlerCount
handlerCount()
Definition: eztranslatorgroup.php:124
eZTranslatorGroup\keyPick
keyPick( $key)
Definition: eztranslatorgroup.php:107
eZTranslatorGroup\keyTranslate
keyTranslate( $key)
Definition: eztranslatorgroup.php:89
eZTranslatorGroup\findKey
findKey( $key)
Definition: eztranslatorgroup.php:33
eZTranslatorGroup\translate
translate( $context, $source, $comment=null)
Definition: eztranslatorgroup.php:71
eZTranslatorGroup\findMessage
findMessage( $context, $source, $comment=null)
Definition: eztranslatorgroup.php:53
eZTranslatorGroup\registerHandler
registerHandler( $handler)
Definition: eztranslatorgroup.php:132
eZTranslatorGroup\$Handlers
$Handlers
Definition: eztranslatorgroup.php:145
eZTranslatorGroup\pick
pick( $context, $source, $comment)
Definition: eztranslatorgroup.php:117
eZTranslatorGroup\__construct
__construct( $is_key_based)
Definition: eztranslatorgroup.php:21
eZTranslatorHandler
Base class for translation handling.
Definition: eztranslatorhandler.php:20
eZTranslatorHandler\isKeyBased
isKeyBased()
Definition: eztranslatorhandler.php:35
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.