I can't edit dates in volto in UK date format
Describe the bug In the CMSUI/sidebar dates are shown in US date format even if the user or site language is set to English UK.
This seems to be caused by two things. The translation of the CMSUI is tied to the language of the content not the user which is wrong (https://github.com/plone/volto/issues/1408) and also it seems like language variants like English UK are being ignored in Volto.
To Reproduce
- go to language control panel
- set language to English United Kingom
- go to content and edit
- notice the date is in US Format (wrong way round from any sensible perspective with the month first)
Note that setting the content language to English UK also doesn't fix the problem.
Expected behavior
- Dates such as publication date in theh page settings should have the day first.
- Dates in the contents view, history view etc should also be in UK format.
- you should be able to pick a language variant for the user preference
Screenshots
Software (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Volto Version 16
- Plone Version 6
- Plone REST API Version [e.g. 7.0.1]
Additional context Add any other context about the problem here.
Volto has a single English locale:
https://github.com/plone/volto/tree/main/packages/volto/locales/en/LC_MESSAGES
Classic UI has 3 English locales:
https://github.com/collective/plone.app.locales/tree/master/plone/app/locales/locales
Could that be the underlying issue, that Volto is missing pieces that Classic UI has?
At the Axolote Sprint, @gil-cano showed me that the browser's native type="date" input widget always uses the browser's locale and there's no way for a website to override this. (see also https://github.com/plone/mockup/issues/1328) Does that explain this?
@davisagli don't think volo is using the native date control. It is ignoring the browser locale and using the locale of the content. So first thing is to free it from the locale of the content for sidebar input and for contents view. On top the locale translations for non American English are missing from volto.
Okay, sorry, my comment here was noise then.
Any further movement on this one? I've been trying to figure out why all the dates on our sites are showing US date format even when content is set to different languages, but no luck. I see some comments about the Event content type, but this is not specific to one content type, as even News items and listings/search blocks are showing the date format as US.
Volto in fact doesn't even change the language metadata tag when you change language. Or support RTL. I don't know why
We did a hack to fix to hard code the language used by date controls but that's not really a solution.