Unable to locate message source for category 'comm

作者:谢高升 发布:2017-09-23 浏览:1829次

Yii2.0  CURD报错 Unable to locate message source for category 'common'.


image.png


image.png


从报错信息来看是 yii\i18n\I18N::getMessageSource('common')貌似是没有配置 i18n

然后去配置文件 backend/config/main.php配置

        //语言包配置
        'i18n'=>[
            'translations'=>[
                '*'=>[
                    'class'=>'yii\i18n\PhpMessageSource',
                    'fileMap'=>[
                        'common'=>'common.php',
                    ],
                ],
            ],
        ],

然后刷新之后就ok了;

标签: yii语言包
感谢博主,喝杯咖啡~