I have installed 3 environments.
My application must download different translation sets, because each env is different.
I have a language RO, HU, DE.
I am trying to install translations but this will not work.
in frontend / config main.php I have:
'sourceLanguage' => 'en',
'language' => 'en',
in frontend/web/index.phpi:
defined('YII_ENV') or define('YII_ENV', 'dev_ro');
also, I am merging the configuration array:
(file_exists(__DIR__ . '/../../environments/' . YII_ENV . '/common/config/main-local.php') ? require(__DIR__ . '/../../environments/' . YII_ENV . '/common/config/main-local.php') : [])
now, in environments/dev_ro/common/config/, in componentsi:
'i18n' => [
'translations' => [
'companie' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@app/messages',
'sourceLanguage' => 'en',
'fileMap' => [
'companie' => 'companie.php',
],
],
],
],
in the model CompanieI have:
'nume' => Yii::t('companie', 'Name'),
This is a movie, with my thing:
movie