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'));
        }
  • 相关阅读:
    开课 博客
    给定数组求数组中和最大子数组的和
    课堂测验
    读梦断代码有感(3)2019.2.20
    读梦断代码有感(2)2019.2.10
    读梦断代码有感(1)2019.2.05
    进度七
    进度 六
    sjz地铁作业
    进度四
  • 原文地址:https://www.cnblogs.com/flytome/p/4761446.html
Copyright © 2011-2022 走看看