我有Yii项目并将我的语言在config / main.php中更改为fa_ir,并设置组件basePath = protected / messages但是没有更改basePath,但是从框架目录中选择了fa_ir !!!
我的项目main.php代码:
return.array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'New web site',
'defaultController'=>'site',
//'timezone'=>'Asia/Tehran',
'language'=>'fa_ir',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'application.extensions.*',
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'123',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'messages'=>array(
'basePath'=>Yiibase::getPathOfAlias('application.messages'),
),
// uncomment the following to enable URLs in path-format
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
和......
所以目录文件是:protect / message / fa_ir / yii.php和zii.php
我非常感谢受访者。
答案 0 :(得分:0)
使用单一语言尝试:
'language'=>'fa',
或者:
'language'=>'ir',
并将其用于您的目录。