zoukankan      html  css  js  c++  java
  • zendframework多语言配置(默认语言文件)

    /*****************module.config.php******************/
    'service_manager' => array(
            'aliases' => array(
                'translator' => 'MvcTranslator',
            )
        ),
    //配置
    'translator'      => array(
            'locale'                    => 'zh_CN',
            'translation_file_patterns' => array(
                array(
                    'type'     => 'gettext',
                    'base_dir' => __DIR__ . '/../language',//路径根据实际情况修改
                    'pattern'  => '%s.mo'
                )
            ),
            'translation_files'         => array(
                array(
                    'type'     => 'phparray',
                    'filename' => __DIR__
                        . '/../../../vendor/zendframework/zendframework/resources/languages/zh/Zend_Validate.php',
                ),
                array(
                    'type'     => 'phparray',
                    'filename' => __DIR__
                        . '/../../../vendor/zendframework/zendframework/resources/languages/zh/Zend_Captcha.php',
                ),
            ),
    
        ),
    
    /******************Module.php********************/
    public function onBootstrap(MvcEvent $e)
        {
            endValidatorAbstractValidator::setDefaultTranslator($e->getApplication()->getServiceManager()->get('translator'));
        }
  • 相关阅读:
    生成微博授权URL及回调地址
    微博三方登录
    celery异步发送短信
    celery配置
    celery原理与组件
    Django----短信验证接口
    Django----图片验证码接口
    编写注册接口
    jwt安装配置
    day19-Exception
  • 原文地址:https://www.cnblogs.com/flytome/p/4761446.html
Copyright © 2011-2022 走看看