PHP code example of zelenin / yii2-i18n-module

1. Go to this page and download the library: Download zelenin/yii2-i18n-module library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zelenin / yii2-i18n-module example snippets


'i18n' => [
	'class' => Zelenin\yii\modules\I18n\components\I18N::className(),
	'languages' => ['ru-RU', 'de-DE', 'it-IT']
],

'modules' => [
	'i18n' => Zelenin\yii\modules\I18n\Module::className()
],

'i18n' => [
    'class'=> Zelenin\yii\modules\I18n\components\I18N::className(),
    'languages' => ['ru-RU', 'de-DE', 'it-IT'],
    'translations' => [
        'yii' => [
            'class' => yii\i18n\DbMessageSource::className()
        ]
    ]
],

php composer.phar 

php yii migrate --migrationPath=@Zelenin/yii/modules/I18n/migrations

php yii i18n/export @Zelenin/yii/modules/I18n/messages zelenin/modules/i18n

php yii i18n/import @yii/messages