From 4e741b996f96b393d442ad7272e46c2abb81589d Mon Sep 17 00:00:00 2001 From: Alexander Neumann <140883099+Molochem@users.noreply.github.com> Date: Thu, 1 Feb 2024 04:06:07 +0100 Subject: [PATCH] fixed a11y Logo Issue and added Translations (#5722) --- packages/volto/locales/ca/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/de/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/en/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/es/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/eu/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/fi/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/fr/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/it/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/ja/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/nl/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/pt/LC_MESSAGES/volto.po | 5 +++++ .../volto/locales/pt_BR/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/ro/LC_MESSAGES/volto.po | 5 +++++ packages/volto/locales/volto.pot | 7 ++++++- .../volto/locales/zh_CN/LC_MESSAGES/volto.po | 5 +++++ packages/volto/news/5722.bugfix | 1 + .../volto/src/components/theme/Logo/Logo.jsx | 13 +++++++++++-- .../Logo.Multilingual.test.jsx.snap | 16 ++++++++-------- .../theme/Logo/__snapshots__/Logo.test.jsx.snap | 16 ++++++++-------- 19 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 packages/volto/news/5722.bugfix diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index 1a5b7bd8f4..1e382da29e 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -462,6 +462,11 @@ msgstr "" msgid "Back" msgstr "Enrere" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Torna a la pàgina d'inici" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/de/LC_MESSAGES/volto.po b/packages/volto/locales/de/LC_MESSAGES/volto.po index ccc5769191..6f026e5dcc 100644 --- a/packages/volto/locales/de/LC_MESSAGES/volto.po +++ b/packages/volto/locales/de/LC_MESSAGES/volto.po @@ -461,6 +461,11 @@ msgstr "Verfügbare Inhaltsregeln:" msgid "Back" msgstr "Zurück" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Zurück zur Startseite" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index f35e3d58e7..3a454995a4 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -456,6 +456,11 @@ msgstr "" msgid "Back" msgstr "" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index 4deb950d4b..ab4dc26828 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -463,6 +463,11 @@ msgstr "Reglas de contenido disponibles:" msgid "Back" msgstr "Volver" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Volver a la página de inicio" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index 1bcdba5fbc..cb747eec8f 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -463,6 +463,11 @@ msgstr "Erabilgarri dauden eduki-erregelak:" msgid "Back" msgstr "Atzera" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Itzuli hasierako orrialdera" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index a6b9b1b5dc..71f9850562 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -461,6 +461,11 @@ msgstr "Saatavilla olevat sisältösäännöt:" msgid "Back" msgstr "Takaisin" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Takaisin kotisivulle" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index 0d2dfbacf3..a68cfca0ff 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -463,6 +463,11 @@ msgstr "Règles de contenu disponibles :" msgid "Back" msgstr "Retour" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Retour à la page d'accueil" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index 642998f7e6..aca9c5fdf4 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -456,6 +456,11 @@ msgstr "Regole di contenuto disponibili:" msgid "Back" msgstr "Indietro" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Torna alla home page" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/ja/LC_MESSAGES/volto.po b/packages/volto/locales/ja/LC_MESSAGES/volto.po index f8f90cac18..83941d6efd 100644 --- a/packages/volto/locales/ja/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ja/LC_MESSAGES/volto.po @@ -461,6 +461,11 @@ msgstr "" msgid "Back" msgstr "戻る" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "ホームページに戻ります" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/nl/LC_MESSAGES/volto.po b/packages/volto/locales/nl/LC_MESSAGES/volto.po index 556e993d81..6078bbf240 100644 --- a/packages/volto/locales/nl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nl/LC_MESSAGES/volto.po @@ -460,6 +460,11 @@ msgstr "" msgid "Back" msgstr "" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Terug naar de startpagina" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/pt/LC_MESSAGES/volto.po b/packages/volto/locales/pt/LC_MESSAGES/volto.po index 945cabdf2a..42ee8d0ce9 100644 --- a/packages/volto/locales/pt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt/LC_MESSAGES/volto.po @@ -461,6 +461,11 @@ msgstr "" msgid "Back" msgstr "Voltar" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Voltar à página inicial" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po index 6eef754e4e..15bdcb379a 100644 --- a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po @@ -462,6 +462,11 @@ msgstr "Regras de conteúdo disponíveis:" msgid "Back" msgstr "Voltar" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Voltar à página inicial" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index e7fd51bda8..c852093067 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -456,6 +456,11 @@ msgstr "" msgid "Back" msgstr "Înapoi" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "Înapoi la pagina de start" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/volto.pot b/packages/volto/locales/volto.pot index 05f3d4e0e8..afa09232c0 100644 --- a/packages/volto/locales/volto.pot +++ b/packages/volto/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2024-01-12T09:21:12.378Z\n" +"POT-Creation-Date: 2024-01-31T14:54:12.513Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -458,6 +458,11 @@ msgstr "" msgid "Back" msgstr "" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index bdd478a311..c6344f107b 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -462,6 +462,11 @@ msgstr "可用的内容规则" msgid "Back" msgstr "返回" +#. Default: "Back to homepage" +#: components/theme/Logo/Logo +msgid "Back to homepage" +msgstr "返回首页" + #. Default: "Base" #: components/manage/Diff/Diff msgid "Base" diff --git a/packages/volto/news/5722.bugfix b/packages/volto/news/5722.bugfix new file mode 100644 index 0000000000..24dafe95c6 --- /dev/null +++ b/packages/volto/news/5722.bugfix @@ -0,0 +1 @@ +Fixed the Alt-Title of the Logo to say "Back to Homepage" in various Languages for a11y and Screenreader conformity @Molochem \ No newline at end of file diff --git a/packages/volto/src/components/theme/Logo/Logo.jsx b/packages/volto/src/components/theme/Logo/Logo.jsx index 60345010d5..8d4abc7ba7 100644 --- a/packages/volto/src/components/theme/Logo/Logo.jsx +++ b/packages/volto/src/components/theme/Logo/Logo.jsx @@ -2,6 +2,7 @@ * Logo component. * @module components/theme/Logo/Logo */ +import { defineMessages, useIntl } from 'react-intl'; import { useEffect } from 'react'; import { Image } from 'semantic-ui-react'; import { ConditionalLink } from '@plone/volto/components'; @@ -26,6 +27,14 @@ const Logo = () => { const site = useSelector((state) => state.site.data); const navroot = useSelector((state) => state.navroot.data); const dispatch = useDispatch(); + const intl = useIntl(); + + const messages = defineMessages({ + homepage: { + id: 'Back to homepage', + defaultMessage: 'Back to homepage', + }, + }); useEffect(() => { if (pathname && !hasApiExpander('navroot', getBaseUrl(pathname))) { @@ -50,8 +59,8 @@ const Logo = () => { ? flattenToAppURL(site['plone.site_logo']) : LogoImage } - alt={navroot?.navroot?.title} - title={navroot?.navroot?.title} + alt={intl.formatMessage(messages.homepage)} + title={intl.formatMessage(messages.homepage)} /> ); diff --git a/packages/volto/src/components/theme/Logo/__snapshots__/Logo.Multilingual.test.jsx.snap b/packages/volto/src/components/theme/Logo/__snapshots__/Logo.Multilingual.test.jsx.snap index c64b578b20..bb96926dbc 100644 --- a/packages/volto/src/components/theme/Logo/__snapshots__/Logo.Multilingual.test.jsx.snap +++ b/packages/volto/src/components/theme/Logo/__snapshots__/Logo.Multilingual.test.jsx.snap @@ -2,10 +2,10 @@ exports[`Multilingual Logo renders a logo component in a multilingual site language root 1`] = ` English `; @@ -18,20 +18,20 @@ exports[`Multilingual Logo renders a logo component in a multilingual site root title="Plone Site" > Plone Site `; exports[`Multilingual Logo renders a logo component with a custom logo in a non-root url 1`] = ` English `; @@ -44,10 +44,10 @@ exports[`Multilingual Logo renders a logo component with a custom logo in a non- title="English" > English `; diff --git a/packages/volto/src/components/theme/Logo/__snapshots__/Logo.test.jsx.snap b/packages/volto/src/components/theme/Logo/__snapshots__/Logo.test.jsx.snap index dfe8409855..702ed67bce 100644 --- a/packages/volto/src/components/theme/Logo/__snapshots__/Logo.test.jsx.snap +++ b/packages/volto/src/components/theme/Logo/__snapshots__/Logo.test.jsx.snap @@ -2,10 +2,10 @@ exports[`Logo renders a logo component with a custom logo 1`] = ` Plone Site `; @@ -18,20 +18,20 @@ exports[`Logo renders a logo component with a custom logo in a non-root url 1`] title="Plone Site" > Plone Site `; exports[`Logo renders a logo component with default config 1`] = ` Plone Site `; @@ -44,10 +44,10 @@ exports[`Logo renders a logo component with default config in a non-root url 1`] title="Plone Site" > Plone Site `;