aminbbb92/yii2-multi-language
Composer 安装命令:
composer require aminbbb92/yii2-multi-language
包简介
This will help multi-language for Yii2
README 文档
README
This module allow you to create multi language use database. By default, Yii use Yii::t() for multi language. But you must stored the sentences on file, and it never suggested keywords for you. Now you can store it on mySql.
Requirements
Install & config:
Install
Preferred way to install this extension through composer
Either run
composer require aminbbb92/yii2-multi-language "^2.0"
Or add to require section of composer.json then run composer update
"aminbbb92/yii2-multi-language" : "^2.0"
Config:
[php]
'language' => 'en', //TODO Change this to 2 characters
.....................
'bootstrap' => [
'log',
'multiLanguage',
],
'components' => [
'multiLanguage' => [
'class' => '\aminbbb92\language\Component',
],
],
'modules' => [
'gridview' => [
'class' => '\kartik\grid\Module',
],
'language' => [
'class' => '\aminbbb92\language\Module',
/*TODO uncommented if you want to custom view*/
//'viewPath' => '@app/vendor/aminbbb92/yii2-multi-language/src/views',
/*TODO uncommented if you want to change suffix of translated table / model.
should be one word, lowercase only.*/
//'suffix' => 'translate',
],
],
Run Yii Migration, you will have two default language (English & Vietnamese):
php yii migrate/up --migrationPath=@vendor/aminbbb92/yii2-multi-language/src/migrations
Usage
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-31