Skip to content

Commit 69742b8

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
Add an aria label to custom new badges
Bypass-Check-License: Only updates files, no new files are added. Bug: 439534740 Change-Id: I74090a1f1f6b43e4c63b4eb5c1e5f34e2dd30a04 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6870369 Commit-Queue: Kateryna Prokopenko <[email protected]> Auto-Submit: Kateryna Prokopenko <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]>
1 parent e023e01 commit 69742b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

front_end/ui/legacy/UIUtils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ const UIStrings = {
123123
* @description Text for the new badge appearing next to some menu items
124124
*/
125125
new: 'NEW',
126+
/**
127+
* @description Aria label for the new badge appearing next to some menu items
128+
*/
129+
newFeature: 'This is a new feature',
126130
} as const;
127131
const str_ = i18n.i18n.registerUIStrings('ui/legacy/UIUtils.ts', UIStrings);
128132
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -2146,6 +2150,7 @@ export function maybeCreateNewBadge(promotionId: string): HTMLDivElement|undefin
21462150
const badge = document.createElement('div');
21472151
badge.className = 'new-badge';
21482152
badge.textContent = i18nString(UIStrings.new);
2153+
badge.ariaLabel = i18nString(UIStrings.newFeature);
21492154
badge.setAttribute('jslog', `${VisualLogging.badge('new-badge')}`);
21502155
return badge;
21512156
}

0 commit comments

Comments
 (0)