PHP code example of wokster / yii2-translation-manager

1. Go to this page and download the library: Download wokster/yii2-translation-manager 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/ */

    

wokster / yii2-translation-manager example snippets


'translate-manager' => [
            'class' => 'wokster\translationmanager\TranslationManager',
            'languages' => ['en','ru','fr'],
        ],

        'i18n' => [
            'translations' => [
                'yii*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@vendor/yiisoft/yii2/messages',
                    'sourceLanguage' => 'en'
                ],
                '*' => [
                    'class' => 'yii\i18n\DbMessageSource',
                    'forceTranslation'=>true,
                    //'enableCaching' => false,
                    //'cachingDuration' => 3600,
                ]
            ],
        ],

yii migrate --migrationPath=@yii/i18n/migrations/