1927. Class

1927.1. Zend\I18n\Translator\Translator

Translator.

1927.1.1. Methods

1927.1.1.1. factory

factory()

Instantiate a translator

Parameters:array|Traversable
Return type:Translator
Throws :ExceptionInvalidArgumentException

1927.1.1.2. setLocale

setLocale()

Set the default locale.

Parameters:string
Return type:Translator

1927.1.1.3. getLocale

getLocale()

Get the default locale.

Return type:string

1927.1.1.4. setFallbackLocale

setFallbackLocale()

Set the fallback locale.

Parameters:string
Return type:Translator

1927.1.1.5. getFallbackLocale

getFallbackLocale()

Get the fallback locale.

Return type:string

1927.1.1.6. setCache

setCache()

Sets a cache

Parameters:CacheStorage
Return type:Translator

1927.1.1.7. getCache

getCache()

Returns the set cache

Return type:CacheStorage The set cache

1927.1.1.8. setPluginManager

setPluginManager()

Set the plugin manager for translation loaders

Parameters:LoaderPluginManager
Return type:Translator

1927.1.1.9. getPluginManager

getPluginManager()

Retrieve the plugin manager for translation loaders.

Lazy loads an instance if none currently set.

Return type:LoaderPluginManager

1927.1.1.10. translate

translate()

Translate a message.

Parameters:
  • string
  • string
  • string
Return type:

string

1927.1.1.11. translatePlural

translatePlural()

Translate a plural message.

Parameters:
  • string
  • string
  • int
  • string
  • string|null
Return type:

string

Throws :

ExceptionOutOfBoundsException

1927.1.1.12. getTranslatedMessage

getTranslatedMessage()

Get a translated message.

Parameters:
  • string
  • string
  • string
Return type:

string|null

1927.1.1.13. addTranslationFile

addTranslationFile()

Add a translation file.

Parameters:
  • string
  • string
  • string
  • string
Return type:

Translator

1927.1.1.14. addTranslationFilePattern

addTranslationFilePattern()

Add multiple translations with a file pattern.

Parameters:
  • string
  • string
  • string
  • string
Return type:

Translator

1927.1.1.15. addRemoteTranslations

addRemoteTranslations()

Add remote translations.

Parameters:
  • string
  • string
Return type:

Translator

1927.1.1.16. loadMessages

loadMessages()

Load messages for a given language and domain.

Parameters:
  • string
  • string
Throws ExceptionRuntimeException:
 
Return type:

void