diff --git a/src/AccessibilityManager.ts b/src/AccessibilityManager.ts index 281618f4..e1bc841a 100644 --- a/src/AccessibilityManager.ts +++ b/src/AccessibilityManager.ts @@ -3,6 +3,7 @@ * @license MIT */ +import * as Strings from './Strings'; import { ITerminal, IBuffer, IDisposable } from './Interfaces'; import { isMac } from './utils/Browser'; import { RenderDebouncer } from './utils/RenderDebouncer'; @@ -41,7 +42,7 @@ export class AccessibilityManager implements IDisposable { this._moreRowsElement = document.createElement('div'); this._moreRowsElement.style.clip = 'clip(0 0 0 0)'; - this._moreRowsElement.textContent = 'In order to properly navigation the terminal buffer you need to enter navigation mode'; + this._moreRowsElement.textContent = Strings.navigationModeMoreRows; this._accessibilityTreeRoot.appendChild(this._moreRowsElement); this._rowContainer = document.createElement('div'); @@ -156,7 +157,7 @@ export class AccessibilityManager implements IDisposable { this._liveRegionLineCount++; if (this._liveRegionLineCount === MAX_ROWS_TO_READ + 1) { // TODO: Enable localization - this._liveRegion.textContent += 'Too much output to announce, navigate to rows manually to read'; + this._liveRegion.textContent += Strings.tooMuchOutput; } } diff --git a/src/Strings.ts b/src/Strings.ts new file mode 100644 index 00000000..17d8a458 --- /dev/null +++ b/src/Strings.ts @@ -0,0 +1,8 @@ +/** + * Copyright (c) 2018 The xterm.js authors. All rights reserved. + * @license MIT + */ + +export let promptLabel = 'Terminal input'; +export let navigationModeMoreRows = 'In order to properly navigation the terminal buffer you need to enter navigation mode'; +export let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read'; diff --git a/src/Terminal.ts b/src/Terminal.ts index 584565eb..d293c256 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -36,6 +36,7 @@ import { Linkifier } from './Linkifier'; import { SelectionManager } from './SelectionManager'; import { CharMeasure } from './utils/CharMeasure'; import * as Browser from './utils/Browser'; +import * as Strings from './Strings'; import { MouseHelper } from './utils/MouseHelper'; import { CHARSETS } from './Charsets'; import { CustomKeyEventHandler, LinkMatcherHandler, LinkMatcherValidationCallback, CharData, LineData } from './Types'; @@ -623,7 +624,7 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT this.textarea = document.createElement('textarea'); this.textarea.classList.add('xterm-helper-textarea'); // TODO: New API to set title? This could say "Terminal bash input", etc. - this.textarea.setAttribute('aria-label', 'Terminal input'); + this.textarea.setAttribute('aria-label', Strings.promptLabel); this.textarea.setAttribute('aria-multiline', 'false'); this.textarea.setAttribute('autocorrect', 'off'); this.textarea.setAttribute('autocapitalize', 'off');