commit acff600402b3fa38304d1420876d3a12be6cde7f parent 56ac48b4520f454070c42b1777c73de713a987eb Author: Jared Hirsch <ohai@6a68.net> Date: Fri, 7 Nov 2025 20:35:07 +0000 Bug 1997972 - Label the profiles desktop shortcut toggle for screen readers r=fluent-reviewers,jaws,bolsson Differential Revision: https://phabricator.services.mozilla.com/D271713 Diffstat:
4 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/browser/components/profiles/content/edit-profile-card.mjs b/browser/components/profiles/content/edit-profile-card.mjs @@ -452,6 +452,7 @@ export class EditProfileCard extends MozLitElement { ></label> <moz-toggle id="desktop-shortcut-toggle" + data-l10n-id="edit-profile-page-desktop-shortcut-toggle" ?pressed=${this.hasDesktopShortcut} @click=${this.handleDesktopShortcutToggle} ></moz-toggle> diff --git a/browser/components/profiles/tests/browser/browser_desktop_shortcut_test.js b/browser/components/profiles/tests/browser/browser_desktop_shortcut_test.js @@ -53,6 +53,13 @@ add_task(async function test_create_shortcut() { await editProfileCard.updateComplete; let shortcutToggle = editProfileCard.shortcutToggle; + + Assert.equal( + shortcutToggle.buttonEl.getAttribute("aria-label"), + "Create desktop shortcut", + "The desktop shortcut toggle should have the expected aria-label" + ); + Assert.ok( !shortcutToggle.pressed, "The desktop shortcut toggle should initially be in the off position" diff --git a/browser/locales/en-US/browser/profiles.ftl b/browser/locales/en-US/browser/profiles.ftl @@ -43,6 +43,8 @@ edit-profile-page-theme-header-2 = .label = Theme edit-profile-page-explore-themes = Explore more themes edit-profile-page-desktop-shortcut-header = Create desktop shortcut +edit-profile-page-desktop-shortcut-toggle = + .aria-label = Create desktop shortcut edit-profile-page-avatar-header-2 = .label = Avatar edit-profile-page-delete-button = diff --git a/python/l10n/fluent_migrations/bug_1997972_profiles_shortcut.py b/python/l10n/fluent_migrations/bug_1997972_profiles_shortcut.py @@ -0,0 +1,23 @@ +# Any copyright is dedicated to the Public Domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + +from fluent.migrate import COPY_PATTERN +from fluent.migrate.helpers import transforms_from + + +def migrate(ctx): + """Bug 1997972 - Add aria-label to profiles desktop shortcut toggle, part {index}.""" + source = "browser/browser/profiles.ftl" + target = source + + ctx.add_transforms( + target, + source, + transforms_from( + """ +edit-profile-page-desktop-shortcut-toggle = + .aria-label = {COPY_PATTERN(from_path, "edit-profile-page-desktop-shortcut-header")} +""", + from_path=source, + ), + )