Path

ez components / documentation / api reference / 2007.2beta1 / translation


eZ Components 2007.2beta1

Translation: ezcTranslation

[ Tutorial ] [ Linguist format ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcTranslation

ezcTranslation is a container that holds the translated strings for a specific context. [source]
ezcTranslation objects are returned by the ezcTranslationManager for every requested context.
For an example see ezcTranslationManager.

Method Summary

public ezcTranslation __construct( $data )
Constructs the ezcTranslation object.
public string getTranslation( $key, [$params = array()] )
Returns the translated version of the original string $key.

Methods

__construct

ezcTranslation __construct( $data )
Constructs the ezcTranslation object.
The constructor receives an array containing the map between the original string and the translation.

Parameters

Name Type Description
$data array(string=>ezcTranslationData)  

getTranslation

string getTranslation( string $key, [ $params = array()] )
Returns the translated version of the original string $key.
This method returns a translated string and substitutes the parameters $param in the localized string.

Parameters

Name Type Description
$key string  
$params array(string=>string)  

Throws

ClassDescription
ezcTranslationKeyNotAvailableException when the key is not available
ezcTranslationParameterMissingException when not enough parameters are passed for a parameterized string

Last updated: Wed, 28 Nov 2007