Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't edit dates in volto in UK date format #6047

Open
djay opened this issue May 24, 2024 · 4 comments
Open

I can't edit dates in volto in UK date format #6047

djay opened this issue May 24, 2024 · 4 comments

Comments

@djay
Copy link
Member

djay commented May 24, 2024

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 (#1408) and also it seems like language variants like English UK are being ignored in Volto.

To Reproduce

  1. go to language control panel
  2. set language to English United Kingom
  3. go to content and edit
  4. 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

Screen Shot 2024-05-24 at 9 41 53 am image image

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.

@stevepiercy
Copy link
Collaborator

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?

@davisagli
Copy link
Member

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 plone/mockup#1328) Does that explain this?

@djay
Copy link
Member Author

djay commented Jun 3, 2024

@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.

@davisagli
Copy link
Member

Okay, sorry, my comment here was noise then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants