Skip to content

Commit

Permalink
Merge pull request #19 from collective/accessibility
Browse files Browse the repository at this point in the history
added accessibility labels and translations
  • Loading branch information
nzambello authored Mar 31, 2021
2 parents 46d56ee + afbd575 commit afa1416
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 17 deletions.
14 changes: 13 additions & 1 deletion locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr "Close menu"

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr "Main navigation"

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr "Open menu"

#: components/DropdownMenu
msgid "Unknown Block"
msgstr "Unknown Block {block}"

Expand Down
14 changes: 13 additions & 1 deletion locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr "Chiudi il menu"

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr "Navigazione principale"

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr "Apri il menu"

#: components/DropdownMenu
msgid "Unknown Block"
msgstr "Blocco {block} sconosciuto"

Expand Down
14 changes: 13 additions & 1 deletion locales/ja/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/pt_BR/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
14 changes: 13 additions & 1 deletion locales/ro/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
msgid "Unknown Block"
msgstr ""

Expand Down
19 changes: 17 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: 2021-03-30T07:18:46.247Z\n"
"POT-Creation-Date: 2021-03-31T10:30:09.132Z\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
Expand All @@ -13,7 +13,22 @@ msgid ""
"Preferred-Encodings: utf-8\n"
"Domain: volto\n"

#: components/DropdownMenu
#: customizations/components/theme/Navigation/Navigation
# defaultMessage: Close menu
msgid "Close menu"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
# defaultMessage: Main navigation
msgid "Main navigation"
msgstr ""

#: customizations/components/theme/Navigation/Navigation
# defaultMessage: Open menu
msgid "Open menu"
msgstr ""

#: components/DropdownMenu
# defaultMessage: Unknown Block {block}
msgid "Unknown Block"
msgstr ""
Expand Down
10 changes: 9 additions & 1 deletion src/customizations/components/theme/Navigation/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const messages = defineMessages({
id: 'Open menu',
defaultMessage: 'Open menu',
},
dropdownmenu_aria: {
id: 'Main navigation',
defaultMessage: 'Main navigation',
},
});

const Navigation = ({ pathname, type }) => {
Expand Down Expand Up @@ -105,7 +109,11 @@ const Navigation = ({ pathname, type }) => {
const menu = getItemsByPath(dropdownMenuNavItems, pathname);

return (
<nav className="navigation navigation-dropdownmenu">
<nav
className="navigation navigation-dropdownmenu"
role="navigation"
aria-label={intl.formatMessage(messages.dropdownmenu_aria)}
>
<OutsideClickHandler
onOutsideClick={() => {
setOpenDropodownIndex(-1);
Expand Down
9 changes: 6 additions & 3 deletions src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ function getMessages() {
// We ignore the existing customized shadowed components ones, since most
// probably we won't be overriding them
// If so, we should do it in the config object or somewhere else
glob('build/messages/src/**/*.json', {
ignore: 'build/messages/src/customizations/**',
}),
glob(
'build/messages/src/**/*.json',
// , {
// ignore: 'build/messages/src/customizations/**',
// }
),
(filename) =>
map(JSON.parse(fs.readFileSync(filename, 'utf8')), (message) => ({
...message,
Expand Down

0 comments on commit afa1416

Please sign in to comment.