API Documentation

View/Helper/Translate.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_View
subpackage
Helper
version
$Id: Translate.php 20140 2010-01-08 05:21:04Z thomas $
Classes
Zend_View_Helper_Translate

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_View_Helper_Translate

Extends from
Zend_View_Helper_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_View
Properties
$_translator
Methods
__construct
translate
setTranslator
getTranslator
setLocale
getLocale

Description

Translation view helper

Properties

$_translator

Zend_Translate_Adapter $_translator = ''

Translation object

Details

$_translator
Zend_Translate_Adapter
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( Zend_Translate|Zend_Translate_Adapter $translate = null ) :

Constructor for manually handling

Arguments
$translate
Zend_TranslateZend_Translate_Adapter
Instance of Zend_Translate
Details
visibility
public
final
false
static
false

getLocale

getLocale( ) : string|Zend_Locale

Returns the set locale for translations

Output
string|Zend_Locale
Details
visibility
public
final
false
static
false
throws
When no Zend_Translate instance was set

getTranslator

getTranslator( ) : Zend_Translate_Adapter|null

Retrieve translation object

Details
visibility
public
final
false
static
false

setLocale

setLocale( string|Zend_Locale $locale = null ) : Zend_View_Helper_Translate

Set's an new locale for all further translations

Arguments
$locale
stringZend_Locale
New locale to set
Details
visibility
public
final
false
static
false
throws
When no Zend_Translate instance was set

setTranslator

setTranslator( Zend_Translate|Zend_Translate_Adapter $translate ) : Zend_View_Helper_Translate

Sets a translation Adapter for translation

Arguments
$translate
Zend_TranslateZend_Translate_Adapter
Instance of Zend_Translate
Details
visibility
public
final
false
static
false
throws
When no or a false instance was set

translate

translate( string $messageid = null ) : string|Zend_View_Helper_Translate

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);

Arguments
$messageid
string
Id of the message to be translated
Output
string|Zend_View_Helper_Translate
Translated message
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.