| Fully Qualified Name: | Zend\I18n\Translator\Translator |
| Implements: | TranslatorInterface |
Translator.
| Name | Description | Defined By |
|---|---|---|
| addRemoteTranslations() | Add remote translations. | Translator |
| addTranslationFile() | Add a translation file. | Translator |
| addTranslationFilePattern() | Add multiple translations with a file pattern. | Translator |
| clearCache() | Clears the cache for a specific textDomain and locale. | Translator |
| disableEventManager() | Disable the event manager. | Translator |
| enableEventManager() | Enable the event manager. | Translator |
| factory() | Instantiate a translator | Translator |
| getAllMessages() | Return all the messages. | Translator |
| getCache() | Returns the set cache | Translator |
| getCacheId() | Get the cache identifier for a specific textDomain and locale. | Translator |
| getEventManager() | Get the event manager. | Translator |
| getFallbackLocale() | Get the fallback locale. | Translator |
| getLocale() | Get the default locale. | Translator |
| getPluginManager() | Retrieve the plugin manager for translation loaders. | Translator |
| isEventManagerEnabled() | Check whether the event manager is enabled. | Translator |
| setCache() | Sets a cache | Translator |
| setEventManager() | Set the event manager instance used by this translator. | Translator |
| setFallbackLocale() | Set the fallback locale. | Translator |
| setLocale() | Set the default locale. | Translator |
| setPluginManager() | Set the plugin manager for translation loaders | Translator |
| translate() | Translate a message. | Translator |
| translatePlural() | Translate a plural message. | Translator |
Add remote translations.
| Parameter Name | Type | Description |
|---|---|---|
| $type | string | |
| $textDomain | string |
Returns: \Translator
Add a translation file.
| Parameter Name | Type | Description |
|---|---|---|
| $type | string | |
| $filename | string | |
| $textDomain | string | |
| $locale | string |
Returns: \Translator
Add multiple translations with a file pattern.
| Parameter Name | Type | Description |
|---|---|---|
| $type | string | |
| $baseDir | string | |
| $pattern | string | |
| $textDomain | string |
Returns: \Translator
Clears the cache for a specific textDomain and locale.
| Parameter Name | Type | Description |
|---|---|---|
| $textDomain | string | |
| $locale | string |
Returns: bool
Disable the event manager.
Returns: \Translator
Enable the event manager.
Returns: \Translator
Instantiate a translator
| Parameter Name | Type | Description |
|---|---|---|
| $options | array|\Traversable |
Returns: \Translator
Return all the messages.
| Parameter Name | Type | Description |
|---|---|---|
| $textDomain | string | |
| $locale | null |
Returns: mixed
Returns the set cache
Returns: \CacheStorage The set cache
Get the cache identifier for a specific textDomain and locale.
| Parameter Name | Type | Description |
|---|---|---|
| $textDomain | string | |
| $locale | string |
Returns: string
Get the event manager.
Returns: \EventManagerInterface|null
Get the fallback locale.
Returns: string
Get the default locale.
Returns: string
Retrieve the plugin manager for translation loaders.
Lazy loads an instance if none currently set.
Returns: \LoaderPluginManager
Check whether the event manager is enabled.
Returns: bool
Sets a cache
| Parameter Name | Type | Description |
|---|---|---|
| $cache | \CacheStorage |
Returns: \Translator
Set the event manager instance used by this translator.
| Parameter Name | Type | Description |
|---|---|---|
| $events | \EventManagerInterface |
Returns: \Translator
Set the fallback locale.
| Parameter Name | Type | Description |
|---|---|---|
| $locale | string |
Returns: \Translator
Set the default locale.
| Parameter Name | Type | Description |
|---|---|---|
| $locale | string |
Returns: \Translator
Set the plugin manager for translation loaders
| Parameter Name | Type | Description |
|---|---|---|
| $pluginManager | \LoaderPluginManager |
Returns: \Translator
Translate a message.
| Parameter Name | Type | Description |
|---|---|---|
| $message | string | |
| $textDomain | string | |
| $locale | string |
Returns: string
Translate a plural message.
| Parameter Name | Type | Description |
|---|---|---|
| $singular | string | |
| $plural | string | |
| $number | int | |
| $textDomain | string | |
| $locale | string|null |
Returns: string