yii2 - solve error with translation - Unable to locate message source for category 'category'

yii2
voted: 1
vote
php yii2 translation array

To solve this error translation configuration must be added to config. In config/web.php add folowing array in 'components' array.

'i18n' => [
            'translations' => [
                '*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@app/messages', // if advanced application, set @frontend/messages
                    'sourceLanguage' => 'en',
                    'fileMap' => [
                    //'main' => 'main.php',
                    ],
                ],
            ],
        ]
working url: not entered
version: 2
Leave a Comment:
Characters left:
No comments yet.