Localisation of date picker
Localisation of date picker
fabioberetta
Posts: 74Questions: 23Answers: 4
Good afternoon,
I am adding language option to a page and need to have the datepicker localised.
I have found this: https://editor.datatables.net/examples/dates/i18n.html
Adding i18n data to each table is a bit annoying and I would like to have something I can configure at least per page.
I have tryied to configure each field like this:
{
label: "Date de naiss.",
name: "child.birth_date",
type: 'datetime',
format: 'YYYY-MM-DD',
opts: {
momentLocale: 'fr'
}
}
But I did not mange to make it work. How could I do it?
Thanks,
Fabio
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi Fabio,
You can set the defaults for the date time picker's language strings using the object:
e.g. you could do:
Allan
Hi Allan,
thanks for the tip.
I used this solution. I have added a javascript array with all i18n strings and assigned as default at the beginning of each page.
On the other hand I did not find any i18n data for the upload field (to convert buttons, drop area text...). I had to assign them in each individual editor. Any better solution?
Thanks,
Fabio
Hi Fabio,
At the moment, no - the upload strings are assigned on a per instance basis and do not have a way to be assigned defaults. I need to look at adding that.
Regards,
Allan