interface TranslatorAdapterInterface (View source)

Translator adapters wrap the functionality of a specific translator class into a format that can be used within the concrete5 context.

Methods

mixed
getTranslator()

Returns an instance of a translator object.

string
getLocale()

Get the locale from the translator object.

setLocale(string $locale)

Sets the locale to the translator object.

string
translate(string $text)

Translate the given text. Returns the translated form of the text.

int
translatePlural(string $singular, string $plural, int $number)

Translate the text either into the singular or the plural format depending on the given number. Returns the correct format of the text in its translated form.

string
translateContext(string $context, string $text)

Translate the given text with the given context. Returns the translated form of the text.

Details

mixed getTranslator()

Returns an instance of a translator object.

Return Value

mixed

The translator object

string getLocale()

Get the locale from the translator object.

Return Value

string

setLocale(string $locale)

Sets the locale to the translator object.

Parameters

string $locale

string translate(string $text)

Translate the given text. Returns the translated form of the text.

Parameters

string $text

Return Value

string

int translatePlural(string $singular, string $plural, int $number)

Translate the text either into the singular or the plural format depending on the given number. Returns the correct format of the text in its translated form.

Parameters

string $singular
string $plural
int $number

Return Value

int

string translateContext(string $context, string $text)

Translate the given text with the given context. Returns the translated form of the text.

Parameters

string $context
string $text

Return Value

string