class Translator extends Translator
Translator.
Methods
|
__construct(ContainerInterface $container, MessageSelector $selector, array $loaderIds = array(), array $options = array(), Session $session = null)
Constructor. |
||
|
addLoader(string $format, LoaderInterface $loader)
Adds a Loader. |
from Translator | |
|
addResource(string $format, mixed $resource, string $locale, string $domain = 'messages')
Adds a Resource. |
from Translator | |
|
setLocale(string $locale)
Sets the current locale. |
from Translator | |
| string |
getLocale()
Returns the current locale. |
|
|
setFallbackLocale(string $locale)
Sets the fallback locale. |
from Translator | |
| string |
trans(string $id, array $parameters = array(), string $domain = 'messages', string $locale = null)
Translates the given message. |
from Translator |
| string |
transChoice(string $id, integer $number, array $parameters = array(), string $domain = 'messages', string $locale = null)
Translates the given choice message by choosing a translation according to a number. |
from Translator |
Details
at line 46
public
__construct(ContainerInterface $container, MessageSelector $selector, array $loaderIds = array(), array $options = array(), Session $session = null)
Constructor.
in Translator at line 57
public
addLoader(string $format, LoaderInterface $loader)
Adds a Loader.
in Translator at line 72
public
addResource(string $format, mixed $resource, string $locale, string $domain = 'messages')
Adds a Resource.
in Translator at line 82
public
setLocale(string $locale)
Sets the current locale.
at line 70
public string
getLocale()
Returns the current locale.
in Translator at line 104
public
setFallbackLocale(string $locale)
Sets the fallback locale.
in Translator at line 117
public string
trans(string $id, array $parameters = array(), string $domain = 'messages', string $locale = null)
Translates the given message.
in Translator at line 135
public string
transChoice(string $id, integer $number, array $parameters = array(), string $domain = 'messages', string $locale = null)
Translates the given choice message by choosing a translation according to a number.