Skip to content

Instantly share code, notes, and snippets.

@rufinus
Created November 8, 2012 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rufinus/4039436 to your computer and use it in GitHub Desktop.
Save rufinus/4039436 to your computer and use it in GitHub Desktop.
Zend Cache for I18N
return array(
'factories' => array(
'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
'default_cache' => function($sm) {
$cache = \Zend\Cache\StorageFactory::factory(array(
'adapter' => array(
'name' => 'apc',
'options' => array(
),
),
'plugins' => array(
'exception_handler' => array('throw_exceptions' => false),
'serializer'
)
));
return $cache;
},
),
'translator' => array(
'locale' => 'de_DE',
'translation_file_patterns' => array(
array(
'type' => 'phparray',
'base_dir' => realpath(__DIR__ . '/../../../').'/vendor/zendframework/zendframework/resources/languages/de/',
'pattern' => 'Zend_Validate.php',
'cache' => 'default_cache'
),
array(
'type' => 'gettext',
'base_dir' => 'data/language/',
'pattern' => '%s.mo',
'text_domain' => 'admin',
'cache' => 'default_cache'
),
),
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment