dongrim / language
Multilanguage module for Yii2 Framework.
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
This package is auto-updated.
Last update: 2024-12-26 18:02:41 UTC
README
####Download:
Download from Github.
Composer
composer require dongrim/language
Подключаем модуль
'language' => [
'class' => 'dongrim\language\Module',
//'customWidgetView' => '/views'
],
Database migrations
php yii migrate/up --migrationPath=@dongrim/language/migrations
Config
Устанавливаем язык пользователя (language) и исходный язык приложения (sourceLanguage)
'language'=>'ru-RU',
'sourceLanguage'=>'en-US',
В блок components - urlManager конфигурационного файла config/web.php добавляем:
'urlManager' => [
'class'=>'dongrim\language\components\LangUrlManager',
...
]
Добавляем в request конфигурационного файла config/web.php :
'request' => [
'class' => 'dongrim\language\components\LangRequest'
...
],
Usage
use dongrim\language\widgets\WLang;
<?= WLang::widget();?>