Interface

eZ\Publish\API\Repository\TranslationService

interface TranslationService

Interface for a translation service.

Implement this to use translation backends like Symfony2 Translate, gettext or ezcTranslation.

Call the translation method with the current target locale from your templates, for example.

Methods

string translate(Translation $translation, string $locale)

Translate.

string translateString(string $translation, string $locale)

Translate string.

Details

at line 34
public string translate(Translation $translation, string $locale)

Translate.

Translate a Translation value object.

Parameters

Translation $translation
string $locale

Return Value

string

at line 47
public string translateString(string $translation, string $locale)

Translate string.

Translate a string. Strings could be useful for the simplest cases. Usually you will always use Translation value objects for this.

Parameters

string $translation
string $locale

Return Value

string