Home PHP Framework YII Where to set language in yii

Where to set language in yii

Mar 11, 2020 pm 02:23 PM
yii

Where to set language in yii

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();
Copy after login

Add The following code:

$app = new \yii\web\Application($config);
$app->language = "zh-CN";//设置中国区的语言
$app->run();
//(new yii\web\Application($config))->run();
Copy after login

Method 2: Set in app\config\web.php:

$config = [
....
    'language'=>'zh_CN',
    'id' => 'basic',
...
]
Copy after login

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

Hot Article

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use Yii3 framework in php? How to use Yii3 framework in php? May 31, 2023 pm 10:42 PM

How to use Yii3 framework in php?

How to use PHP framework Yii to develop a highly available cloud backup system How to use PHP framework Yii to develop a highly available cloud backup system Jun 27, 2023 am 09:04 AM

How to use PHP framework Yii to develop a highly available cloud backup system

Yii2 vs Phalcon: Which framework is better for developing graphics rendering applications? Yii2 vs Phalcon: Which framework is better for developing graphics rendering applications? Jun 19, 2023 am 08:09 AM

Yii2 vs Phalcon: Which framework is better for developing graphics rendering applications?

Data query in Yii framework: access data efficiently Data query in Yii framework: access data efficiently Jun 21, 2023 am 11:22 AM

Data query in Yii framework: access data efficiently

Symfony vs Yii2: Which framework is better for developing large-scale web applications? Symfony vs Yii2: Which framework is better for developing large-scale web applications? Jun 19, 2023 am 10:57 AM

Symfony vs Yii2: Which framework is better for developing large-scale web applications?

How to convert yii objects into arrays or directly output to json format How to convert yii objects into arrays or directly output to json format Jan 08, 2021 am 10:13 AM

How to convert yii objects into arrays or directly output to json format

Yii2 Programming Guide: How to run Cron service Yii2 Programming Guide: How to run Cron service Sep 01, 2023 pm 11:21 PM

Yii2 Programming Guide: How to run Cron service

CodeIgniter vs Yii2: Which framework is better for developing distributed web applications? CodeIgniter vs Yii2: Which framework is better for developing distributed web applications? Jun 19, 2023 am 08:12 AM

CodeIgniter vs Yii2: Which framework is better for developing distributed web applications?

See all articles