Skip to content

Commit

Permalink
fix: translated aria-label of menu hamburger icon (#592)
Browse files Browse the repository at this point in the history
* fix: translated aria-label of menu hamburger icon

* fix: used collapseOpen variable to change aria-label message

* chore: removed console.log

* fix: added translations for toggleMenu

* fix: added EN translations

* chore: changed release.md
  • Loading branch information
sabrina-bongiovanni authored Apr 3, 2024
1 parent d8a5343 commit 7d74181
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- Sistemato al cambio pagina il reset dei risultati di ricerca nei blocchi di ricerca Bandi, Eventi e UO
- Sistemato layout del menu laterale sinistro nella vista del Bando
- Sistemato il flag Mostra tipologia bandi nel blocco elenco con variazione Bandi in Evidenza
- Tradotto il messaggio per Screen Reader del bottone per aprire e chiudere il menu in mobile.

## Versione 7.25.3 (07/03/2024)

Expand Down
15 changes: 15 additions & 0 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3607,6 +3607,21 @@ msgstr ""
msgid "to"
msgstr ""

#: overrideTranslations
# defaultMessage: {action} il menu
msgid "toggle-menu"
msgstr ""

#: overrideTranslations
# defaultMessage: Chiudi
msgid "toggleMenu_close"
msgstr ""

#: overrideTranslations
# defaultMessage: Apri
msgid "toggleMenu_open"
msgstr ""

#: components/ItaliaTheme/Header/HeaderSearch/SearchModal
#: components/ItaliaTheme/Search/Search
#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti
Expand Down
15 changes: 15 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3592,6 +3592,21 @@ msgstr "title"
msgid "to"
msgstr "to"

#: overrideTranslations
# defaultMessage: {action} il menu
msgid "toggle-menu"
msgstr "{action} the menu"

#: overrideTranslations
# defaultMessage: Chiudi
msgid "toggleMenu_close"
msgstr "Close"

#: overrideTranslations
# defaultMessage: Apri
msgid "toggleMenu_open"
msgstr "Open"

#: components/ItaliaTheme/Header/HeaderSearch/SearchModal
#: components/ItaliaTheme/Search/Search
#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti
Expand Down
15 changes: 15 additions & 0 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3601,6 +3601,21 @@ msgstr "título"
msgid "to"
msgstr "a"

#: overrideTranslations
# defaultMessage: {action} il menu
msgid "toggle-menu"
msgstr ""

#: overrideTranslations
# defaultMessage: Chiudi
msgid "toggleMenu_close"
msgstr ""

#: overrideTranslations
# defaultMessage: Apri
msgid "toggleMenu_open"
msgstr ""

#: components/ItaliaTheme/Header/HeaderSearch/SearchModal
#: components/ItaliaTheme/Search/Search
#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti
Expand Down
15 changes: 15 additions & 0 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3609,6 +3609,21 @@ msgstr "titre"
msgid "to"
msgstr "au"

#: overrideTranslations
# defaultMessage: {action} il menu
msgid "toggle-menu"
msgstr ""

#: overrideTranslations
# defaultMessage: Chiudi
msgid "toggleMenu_close"
msgstr ""

#: overrideTranslations
# defaultMessage: Apri
msgid "toggleMenu_open"
msgstr ""

#: components/ItaliaTheme/Header/HeaderSearch/SearchModal
#: components/ItaliaTheme/Search/Search
#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti
Expand Down
15 changes: 15 additions & 0 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -3592,6 +3592,21 @@ msgstr "titolo"
msgid "to"
msgstr "al"

#: overrideTranslations
# defaultMessage: {action} il menu
msgid "toggle-menu"
msgstr ""

#: overrideTranslations
# defaultMessage: Chiudi
msgid "toggleMenu_close"
msgstr ""

#: overrideTranslations
# defaultMessage: Apri
msgid "toggleMenu_open"
msgstr ""

#: components/ItaliaTheme/Header/HeaderSearch/SearchModal
#: components/ItaliaTheme/Search/Search
#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti
Expand Down
17 changes: 16 additions & 1 deletion 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-03-15T14:43:53.376Z\n"
"POT-Creation-Date: 2024-03-27T13:29:18.025Z\n"
"Last-Translator: Plone i18n <[email protected]>\n"
"Language-Team: Plone i18n <[email protected]>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -3594,6 +3594,21 @@ msgstr ""
msgid "to"
msgstr ""

#: overrideTranslations
# defaultMessage: {action} il menu
msgid "toggle-menu"
msgstr ""

#: overrideTranslations
# defaultMessage: Chiudi
msgid "toggleMenu_close"
msgstr ""

#: overrideTranslations
# defaultMessage: Apri
msgid "toggleMenu_open"
msgstr ""

#: components/ItaliaTheme/Header/HeaderSearch/SearchModal
#: components/ItaliaTheme/Search/Search
#: components/ItaliaTheme/View/Commons/PageHeader/PageHeaderTassonomiaArgomenti
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ const Navigation = ({ pathname }) => {
<HeaderToggler
aria-controls="it-navigation-collapse"
aria-expanded={collapseOpen}
aria-label="Toggle navigation"
aria-label={intl.formatMessage(messages.toggleMenu, {
action: collapseOpen
? intl.formatMessage(messages.toggleMenu_close)
: intl.formatMessage(messages.toggleMenu_open),
})}
onClick={() => {
setCollapseOpen(!collapseOpen);
setFocusTrapActive(!focusTrapActive);
Expand Down Expand Up @@ -175,6 +179,18 @@ const messages = defineMessages({
id: 'close-menu',
defaultMessage: 'Chiudi menu',
},
toggleMenu: {
id: 'toggle-menu',
defaultMessage: '{action} il menu',
},
toggleMenu_open: {
id: 'toggleMenu_open',
defaultMessage: 'Apri',
},
toggleMenu_close: {
id: 'toggleMenu_close',
defaultMessage: 'Chiudi',
},
});

Navigation.propTypes = {
Expand Down
12 changes: 12 additions & 0 deletions src/overrideTranslations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,16 @@ const messages = defineMessages({
id: 'rrule_on the',
defaultMessage: 'il',
},
toggleMenu: {
id: 'toggle-menu',
defaultMessage: '{action} il menu',
},
toggleMenu_open: {
id: 'toggleMenu_open',
defaultMessage: 'Apri',
},
toggleMenu_close: {
id: 'toggleMenu_close',
defaultMessage: 'Chiudi',
},
});

0 comments on commit 7d74181

Please sign in to comment.