kartik-v / yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 4.x/3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)
Other
229 stars 96 forks source link

Translate fileinput don't work with 'pt-BR' and 'zh-TW' #150

Closed RochaXavier closed 5 years ago

RochaXavier commented 5 years ago

I try to translate the plugin with yii2 widget, but it doesn't work:

    $form->field($model, 'arquivos')->widget(FileInput::className(), [
        'options' => [
            'multiple' => true
        ],
        'language' => 'pt-BR',
        'pluginOptions' => [
            'maxFileCount' => 10
        ]
    ]);

When I try with another language it works, only 'pt-BR' and 'zh-TW' don't.

Looking at the network panel, the file is loaded correctly "/web/assets/d32e62c3/js/locales/pt-BR.js" but the script wrinten by widget sets language to "pt" as follows.

<script>window.fileinput_66e1ded4 = {"maxFileCount":10,"language":"pt","resizeImage":false,"autoOrientImage":true,"theme":"fas","purifyHtml":true};
</script>

Yii version: 2.0.19 Jquery version: 3.3.1 bootstrap-fileinput version: 5.0.3

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

denis-sanches commented 3 years ago

Hi guys! I'm facing the same problem trying to set up 'pt-BR' language. It appears to be the same related by @RochaXavier.

My app is currently set up with config Yii::$app->language => 'pt-BR' according to Yii2 Guide - i18n.

Some tests:

Is that a bug, or what am I doing wrong? @RochaXavier, did you find the solution?

Thank you!