[A11y] add aria label to change every instance on page (#188265)

## Summary

Closes https://github.com/elastic/search-team/issues/7675


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
This commit is contained in:
Rachel Shen 2024-07-24 08:17:02 -06:00 committed by GitHub
parent a51b775391
commit 6750bea4d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,6 +65,13 @@ export const CodeBox: React.FC<CodeBoxProps> = ({
<EuiContextMenuItem
key={language.id}
icon={`${assetBasePath}/${language.iconType}`}
aria-label={i18n.translate(
'searchApiPanels.welcomeBanner.codeBox.selectChangeAriaLabel',
{
defaultMessage: 'Change language to {languageName} for every instance on this page',
values: { languageName: language.name },
}
)}
onClick={() => {
if (setSelectedLanguage) {
setSelectedLanguage(language);