diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index 1a5b7bd8f4..124ebbcd01 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -1672,6 +1672,7 @@ msgstr "Historial de {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Inici" @@ -2059,6 +2060,11 @@ msgstr "Error a l'iniciar sessió" msgid "Login Name" msgstr "Nom d'usuari" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/de/LC_MESSAGES/volto.po b/packages/volto/locales/de/LC_MESSAGES/volto.po index ccc5769191..6011f4fed2 100644 --- a/packages/volto/locales/de/LC_MESSAGES/volto.po +++ b/packages/volto/locales/de/LC_MESSAGES/volto.po @@ -1671,6 +1671,7 @@ msgstr "Historie von {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Startseite" @@ -2058,6 +2059,11 @@ msgstr "Login fehlgeschlagen" msgid "Login Name" msgstr "Benutzername" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "Logo von" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index f35e3d58e7..19b258fecb 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -1666,6 +1666,7 @@ msgstr "" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "" @@ -2053,6 +2054,11 @@ msgstr "" msgid "Login Name" msgstr "" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index 4deb950d4b..f9f065a686 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -1673,6 +1673,7 @@ msgstr "Historial de {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Inicio" @@ -2060,6 +2061,11 @@ msgstr "Inicio de Sesión fallo" msgid "Login Name" msgstr "Nombre de usuario" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index 1bcdba5fbc..7064a7b56c 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -1673,6 +1673,7 @@ msgstr "{title} elementuaren historia" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Hasiera" @@ -2060,6 +2061,11 @@ msgstr "Sartzeak huts egin du" msgid "Login Name" msgstr "Erabiltzaile-izena" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index a6b9b1b5dc..03b2780a8c 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -1671,6 +1671,7 @@ msgstr "{title} – muutoshistoria" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Etusivu" @@ -2058,6 +2059,11 @@ msgstr "Kirjautuminen epäonnistui" msgid "Login Name" msgstr "Tunnus" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index 0d2dfbacf3..79c1ee9372 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -1673,6 +1673,7 @@ msgstr "Historique de {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Accueil" @@ -2060,6 +2061,11 @@ msgstr "Echec de la connexion" msgid "Login Name" msgstr "Identifiant" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index 642998f7e6..ee27a0e94c 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -1666,6 +1666,7 @@ msgstr "Cronologia di {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Home" @@ -2053,6 +2054,11 @@ msgstr "Accesso fallito" msgid "Login Name" msgstr "Nome utente" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/ja/LC_MESSAGES/volto.po b/packages/volto/locales/ja/LC_MESSAGES/volto.po index f8f90cac18..23c0849a3c 100644 --- a/packages/volto/locales/ja/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ja/LC_MESSAGES/volto.po @@ -1671,6 +1671,7 @@ msgstr "{title} の履歴" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "ホーム" @@ -2058,6 +2059,11 @@ msgstr "ログインに失敗しました" msgid "Login Name" msgstr "ログイン名" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/nl/LC_MESSAGES/volto.po b/packages/volto/locales/nl/LC_MESSAGES/volto.po index 556e993d81..fe21ea8d91 100644 --- a/packages/volto/locales/nl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nl/LC_MESSAGES/volto.po @@ -1670,6 +1670,7 @@ msgstr "Geschiedenis van {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Home" @@ -2057,6 +2058,11 @@ msgstr "" msgid "Login Name" msgstr "Gebruikersnaam" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/pt/LC_MESSAGES/volto.po b/packages/volto/locales/pt/LC_MESSAGES/volto.po index 945cabdf2a..c341c5f237 100644 --- a/packages/volto/locales/pt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt/LC_MESSAGES/volto.po @@ -1671,6 +1671,7 @@ msgstr "Histórico de {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Início" @@ -2058,6 +2059,11 @@ msgstr "Falhou o início de sessão" msgid "Login Name" msgstr "Nome de utilizador" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po index 6eef754e4e..663e5e5ab4 100644 --- a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po @@ -1672,6 +1672,7 @@ msgstr "Histórico de {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Início" @@ -2059,6 +2060,11 @@ msgstr "Falha na autenticação" msgid "Login Name" msgstr "Nome de usuário" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index e7fd51bda8..2c75e1aa99 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -1666,6 +1666,7 @@ msgstr "Istoricul {title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "Acasă" @@ -2053,6 +2054,11 @@ msgstr "Autentificare eșuată" msgid "Login Name" msgstr "Nume de autentificare" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/volto.pot b/packages/volto/locales/volto.pot index 05f3d4e0e8..414d63d872 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-02-26T09:23:35.781Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -1668,6 +1668,7 @@ msgstr "" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "" @@ -2055,6 +2056,11 @@ msgstr "" msgid "Login Name" msgstr "" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index bdd478a311..105ead2efc 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -1672,6 +1672,7 @@ msgstr "历史{title}" #: components/manage/Contents/ContentsBreadcrumbs #: components/manage/Contents/ContentsBreadcrumbsHomeItem #: components/theme/Breadcrumbs/Breadcrumbs +#: components/theme/Logo/Logo msgid "Home" msgstr "首页" @@ -2059,6 +2060,11 @@ msgstr "登陆失败" msgid "Login Name" msgstr "登录名" +#. Default: "Logo of" +#: components/theme/Logo/Logo +msgid "Logo of" +msgstr "" + #. Default: "Logout" #: components/manage/Toolbar/PersonalTools msgid "Logout" diff --git a/packages/volto/news/5776.breaking b/packages/volto/news/5776.breaking new file mode 100644 index 0000000000..0c25069810 --- /dev/null +++ b/packages/volto/news/5776.breaking @@ -0,0 +1 @@ +Improved accessibility of logo component. @Molochem \ No newline at end of file diff --git a/packages/volto/src/components/theme/Logo/Logo.Multilingual.test.jsx b/packages/volto/src/components/theme/Logo/Logo.Multilingual.test.jsx index 2091e9b0f1..0e2925a248 100644 --- a/packages/volto/src/components/theme/Logo/Logo.Multilingual.test.jsx +++ b/packages/volto/src/components/theme/Logo/Logo.Multilingual.test.jsx @@ -30,7 +30,7 @@ describe('Multilingual Logo', () => { }, }, site: { - data: {}, + data: { 'plone.site_title': 'Plone Site' }, }, }); const component = renderer.create( @@ -95,6 +95,7 @@ describe('Multilingual Logo', () => { data: { 'plone.site_logo': 'http://localhost:3000/@@site-logo/logo.cab945d8.svg', + 'plone.site_title': 'Plone Site', }, }, }); @@ -128,6 +129,7 @@ describe('Multilingual Logo', () => { data: { 'plone.site_logo': 'http://localhost:3000/@@site-logo/logo.cab945d8.svg', + 'plone.site_title': 'Plone Site', }, }, }); diff --git a/packages/volto/src/components/theme/Logo/Logo.jsx b/packages/volto/src/components/theme/Logo/Logo.jsx index 60345010d5..b793c7168c 100644 --- a/packages/volto/src/components/theme/Logo/Logo.jsx +++ b/packages/volto/src/components/theme/Logo/Logo.jsx @@ -2,9 +2,9 @@ * 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'; import LogoImage from '@plone/volto/components/theme/Logo/Logo.svg'; import { useSelector, useDispatch } from 'react-redux'; import { useLocation } from 'react-router-dom'; @@ -26,6 +26,18 @@ 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({ + home: { + id: 'Home', + defaultMessage: 'Home', + }, + logoOf: { + id: 'Logo of', + defaultMessage: 'Logo of', + }, + }); useEffect(() => { if (pathname && !hasApiExpander('navroot', getBaseUrl(pathname))) { @@ -34,26 +46,20 @@ const Logo = () => { }, [dispatch, pathname]); const navRootPath = flattenToAppURL(navroot?.navroot?.['@id']) || '/'; - const currentURLIsNavRoot = pathname !== navRootPath; return ( - + {navroot?.navroot?.title} - + ); }; diff --git a/packages/volto/src/components/theme/Logo/Logo.test.jsx b/packages/volto/src/components/theme/Logo/Logo.test.jsx index 73ccdca936..63935558a7 100644 --- a/packages/volto/src/components/theme/Logo/Logo.test.jsx +++ b/packages/volto/src/components/theme/Logo/Logo.test.jsx @@ -31,7 +31,7 @@ describe('Logo', () => { }, }, site: { - data: {}, + data: { 'plone.site_title': 'Plone Site' }, }, }); const component = renderer.create( @@ -63,6 +63,7 @@ describe('Logo', () => { data: { 'plone.site_logo': 'http://localhost:3000/@@site-logo/logo.cab945d8.svg', + 'plone.site_title': 'Plone Site', }, }, }); @@ -101,6 +102,7 @@ describe('Logo', () => { data: { 'plone.site_logo': 'http://localhost:3000/@@site-logo/logo.cab945d8.svg', + 'plone.site_title': 'Plone Site', }, }, }); @@ -134,6 +136,7 @@ describe('Logo', () => { data: { 'plone.site_logo': 'http://localhost:3000/@@site-logo/logo.cab945d8.svg', + 'plone.site_title': 'Plone Site', }, }, }); 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..fe9b651b55 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 @@ -1,53 +1,53 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Multilingual Logo renders a logo component in a multilingual site language root 1`] = ` -English + + Logo of Plone Site + `; exports[`Multilingual Logo renders a logo component in a multilingual site root 1`] = ` Plone Site `; exports[`Multilingual Logo renders a logo component with a custom logo in a non-root url 1`] = ` -English + + Logo of Plone Site + `; exports[`Multilingual Logo renders a logo component with a custom logo in a non-root url with path 1`] = ` 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..dcf5a4ae29 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 @@ -1,53 +1,53 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Logo renders a logo component with a custom logo 1`] = ` -Plone Site + + Logo of Plone Site + `; exports[`Logo renders a logo component with a custom logo in a non-root url 1`] = ` Plone Site `; exports[`Logo renders a logo component with default config 1`] = ` -Plone Site + + Logo of Plone Site + `; exports[`Logo renders a logo component with default config in a non-root url 1`] = ` Plone Site `;