Open polgarz opened 6 years ago
Possible solution is to pass translation configuration to plugin:
FileUpload::widget([
'model' => $model,
'attribute' => 'upload[]',
...
'i18n' => [
'sourceLanguage' => 'en',
'basePath' => '@fileupload/messages',
'class' => 'yii\i18n\PhpMessageSource',
],
]);
Alternative, if you want to control it from central config:
FileUpload::widget([
'model' => $model,
'attribute' => 'upload[]',
...
'i18n' => ArrayHelper::getValue(Yii::$app->i18n->translations, 'fileupload', null),
]);
If you need to setup translation manually for whatever reason, it's not working, because the widget overwrite the i18n settings in the config.