How to set the language in yii:
Method 1: Comment out the following code in app\web\index.php:
(new yii\web\Application($config))->run();
Add The following code:
$app = new \yii\web\Application($config); $app->language = "zh-CN";//设置中国区的语言 $app->run(); //(new yii\web\Application($config))->run();
Method 2: Set in app\config\web.php:
$config = [ .... 'language'=>'zh_CN', 'id' => 'basic', ... ]
Related tutorial recommendations:yii framework
The above is the detailed content of Where to set language in yii. For more information, please follow other related articles on the PHP Chinese website!