Closed dan-developer closed 5 years ago
I've the same issue, any workaround beside copying the language file in the expected path?
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.
Anyone ever coming across this problem. This is the least ugly workaround I could come up with:
$config['components']['assetManager'] = [
'bundles' => ArrayHelper::merge(
require (__DIR__ . '/' . 'assets-prod.php'),
[
'kartik\\date\\DatePickerAsset' => [
'sourcePath' => '@vendor/kartik-v/yii2-widget-datepicker/src/assets',
]
]
)
];
Basically, it works by overriding the automatically generated assets-prod.php
, by resetting the path again to the asset. This will allow the browser to correctly load the language JS file.
When using the Yii 2 assets compressor it's all compressed into one file only, so the language file is loading when the widget is called, then the following error occurs:
the problem is here: https://github.com/kartik-v/yii2-widget-datepicker/blob/master/DatePicker.php#L221
my assets config: