ezcTranslationManager handles a specific translation file and provides functionality to apply filters and retrieve contexts and translations.
The following example shows typical usage:
Source for this file: /Translation/src/translation_manager.php
Version: | //autogentag// |
public ezcTranslationManager |
__construct(
$backend
)
Constructs an ezcTranslationManager object |
public void |
addFilter(
$filter
)
Adds a filter to the filter list. |
public ezcTranslation |
getContext(
$locale
, $context
)
Returns the translations for the $context context and the locale $locale. |
Constructs an ezcTranslationManager object
This constructor constructs a new ezcTranslationManager object. The only parameter is a class that implements the ezcTranslationBackendInterface.
Name | Type | Description |
---|---|---|
$backend |
ezcTranslationBackend | An instance of a translation backend. |
Adds a filter to the filter list.
This methods adds the passed filter object to the list of $filters that will be applied on every context before being returned by getContext().
Name | Type | Description |
---|---|---|
$filter |
ezcTranslationFilter |
Returns the translations for the $context context and the locale $locale.
This methods reads the context data from the backend and applies the filters before returning the translation map as part of the ezcTranslation object that it returns.
Name | Type | Description |
---|---|---|
$locale |
string | |
$context |
string |