diff --git a/src/code-editor/index.tsx b/src/code-editor/index.tsx index 5b01a54e6d..c486648c7c 100644 --- a/src/code-editor/index.tsx +++ b/src/code-editor/index.tsx @@ -79,6 +79,7 @@ const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref('hidden'); const [annotations, setAnnotations] = useState([]); @@ -135,6 +136,13 @@ const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref a.type === 'warning').length; const currentAnnotations = useMemo(() => annotations.filter(a => a.type === paneStatus), [annotations, paneStatus]); + const computedAriaDescription = useMemo(() => { + const errorText = `${errorCount} ${i18n('i18nStrings.errorsTab', i18nStrings?.errorsTab)}`; + const warningText = `${warningCount} ${i18n('i18nStrings.warningsTab', i18nStrings?.warningsTab)}`; + + return `${errorText}, ${warningText}`; + }, [errorCount, warningCount, i18n, i18nStrings]); + /* * Callbacks */ @@ -224,6 +232,7 @@ const CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref +
{computedAriaDescription}