Skip to content

Commit

Permalink
fix: rrule monthly recurrence text italian translation (#739)
Browse files Browse the repository at this point in the history
* fix: managed translations when recurrence is monthly, byday and on sunday

* chore: added release.md info
  • Loading branch information
sabrina-bongiovanni authored Aug 9, 2024
1 parent cd4b672 commit 9c4e75a
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 9 deletions.
14 changes: 14 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3030,7 +3030,7 @@ msgid "rrule_on"
msgstr ""

#: overrideTranslations
# defaultMessage: di
# defaultMessage: il
msgid "rrule_on the"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3015,7 +3015,7 @@ msgid "rrule_on"
msgstr "on"

#: overrideTranslations
# defaultMessage: di
# defaultMessage: il
msgid "rrule_on the"
msgstr "on the"

Expand Down
2 changes: 1 addition & 1 deletion locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3024,7 +3024,7 @@ msgid "rrule_on"
msgstr ""

#: overrideTranslations
# defaultMessage: di
# defaultMessage: il
msgid "rrule_on the"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,7 @@ msgid "rrule_on"
msgstr ""

#: overrideTranslations
# defaultMessage: di
# defaultMessage: il
msgid "rrule_on the"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3015,9 +3015,9 @@ msgid "rrule_on"
msgstr "di"

#: overrideTranslations
# defaultMessage: di
# defaultMessage: il
msgid "rrule_on the"
msgstr "di"
msgstr "il"

#: overrideTranslations
# defaultMessage: _
Expand Down
4 changes: 2 additions & 2 deletions locales/volto.pot
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -3017,7 +3017,7 @@ msgid "rrule_on"
msgstr ""

#: overrideTranslations
# defaultMessage: di
# defaultMessage: il
msgid "rrule_on the"
msgstr ""

Expand Down
15 changes: 15 additions & 0 deletions src/components/ItaliaTheme/View/Commons/Dates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/overrideTranslations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defineMessages({
},
rrule_on_the: {
id: 'rrule_on the',
defaultMessage: 'di',
defaultMessage: 'il',
},
weekdays: {
id: 'rrule_weekdays',
Expand Down

0 comments on commit 9c4e75a

Please sign in to comment.