Copied!

TranslationService

TranslationService.php : 20

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

publictranslate()

TranslationService.php : 32

Translate.

public translate(Translation $translation, string $locale) : string

Translate a Translation value object.

Parameters

Name Type Default value Description
$translation Translation - -
$locale string - -

Return values

string

publictranslateString()

TranslationService.php : 45

Translate string.

public translateString(string $translation, string $locale) : string

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

Parameters

Name Type Default value Description
$translation string - -
$locale string - -

Return values

string