Skip to content

@jsvision/code-editor / formatCodeEditorDegradationNotice

Function: formatCodeEditorDegradationNotice() ​

formatCodeEditorDegradationNotice(notice, i18n?): string | undefined

Defined in: code-editor/src/degradation.ts:86

Formats one editor-owned degradation notice with an explicit or isolated English service.

Parameters ​

notice ​

CodeEditorDegradationNotice

Stable editor degradation metadata.

i18n? ​

I18n

Optional locale service.

Returns ​

string | undefined

Localized wrapper text, or undefined when the notice has no compatible prose.

Example ​

ts
const state = createDegradationState();
state.fail('parser');
const message = formatCodeEditorDegradationNotice(state.snapshot().notices[0]!);