From 3dec07ff23191b509b3ae8f1dd65b3e7f1694b5e Mon Sep 17 00:00:00 2001 From: Luis Felipe Zaguini <26530524+zaguiini@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:26:59 -0300 Subject: [PATCH] Reference correct translation key for the `aria-label` attribute within UIMessage's Close Icon (#7365) --- components/lib/messages/UIMessage.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/lib/messages/UIMessage.js b/components/lib/messages/UIMessage.js index a51fffa446..6d57270453 100644 --- a/components/lib/messages/UIMessage.js +++ b/components/lib/messages/UIMessage.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { localeOption } from '../api/Api'; +import { ariaLabel } from '../api/Api'; import { useTimeout } from '../hooks/Hooks'; import { CheckIcon } from '../icons/check'; import { ExclamationTriangleIcon } from '../icons/exclamationtriangle'; @@ -53,8 +53,6 @@ export const UIMessage = React.memo( const createCloseIcon = () => { if (closable !== false) { - const ariaLabel = localeOption('close'); - const buttonIconProps = mergeProps( { className: cx('uimessage.buttonicon') @@ -70,7 +68,7 @@ export const UIMessage = React.memo( { type: 'button', className: cx('uimessage.button'), - 'aria-label': ariaLabel, + 'aria-label': ariaLabel('close'), onClick: onClose }, getPTOptions('button', parentParams),