Set lang in Kartik widget


I have a problem. I want set polish lang in kartik datetimepicker.

Works only ‘en’ and ‘de’

I set labels for clear and choose date. I was simple. I added a directory and file with translations.

In config file add ‘pl’ in array

But though set ‘language’ => ‘pl’ month names, day names are stil in english.

use kartik\datetime\DateTimePicker;

<?= $form->field($model, 'data_koniec')->widget(DateTimePicker::className(),[ 

				'name' => 'wydarzenie_koniec',

				'pluginOptions' =>


					'autoclose' => true,

					'format' => 'yyyy-mm-dd hh:ii:ss',


			]); ?>

//my lang set

if ($id == 1) Yii::$app->language = 'pl';

else if ($id == 2) Yii::$app->language = 'en';

else Yii::$app->language = 'de';

Anyone can help?


Looks like there is no ‘pl’ folder for this widget.

PS. I’ve made PR with PL translation.

I wrote that I added a folder pl and translation file for button labels. Work ok.

But I have problem with month and day names specified for polish language.

In \vendor\kartik-v\yii2-widget-datetimepicker\assets\js\locales exists file with ‘pl’. But labels aren’t translated.

This file ?

Yes, all files exsists but months doesn’t translate.

I have no idea how set polish month labels when change I language.

English, German works.

This component takes a site default language (english) to show a calendar. I just put a ‘language’ => ‘ua-UK’, to the config file and now I have a cal in ukrainian language :)



Still doesn’t work. I changed language, I added as param in widget but polish language dosen’t work.

Have you set ‘pl’ or ‘pl-PL’?

I set ‘pl’

But when I set ‘language’ => ‘pl-PL’ locales aren’t translated.

Other languages like ‘fr’, ‘de’ … works. But problem is only with polish.

Maybe problem is in my xampp(apache)?

No. You said the site-language have changed when you set ‘language’ => ‘pl’, calendar should changed too 'coze it utilize a yii lang file for cal translate.

Can You try change in datetimepicker language to polish?

There’s an error with a pl lang file. See a screen below. That why polish lang did’nt work.



Where should I report this bug?