Hi!
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?
Thanks!
Bizley
(Bizley)
July 28, 2015, 11:41am
2
Looks like there is no ‘pl’ folder for this widget. https://github.com/kartik-v/yii2-widget-datetimepicker/tree/master/messages
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.
Bizley
(Bizley)
July 29, 2015, 8:47am
4
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.
aisogroup
(E Poremchuk)
August 4, 2015, 10:02am
6
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
6669
Still doesn’t work. I changed language, I added as param in widget but polish language dosen’t work.
Bizley
(Bizley)
August 4, 2015, 1:16pm
8
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)?
aisogroup
(E Poremchuk)
August 5, 2015, 8:07am
10
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.
daniel0801:
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)?
Can You try change in datetimepicker language to polish?
aisogroup
(E Poremchuk)
August 5, 2015, 9:40am
12
There’s an error with a pl lang file. See a screen below. That why polish lang did’nt work.
6671
Where should I report this bug?