TranslatorAdapterInterface
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
Returns an instance of a translator object.
Get the locale from the translator object.
Sets the locale to the translator object.
Translate the given text. Returns the translated form of the text.
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.
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.
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.