PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Zend_Application_Resource_Translate

Zend_Application_Resource_Translate will initialize a Zend_Translate adapter based on the options passed to it.

The following configuration keys are recognized:

  • adapter : Zend_Translate adapter type. The default adapter is array if not specified.

  • data : path to translation.

  • locale : defining the locale to be used in translation. By default, the locale can be detected automatically or forcing with a Zend_Locale instance store in Zend_Registry with a single locale.

  • options : the options are different for each adapter. See the section the section called “Options for adapters” for more details.

  • registry : the custom key to store the Zend_Translate instance in the registry. By default, the key is Zend_Translate.

  • cache : the name of the cache template or an instance of Zend_Cache_Core to use as cache for Zend_Translate_Adapter. The goal is to accelerate the loading specialy for the XML based files.

Example 51. Sample translate adapter resource configuration

Below is an example INI configuration that can be used to initialize the translate resource.

resources.translate.adapter = tmx
resources.translate.content = APPLICATION_PATH "/../data/locales"
resources.translate.scan = Zend_Translate::LOCALE_DIRECTORY

; Optionally you can also the cache template to use for caching:
resources.translate.cache = "languages"

Zend Framework