Skip to content
This repository was archived by the owner on Nov 2, 2025. It is now read-only.

Commit 749b45e

Browse files
fix(theme): Add aria-label to IconExternalLink with value '(opens in new tab)' (facebook#11331)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
1 parent 2febb76 commit 749b45e

36 files changed

+42
-1
lines changed

packages/docusaurus-theme-classic/src/theme/Icon/ExternalLink/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import React, {type ReactNode} from 'react';
9+
import {translate} from '@docusaurus/Translate';
910
import type {Props} from '@theme/Icon/ExternalLink';
1011

1112
import styles from './styles.module.css';
@@ -22,7 +23,11 @@ export default function IconExternalLink({
2223
<svg
2324
width={width}
2425
height={height}
25-
aria-hidden="true"
26+
aria-label={translate({
27+
id: 'theme.IconExternalLink.ariaLabel',
28+
message: '(opens in new tab)',
29+
description: 'The ARIA label for the external link icon',
30+
})}
2631
className={styles.iconExternalLink}>
2732
<use href={svgSprite} />
2833
</svg>

packages/docusaurus-theme-translations/locales/ar/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Expand sidebar category '{label}'",
1010
"theme.ErrorPageContent.title": "هذه الصفحة لا تستجيب.",
1111
"theme.ErrorPageContent.tryAgain": "المحاولة مجددا",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Main",
1314
"theme.NotFound.p1": "لم نتمكن من العثور على ما كنت تبحث عنه.",
1415
"theme.NotFound.p2": "يرجى الاتصال بمالك الموقع الذي ربطك بعنوان URL الأصلي وإخباره بأن الارتباط الخاص به معطل.",

packages/docusaurus-theme-translations/locales/base/theme-common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"theme.ErrorPageContent.title___DESCRIPTION": "The title of the fallback page when the page crashed",
2020
"theme.ErrorPageContent.tryAgain": "Try again",
2121
"theme.ErrorPageContent.tryAgain___DESCRIPTION": "The label of the button to try again rendering when the React error boundary captures an error",
22+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
23+
"theme.IconExternalLink.ariaLabel___DESCRIPTION": "The ARIA label for the external link icon",
2224
"theme.NavBar.navAriaLabel": "Main",
2325
"theme.NavBar.navAriaLabel___DESCRIPTION": "The ARIA label for the main navigation",
2426
"theme.NotFound.p1": "We could not find what you were looking for.",

packages/docusaurus-theme-translations/locales/bg/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Разширяване на категорията'{label}'",
1010
"theme.ErrorPageContent.title": "Тази страница се срина.",
1111
"theme.ErrorPageContent.tryAgain": "Опитайте отново",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Основен",
1314
"theme.NotFound.p1": "Не успяхме да намерим това, което търсите.",
1415
"theme.NotFound.p2": "Моля, свържете се със собственика на сайта, който ви е свързал с оригиналния URL адрес, и ги уведомете, че връзката им е повредена.",

packages/docusaurus-theme-translations/locales/bn/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Expand sidebar category '{label}'",
1010
"theme.ErrorPageContent.title": "This page crashed.",
1111
"theme.ErrorPageContent.tryAgain": "Try again",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Main",
1314
"theme.NotFound.p1": "আপনি যা খুঁজছিলেন তা আমরা খুঁজে পাইনি।",
1415
"theme.NotFound.p2": "দয়া করে সাইটের মালিকের সাথে যোগাযোগ করুন যা আপনাকে মূল URL এর সাথে যুক্ত করেছে এবং তাদের লিঙ্কটি ভাঙ্গা রয়েছে তা তাদের জানান।",

packages/docusaurus-theme-translations/locales/cs/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Expand sidebar category '{label}'",
1010
"theme.ErrorPageContent.title": "This page crashed.",
1111
"theme.ErrorPageContent.tryAgain": "Try again",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Main",
1314
"theme.NotFound.p1": "Nepodařilo se nám najít co jste hledal(a).",
1415
"theme.NotFound.p2": "Kontaktujte prosím vlastníka webu, který vás odkázal na původní URL a upozorněte ho, že jejich odkaz nefunguje.",

packages/docusaurus-theme-translations/locales/da/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Expand sidebar category '{label}'",
1010
"theme.ErrorPageContent.title": "This page crashed.",
1111
"theme.ErrorPageContent.tryAgain": "Try again",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Main",
1314
"theme.NotFound.p1": "Vi kunne ikke finde det, du søgte.",
1415
"theme.NotFound.p2": "Venligst kontakt ejeren til webstedet, som førte dig frem denne URL, og informer dem om at linket ikke virker.",

packages/docusaurus-theme-translations/locales/de/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Expand sidebar category '{label}'",
1010
"theme.ErrorPageContent.title": "Die Seite ist abgestürzt.",
1111
"theme.ErrorPageContent.tryAgain": "Nochmal versuchen",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Main",
1314
"theme.NotFound.p1": "Wir konnten nicht finden, wonach Sie gesucht haben.",
1415
"theme.NotFound.p2": "Bitte kontaktieren Sie den Besitzer der Seite, die Sie mit der ursprünglichen URL verlinkt hat, und teilen Sie ihm mit, dass der Link nicht mehr funktioniert.",

packages/docusaurus-theme-translations/locales/es/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Ampliar la categoría '{label}' de la barra lateral",
1010
"theme.ErrorPageContent.title": "Esta página ha fallado.",
1111
"theme.ErrorPageContent.tryAgain": "Intente de nuevo",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Principal",
1314
"theme.NotFound.p1": "No pudimos encontrar lo que buscaba.",
1415
"theme.NotFound.p2": "Comuníquese con el dueño del sitio que le proporcionó la URL original y hágale saber que su vínculo está roto.",

packages/docusaurus-theme-translations/locales/et/theme-common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"theme.DocSidebarItem.expandCategoryAriaLabel": "Ava külgrea kategooria '{label}'",
1010
"theme.ErrorPageContent.title": "See leht jooksis kokku.",
1111
"theme.ErrorPageContent.tryAgain": "Proovi uuesti",
12+
"theme.IconExternalLink.ariaLabel": "(opens in new tab)",
1213
"theme.NavBar.navAriaLabel": "Peamine",
1314
"theme.NotFound.p1": "Vabandame, kuid lehte ei leitud.",
1415
"theme.NotFound.p2": "Kui arvad, et see on viga, palun võta meiega ühendust.",

0 commit comments

Comments
 (0)