Date field - date are not localized (fr)

Hi,
I would like that my field date show date in French, but despite my conf, I got date in English (may 2024).

The selector is in french

But in the field is in English

It behave the same in local (MacOs with Herd) and on production (Infomaniak server).

conf.php

	'locale' => 'fr_FR.utf8',
	'date.handler' => 'intl',
	'date.timezone' => 'Europe/Paris',
	

in my ini.php (i use herd on macOs)

date.timezone = "Europe/Paris"
intl.default_locale = fr_FR

My blueprint

 month:
      type: date
      display: MMM YYYY

How can I fix that ?

Thanks :pray:

I don’t know, I guess it’s not supported, but hard to find anything conclusive in the date field related issues.

Ping @distantnative?

It’s indeed not supported. Kirby only loads the English i18n strings of the dayjs library that powers the date field in the Panel.

We haven’t found a way to dynamically load the i18n strings for the user’s current language sadly. And it’s not an option to load all of them for performance reasons.

I had the same problem.
So I tried to access datejs from within a user-defined panel.js. I wanted to make this happen:

Load in a language file for nl_NL and tell dayjs to use it:

import 'dayjs/locale/nl' // load on demand
dayjs.locale('nl') // use Dutch locale globally

But I wasn’t able to get it working, because I don’t know how to call the function dayjs from within this script. And there is always the possibility that it wouldn’t work anyway.

Then I tried to fix it an ugly way and succeeded, but its very ugly:
In this file: kirby/panel/dist/js/vendor.min.js
find the string: January_February_March_April_May_June_July_August_September_October_November_December, and change it to your locale.

Then delete this file:
media/panel/<number>/js/vendor.min.js
and also clean the browser cache.

This is not an advised way to solve it, and with an update of Kirby this will be overwritten.