-
-
Save samsonasik/8f227f9dc0ccce4f6bb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
// the following assumes that you are using composer | |
// and that your main application entrance point (i.e. public/index.php) changes the working directory | |
// to the one containing the 'vendor' dir, like in ZendSkeletonApplication. | |
'translator' => [ | |
'locale' => 'it', | |
'translation_file_patterns' => [ | |
[ | |
'type' => 'phpArray', | |
'base_dir' => 'vendor/zendframework/zendframework/resources/languages', | |
'pattern' => '%s/Zend_Captcha.php', | |
'text_domain' => 'zend_validate', | |
], | |
[ | |
'type' => 'phpArray', | |
'base_dir' => 'vendor/zendframework/zendframework/resources/languages', | |
'pattern' => '%s/Zend_Validate.php', | |
'text_domain' => 'zend_validate', | |
] | |
], | |
], | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application; | |
use Zend\Mvc\MvcEvent; | |
use Zend\Validator\AbstractValidator; | |
class Module | |
{ | |
public function onBootstrap(MvcEvent $event) | |
{ | |
$application = $event->getApplication(); | |
$serviceManager = $application->getServiceManager(); | |
$translator = $serviceManager->get('translator'); | |
AbstractValidator::setDefaultTranslator($translator, 'zend_validate'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment