Public Member Functions | Protected Attributes

Zend_View_Helper_Translate Class Reference

Inheritance diagram for Zend_View_Helper_Translate:
Zend_View_Helper_Abstract Zend_View_Helper_Interface

Public Member Functions

 __construct ($translate=null)
 translate ($messageid=null)
 setTranslator ($translate)
 getTranslator ()
 setLocale ($locale=null)
 getLocale ()

Protected Attributes

 $_translator

Detailed Description

Definition at line 37 of file Translate.php.


Constructor & Destructor Documentation

__construct ( translate = null )

Constructor for manually handling

Parameters:
Zend_Translate | Zend_Translate_Adapter$translateInstance of Zend_Translate

Definition at line 51 of file Translate.php.


Member Function Documentation

getLocale (  )

Returns the set locale for translations

Exceptions:
Zend_View_ExceptionWhen no Zend_Translate instance was set
Returns:
string|Zend_Locale

Definition at line 168 of file Translate.php.

getTranslator (  )

Retrieve translation object

If none is currently registered, attempts to pull it from the registry using the key 'Zend_Translate'.

Returns:
Zend_Translate_Adapter|null

Definition at line 131 of file Translate.php.

setLocale ( locale = null )

Set's an new locale for all further translations

Parameters:
string | Zend_Locale$localeNew locale to set
Exceptions:
Zend_View_ExceptionWhen no Zend_Translate instance was set
Returns:
Zend_View_Helper_Translate

Definition at line 150 of file Translate.php.

setTranslator ( translate )

Sets a translation Adapter for translation

Parameters:
Zend_Translate | Zend_Translate_Adapter$translateInstance of Zend_Translate
Exceptions:
Zend_View_ExceptionWhen no or a false instance was set
Returns:
Zend_View_Helper_Translate

Definition at line 109 of file Translate.php.

translate ( messageid = null )

Translate a message You can give multiple params or an array of params. If you want to output another locale just set it as last single parameter Example 1: translate('1$s + 2$s', $value1, $value2, $locale); Example 2: translate('1$s + 2$s', array($value1, $value2), $locale);

Parameters:
string$messageidId of the message to be translated
Returns:
string Translated message

Definition at line 68 of file Translate.php.


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