Yii2 lajax翻译管理器扫描错误

时间:2017-05-31 17:41:49

标签: php yii2 yii2-basic-app

当我尝试运行./yii translate / scan命令时,我在Extreacting消息后收到此错误消息: 例外' yii \ base \ InvalidConfigException'有消息'无法找到类别' DbMessageSource'的消息来源。'

配置/ web.php

'components' => [
    'i18n' => [
        'translations' => [
            '*' => [
                'class' => 'yii\i18n\DbMessageSource',
                'db' => 'db',
                'sourceLanguage' => 'hu-HU', // Developer language
                'sourceMessageTable' => '{{%language_source}}',
                'messageTable' => '{{%language_translate}}',
                'forceTranslation' => true,
                'cachingDuration' => 86400,
                'enableCaching' => true,
            ],
        ] 
    ],
    'translatemanager' => [
        'class' => 'lajax\translatemanager\Component',
    ],
    'modules' => [
         'class' => 'lajax\translatemanager\Module',
        'layout' => '//main',        
        'allowedIPs' => ['*'],         
        'roles' => ['Admin'],              
    ]
]

配置/ console.php

'modules' => [
    'translatemanager' => [
        'class' => 'lajax\translatemanager\Module',
        'tmpDir' => 'runtime',         // Writable directory for the client-side temporary language files. 
                                        // IMPORTANT: must be identical for all applications (the AssetsManager serves the JavaScript files containing language elements from this directory).
        //'root' => '@app',               // The root directory of the project scan.
        'phpTranslators' => ['::t'],    // list of the php function for translating messages.
        'jsTranslators' => ['lajax.t'], // list of the js function for translating messages.
        'patterns' => ['*.js', '*.php'],// list of file extensions that contain language elements.
        'ignoredCategories' => ['yii'], // these categories won’t be included in the language database.
        'ignoredItems' => ['config'],   // these files will not be processed.
        'scanTimeLimit' => null,        // increase to prevent "Maximum execution time" errors, if null the default max_execution_time will be used
        'searchEmptyCommand' => '!',    // the search string to enter in the 'Translation' search field to find not yet translated items, set to null to disable this feature
        'defaultExportStatus' => 1,     // the default selection of languages to export, set to 0 to select all languages by default
        'defaultExportFormat' => 'json',// the default format for export, can be 'json' or 'xml'
        'tables' => [                   // Properties of individual tables
            [
                'connection' => 'db',   // connection identifier
                'table' => '{{%language}}',         // table name
                'columns' => ['name', 'name_ascii'], //names of multilingual fields
                'category' => 'database-table-name',// the category is the database table name
            ],
        ]
    ],
],
'controllerMap' => [
    'translate' => \lajax\translatemanager\commands\TranslatemanagerController::className(),
],

你知道我的配置有什么问题或遗漏了什么吗?

0 个答案:

没有答案