volto
volto copied to clipboard
Properly internationalize the When component in EventDatesInfo.jsx
Describe the bug
The When component is not internationalized and has hard-coded from
and to
strings to signal event from
and to
dates:
https://github.com/plone/volto/blob/master/src/components/theme/View/EventDatesInfo.jsx#L90-L92
Additional context Add any other context about the problem here.
This is not as easy as adding formatMessage
calls in the from
and to
strings, we have to be aware that some languages do not work like that. For instance in basque the from
and to
strings are used like suffixes to the hour or date strings instead of prepositions (something like ${start_date}tik ${end_date}ra
, so this needs to be implemented using variables like from ${start_date} to ${end_date}
or whatever.
For complete reference in classic Plone we are using i18n:translate
and i18n:name
tags to handle those translations: https://github.com/plone/plone.app.event/blob/master/plone/app/event/browser/formatted_date.pt#L13