class Translator extends Translator
Translator.
Methods
|
__construct(ContainerInterface $container, MessageSelector $selector, array $loaderIds = array(), array $options = array())
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|array $locales)
Sets the fallback locale(s). |
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 45
public
__construct(ContainerInterface $container, MessageSelector $selector, array $loaderIds = array(), array $options = array())
Constructor.
in Translator at line 78
public
addLoader(string $format, LoaderInterface $loader)
Adds a Loader.
in Translator at line 93
public
addResource(string $format, mixed $resource, string $locale, string $domain = 'messages')
Adds a Resource.
in Translator at line 105
public
setLocale(string $locale)
Sets the current locale.
at line 68
public string
getLocale()
Returns the current locale.
in Translator at line 127
public
setFallbackLocale(string|array $locales)
Sets the fallback locale(s).
in Translator at line 140
public string
trans(string $id, array $parameters = array(), string $domain = 'messages', string $locale = null)
Translates the given message.
in Translator at line 158
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.