From 7944fdd9a2849b1044067a4cf05b31d45afccc83 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 4 May 2022 17:54:47 +0300 Subject: [PATCH] refactor: minor improvements for breadcrumbs (#7299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: minor improvements for breadcrumbs * Apply suggestions from code review * Update packages/docusaurus-theme-translations/locales/fr/theme-common.json Co-authored-by: Joshua Chen Co-authored-by: Sébastien Lorber --- .../src/theme/DocBreadcrumbs/index.tsx | 14 ++++++++++++-- .../src/theme/DocBreadcrumbs/styles.module.css | 6 ++++-- .../locales/ar/theme-common.json | 2 ++ .../locales/base/theme-common.json | 4 ++++ .../locales/bn/theme-common.json | 2 ++ .../locales/cs/theme-common.json | 2 ++ .../locales/da/theme-common.json | 2 ++ .../locales/de/theme-common.json | 2 ++ .../locales/es/theme-common.json | 2 ++ .../locales/fa/theme-common.json | 2 ++ .../locales/fil/theme-common.json | 2 ++ .../locales/fr/theme-common.json | 2 ++ .../locales/he/theme-common.json | 2 ++ .../locales/hi/theme-common.json | 2 ++ .../locales/it/theme-common.json | 2 ++ .../locales/ja/theme-common.json | 2 ++ .../locales/ko/theme-common.json | 2 ++ .../locales/pl/theme-common.json | 2 ++ .../locales/pt-BR/theme-common.json | 2 ++ .../locales/pt-PT/theme-common.json | 2 ++ .../locales/ru/theme-common.json | 2 ++ .../locales/sr/theme-common.json | 2 ++ .../locales/tr/theme-common.json | 2 ++ .../locales/vi/theme-common.json | 2 ++ .../locales/zh-Hans/theme-common.json | 2 ++ .../locales/zh-Hant/theme-common.json | 2 ++ 26 files changed, 66 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx index eaaa85a8b7a9..0ed00dc1f43a 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocBreadcrumbs/index.tsx @@ -15,6 +15,7 @@ import styles from './styles.module.css'; import clsx from 'clsx'; import Link from '@docusaurus/Link'; import useBaseUrl from '@docusaurus/useBaseUrl'; +import {translate} from '@docusaurus/Translate'; import IconHome from '@theme/IconHome'; // TODO move to design system folder @@ -82,9 +83,14 @@ function HomeBreadcrumbItem() { return (
  • - +
  • ); @@ -104,7 +110,11 @@ export default function DocBreadcrumbs(): JSX.Element | null { ThemeClassNames.docs.docBreadcrumbs, styles.breadcrumbsContainer, )} - aria-label="breadcrumbs"> + aria-label={translate({ + id: 'theme.docs.breadcrumbs.navAriaLabel', + message: 'Breadcrumbs', + description: 'The ARIA label for the breadcrumbs', + })}>