Skip to content

Translation is not passed to the bootstrap-fileinput #33

Closed
@aliechti

Description

@aliechti

Nothing is translated by default, because the language is not passed to the bootstrap-fileinput. The translation file is loaded but the bootstrap-fileinput language is set to default.

A workaround is to set it manually at every fileinput

<?= $form->field($article, 'file')->widget(FileInput::className(), [
    'pluginOptions' => [
        'language' => Yii::$app->language
    ],
]) ?>

To fix it, I think it should be set at the widget init()

if (!isset($this->pluginOptions['language'])) $this->pluginOptions['language'] = $this->language;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions