diff --git a/src/Terminal.ts b/src/Terminal.ts index 4eafc7a0..48d00b2b 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -47,7 +47,7 @@ import { DEFAULT_ANSI_COLORS } from './renderer/ColorManager'; import { MouseZoneManager } from './input/MouseZoneManager'; import { AccessibilityManager } from './AccessibilityManager'; import { ScreenDprMonitor } from './utils/ScreenDprMonitor'; -import { ITheme } from 'xterm'; +import { ITheme, ILocalizableStrings } from 'xterm'; // Let it work inside Node.js for automated testing purposes. const document = (typeof window !== 'undefined') ? window.document : null; @@ -313,6 +313,10 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT return this.buffers.active; } + public static get strings(): ILocalizableStrings { + return Strings; + } + /** * back_color_erase feature for xterm. */ diff --git a/src/utils/TestUtils.test.ts b/src/utils/TestUtils.test.ts index dd912676..0c79e98f 100644 --- a/src/utils/TestUtils.test.ts +++ b/src/utils/TestUtils.test.ts @@ -10,6 +10,7 @@ import * as Browser from '../shared/utils/Browser'; import { ITheme, IDisposable } from 'xterm'; export class MockTerminal implements ITerminal { + static string: any; getOption(key: any): any { throw new Error('Method not implemented.'); } diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index c48c814b..ea39ffcd 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -207,12 +207,18 @@ declare module 'xterm' { } /** - * An object that can be disposed via a dipose function. + * An object that can be disposed via a dispose function. */ export interface IDisposable { dispose(): void; } + export interface ILocalizableStrings { + blankLine: string; + promptLabel: string; + tooMuchOutput: string; + } + /** * The class that represents an xterm.js terminal. */ @@ -237,6 +243,11 @@ declare module 'xterm' { */ cols: number; + /** + * Natural language strings that can be localized. + */ + static strings: ILocalizableStrings; + /** * Creates a new `Terminal` object. *