TranslatorAwareInterface
in
Table of Contents
Methods
- getTranslator() : TranslatorInterface|null
- Returns translator used in object
- getTranslatorTextDomain() : string
- Return the translation text domain
- hasTranslator() : bool
- Checks if the object has a translator
- isTranslatorEnabled() : bool
- Returns whether translator is enabled and should be used
- setTranslator() : self
- Sets translator to use in helper
- setTranslatorEnabled() : self
- Sets whether translator is enabled and should be used
- setTranslatorTextDomain() : TranslatorAwareInterface
- Set translation text domain
Methods
getTranslator()
Returns translator used in object
public
getTranslator() : TranslatorInterface|null
Return values
TranslatorInterface|nullgetTranslatorTextDomain()
Return the translation text domain
public
getTranslatorTextDomain() : string
Return values
stringhasTranslator()
Checks if the object has a translator
public
hasTranslator() : bool
Return values
boolisTranslatorEnabled()
Returns whether translator is enabled and should be used
public
isTranslatorEnabled() : bool
Return values
boolsetTranslator()
Sets translator to use in helper
public
setTranslator([TranslatorInterface $translator = null ][, string $textDomain = null ]) : self
Parameters
- $translator : TranslatorInterface = null
-
[optional] translator. Default is null, which sets no translator.
- $textDomain : string = null
-
[optional] text domain Default is null, which skips setTranslatorTextDomain
Return values
selfsetTranslatorEnabled()
Sets whether translator is enabled and should be used
public
setTranslatorEnabled([bool $enabled = true ]) : self
Parameters
- $enabled : bool = true
-
[optional] whether translator should be used. Default is true.
Return values
selfsetTranslatorTextDomain()
Set translation text domain
public
setTranslatorTextDomain([string $textDomain = 'default' ]) : TranslatorAwareInterface
Parameters
- $textDomain : string = 'default'