mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Support i18n
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
+2
-1
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user