class Translator implements TranslatorInterface
Translator.
Methods
|
__construct(string $locale, MessageSelector $selector)
Constructor. |
||
|
addLoader(string $format, LoaderInterface $loader)
Adds a Loader. |
||
|
addResource(string $format, mixed $resource, string $locale, string $domain = 'messages')
Adds a Resource. |
||
|
setLocale(string $locale)
Sets the current locale. |
||
| string |
getLocale()
Returns the current locale. |
|
|
setFallbackLocale(string $locale)
Sets the fallback locale. |
||
| string |
trans(string $id, array $parameters = array(), string $domain = 'messages', string $locale = null)
Translates the given message. |
|
| 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. |
Details
at line 40
public
__construct(string $locale, MessageSelector $selector)
Constructor.
at line 57
public
addLoader(string $format, LoaderInterface $loader)
Adds a Loader.
at line 72
public
addResource(string $format, mixed $resource, string $locale, string $domain = 'messages')
Adds a Resource.
at line 82
public
setLocale(string $locale)
Sets the current locale.
at line 92
public string
getLocale()
Returns the current locale.
at line 104
public
setFallbackLocale(string $locale)
Sets the fallback locale.
at line 117
public string
trans(string $id, array $parameters = array(), string $domain = 'messages', string $locale = null)
Translates the given message.
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.