cagartner
10/30/2013 - 7:05 PM

Tradutor de mensagens padrões do ZF2

Tradutor de mensagens padrões do ZF2

#########################################
        # Tradutor de mensagens de erro do form #
        #########################################

        $translator = $e->getApplication()->getServiceManager()->get('MvcTranslator');
        $translator->addTranslationFile(
            'phpArray',
            'vendor/zendframework/zendframework/resources/languages/pt_BR/Zend_Validate.php',
            'default'
        );
        \Zend\Validator\AbstractValidator::setDefaultTranslator($translator);