samdark / yii2-cookbook

Yii 2.0 Community Cookbook
1.45k stars 296 forks source link

Using IDs in translations instead of full strings #48

Closed samdark closed 8 years ago

samdark commented 9 years ago

Force translation in messages source:


'components' => [
        'i18n' => [
            'translations' => [
                'app*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@app/messages',
                    'sourceLanguage' => 'en_US',
                    'forceTranslation' => true, // <---- HERE!
                ],
            ],
        ],
samdark commented 9 years ago

http://www.yiiframework.com/forum/index.php/topic/63349-create-translation-folder-for-en/page__gopid__279323#entry279323