Closed ydakilux closed 7 years ago
I think you need both configuration:
'components' => [
'i18n' => [
'translations' => [
'*' => [
'class' => 'yii\i18n\DbMessageSource',
'db' => 'db',
'sourceLanguage' => 'en-US', // Developer language
'sourceMessageTable' => '{{%language_source}}',
'messageTable' => '{{%language_translate}}',
'cachingDuration' => 86400,
'enableCaching' => true,
],
'app' => [
'class' => 'yii\i18n\DbMessageSource',
'db' => 'db',
'sourceLanguage' => 'en-US', // Developer language
'sourceMessageTable' => '{{%language_source}}',
'messageTable' => '{{%language_translate}}',
'cachingDuration' => 86400,
'enableCaching' => true,
],
],
],
When i used the following configuration
I have access to the www.mysite.com/translatemanager en www.mysite.com is not translated
But when I use :
My site is translated, but I can't acces anymore to the translatemanager, I get :
exception 'yii\base\InvalidConfigException' with message 'Unable to locate message source for category 'model'.' in /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/i18n/I18N.php:200 Stack trace: #0 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/i18n/I18N.php(88): yii\i18n\I18N->getMessageSource('model') #1 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/BaseYii.php(517): yii\i18n\I18N->translate('model', 'Language ID', Array, 'en-US') #2 /home/admin/web/manager.virtualotc.eu/public_html/vendor/lajax/yii2-translate-manager/models/Language.php(95): yii\BaseYii::t('model', 'Language ID') #3 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/db/BaseActiveRecord.php(1552): lajax\translatemanager\models\Language->attributeLabels() #4 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/data/ActiveDataProvider.php(186): yii\db\BaseActiveRecord->getAttributeLabel('language_id') #5 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/base/Component.php(172): yii\data\ActiveDataProvider->setSort(Array) #6 /home/admin/web/manager.virtualotc.eu/public_html/vendor/lajax/yii2-translate-manager/controllers/actions/ListAction.php(38): yii\base\Component->__set('sort', Array) #7 [internal function]: lajax\translatemanager\controllers\actions\ListAction->run() #8 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/base/Action.php(94): call_user_func_array(Array, Array) #9 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\Action->runWithParams(Array) #10 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/base/Module.php(523): yii\base\Controller->runAction('list', Array) #11 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/web/Application.php(102): yii\base\Module->runAction('translatemanage...', Array) #12 /home/admin/web/manager.virtualotc.eu/public_html/vendor/yiisoft/yii2/base/Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request)) #13 /home/admin/web/manager.virtualotc.eu/public_html/backend/web/index.php(17): yii\base\Application->run() #14 {main}
I'm using : Yii 2.0.12 - PHP 5.6.30-0+deb8u1
Please help