Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed a11y Logo Issue and added Translations #5722

Merged
merged 4 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/volto/locales/ca/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/fi/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/ja/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/pt_BR/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/ro/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion packages/volto/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-01-12T09:21:12.378Z\n"
"POT-Creation-Date: 2024-01-31T14:54:12.513Z\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Content-Type: text/plain; charset=utf-8\n"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions packages/volto/locales/zh_CN/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/volto/news/5722.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the Alt-Title of the Logo to say "Back to Homepage" in various Languages for a11y and Screenreader conformity @Molochem
13 changes: 11 additions & 2 deletions packages/volto/src/components/theme/Logo/Logo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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))) {
Expand All @@ -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)}
/>
</ConditionalLink>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

exports[`Multilingual Logo renders a logo component in a multilingual site language root 1`] = `
<img
alt="English"
alt="Back to homepage"
className="ui image"
src="Logo.svg"
title="English"
title="Back to homepage"
/>
`;

Expand All @@ -18,20 +18,20 @@ exports[`Multilingual Logo renders a logo component in a multilingual site root
title="Plone Site"
>
<img
alt="Plone Site"
alt="Back to homepage"
className="ui image"
src="Logo.svg"
title="Plone Site"
title="Back to homepage"
/>
</a>
`;

exports[`Multilingual Logo renders a logo component with a custom logo in a non-root url 1`] = `
<img
alt="English"
alt="Back to homepage"
className="ui image"
src="/@@site-logo/logo.cab945d8.svg"
title="English"
title="Back to homepage"
/>
`;

Expand All @@ -44,10 +44,10 @@ exports[`Multilingual Logo renders a logo component with a custom logo in a non-
title="English"
>
<img
alt="English"
alt="Back to homepage"
className="ui image"
src="/@@site-logo/logo.cab945d8.svg"
title="English"
title="Back to homepage"
/>
</a>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

exports[`Logo renders a logo component with a custom logo 1`] = `
<img
alt="Plone Site"
alt="Back to homepage"
className="ui image"
src="/@@site-logo/logo.cab945d8.svg"
title="Plone Site"
title="Back to homepage"
/>
`;

Expand All @@ -18,20 +18,20 @@ exports[`Logo renders a logo component with a custom logo in a non-root url 1`]
title="Plone Site"
>
<img
alt="Plone Site"
alt="Back to homepage"
className="ui image"
src="/@@site-logo/logo.cab945d8.svg"
title="Plone Site"
title="Back to homepage"
/>
</a>
`;

exports[`Logo renders a logo component with default config 1`] = `
<img
alt="Plone Site"
alt="Back to homepage"
className="ui image"
src="Logo.svg"
title="Plone Site"
title="Back to homepage"
/>
`;

Expand All @@ -44,10 +44,10 @@ exports[`Logo renders a logo component with default config in a non-root url 1`]
title="Plone Site"
>
<img
alt="Plone Site"
alt="Back to homepage"
className="ui image"
src="/@@site-logo/logo.cab945d8.svg"
title="Plone Site"
title="Back to homepage"
/>
</a>
`;
Loading