From 9c4e75a30657d5b3e035cfe3a6443fd31eacbf02 Mon Sep 17 00:00:00 2001 From: sabrina-bongiovanni <116291154+sabrina-bongiovanni@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:45:55 +0200 Subject: [PATCH] fix: rrule monthly recurrence text italian translation (#739) * fix: managed translations when recurrence is monthly, byday and on sunday * chore: added release.md info --- RELEASE.md | 14 ++++++++++++++ locales/de/LC_MESSAGES/volto.po | 2 +- locales/en/LC_MESSAGES/volto.po | 2 +- locales/es/LC_MESSAGES/volto.po | 2 +- locales/fr/LC_MESSAGES/volto.po | 2 +- locales/it/LC_MESSAGES/volto.po | 4 ++-- locales/volto.pot | 4 ++-- src/components/ItaliaTheme/View/Commons/Dates.jsx | 15 +++++++++++++++ src/overrideTranslations.jsx | 2 +- 9 files changed, 38 insertions(+), 9 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 65c98517d..4091cb0a4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,6 +41,20 @@ - ... --> +## Versione X.X.X (dd/mm/yyyy) + +### Migliorie + +- ... + +### Novità + +- ... + +### Fix + +- Il testo che descrive la ricorrenza mensile è stato corretto per coprire tutti i casi. + ## Versione 11.18.2 (25/07/2024) ### Fix diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 4dd640ef0..067563b66 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -3030,7 +3030,7 @@ msgid "rrule_on" msgstr "" #: overrideTranslations -# defaultMessage: di +# defaultMessage: il msgid "rrule_on the" msgstr "" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index 37646c569..18c414f25 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -3015,7 +3015,7 @@ msgid "rrule_on" msgstr "on" #: overrideTranslations -# defaultMessage: di +# defaultMessage: il msgid "rrule_on the" msgstr "on the" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index dfb16fe38..81beef893 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -3024,7 +3024,7 @@ msgid "rrule_on" msgstr "" #: overrideTranslations -# defaultMessage: di +# defaultMessage: il msgid "rrule_on the" msgstr "" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index f4844923d..35009dd1f 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -3032,7 +3032,7 @@ msgid "rrule_on" msgstr "" #: overrideTranslations -# defaultMessage: di +# defaultMessage: il msgid "rrule_on the" msgstr "" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index d98bd98b2..e910c440c 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -3015,9 +3015,9 @@ msgid "rrule_on" msgstr "di" #: overrideTranslations -# defaultMessage: di +# defaultMessage: il msgid "rrule_on the" -msgstr "di" +msgstr "il" #: overrideTranslations # defaultMessage: _ diff --git a/locales/volto.pot b/locales/volto.pot index 713ffa9bd..3a29b974d 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-07-15T11:07:19.251Z\n" +"POT-Creation-Date: 2024-08-06T16:50:24.401Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -3017,7 +3017,7 @@ msgid "rrule_on" msgstr "" #: overrideTranslations -# defaultMessage: di +# defaultMessage: il msgid "rrule_on the" msgstr "" diff --git a/src/components/ItaliaTheme/View/Commons/Dates.jsx b/src/components/ItaliaTheme/View/Commons/Dates.jsx index fc2d86b02..8f92d5aa2 100644 --- a/src/components/ItaliaTheme/View/Commons/Dates.jsx +++ b/src/components/ItaliaTheme/View/Commons/Dates.jsx @@ -50,13 +50,28 @@ const Dates = ({ content, show_image, moment: momentlib, rrule }) => { let recurrenceText = null; if (content.recurrence) { + const isRecurrenceByDay = content.recurrence.includes('BYDAY=+'); + const isWeekdaySunday = content.recurrence + .split('BYDAY')[1] + ?.includes('SU'); const RRULE_LANGUAGE = rrulei18n(intl, moment); rruleSet = rrulestr(content.recurrence, { compatible: true, //If set to True, the parser will operate in RFC-compatible mode. Right now it means that unfold will be turned on, and if a DTSTART is found, it will be considered the first recurrence instance, as documented in the RFC. forceset: true, }); + recurrenceText = rruleSet.rrules()[0]?.toText( (t) => { + if (moment.locale(intl.locale) === 'it' && isRecurrenceByDay) { + RRULE_LANGUAGE.strings.th = '°'; + RRULE_LANGUAGE.strings.nd = '°'; + RRULE_LANGUAGE.strings.rd = '°'; + RRULE_LANGUAGE.strings.st = '°'; + + if (isWeekdaySunday) { + RRULE_LANGUAGE.strings['on the'] = 'la'; + } + } return RRULE_LANGUAGE.strings[t]; }, RRULE_LANGUAGE, diff --git a/src/overrideTranslations.jsx b/src/overrideTranslations.jsx index c5a1e35f1..d1524b4b0 100644 --- a/src/overrideTranslations.jsx +++ b/src/overrideTranslations.jsx @@ -27,7 +27,7 @@ defineMessages({ }, rrule_on_the: { id: 'rrule_on the', - defaultMessage: 'di', + defaultMessage: 'il', }, weekdays: { id: 'rrule_weekdays',