mjs and js

This commit is contained in:
Daniel Imms
2024-07-05 11:48:42 -07:00
parent 40c5fbf0cb
commit 057abba08b
18 changed files with 56 additions and 20 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ export class AccessibilityManager extends Disposable {
if (char === '\n') {
this._liveRegionLineCount++;
if (this._liveRegionLineCount === MAX_ROWS_TO_READ + 1) {
this._liveRegion.textContent += Strings.tooMuchOutput;
this._liveRegion.textContent += Strings.tooMuchOutput.get();
}
}
}
+1 -1
View File
@@ -443,7 +443,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
this.textarea = this._document.createElement('textarea');
this.textarea.classList.add('xterm-helper-textarea');
this.textarea.setAttribute('aria-label', Strings.promptLabel);
this.textarea.setAttribute('aria-label', Strings.promptLabel.get());
if (!Browser.isChromeOS) {
// ChromeVox on ChromeOS does not like this. See
// https://issuetracker.google.com/issues/260170397
+15 -4
View File
@@ -5,8 +5,19 @@
// This file contains strings that get exported in the API so they can be localized
// eslint-disable-next-line prefer-const
export let promptLabel = 'Terminal input';
let promptLabelInternal = 'Terminal input';
const promptLabel = {
get: () => promptLabelInternal,
set: (value: string) => promptLabelInternal = value
};
// eslint-disable-next-line prefer-const
export let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';
let tooMuchOutputInternal = 'Too much output to announce, navigate to rows manually to read';
const tooMuchOutput = {
get: () => tooMuchOutputInternal,
set: (value: string) => tooMuchOutputInternal = value
};
export {
promptLabel,
tooMuchOutput
};
+7 -1
View File
@@ -247,7 +247,13 @@ export class Terminal extends Disposable implements ITerminalApi {
this._addonManager.loadAddon(this, addon);
}
public static get strings(): ILocalizableStrings {
return Strings;
// A wrapper is required here because esbuild prevents setting an `export let`
return {
get promptLabel(): string { return Strings.promptLabel.get(); },
set promptLabel(value: string) { Strings.promptLabel.set(value); },
get tooMuchOutput(): string { return Strings.tooMuchOutput.get(); },
set tooMuchOutput(value: string) { Strings.tooMuchOutput.set(value); }
};
}
private _verifyIntegers(...values: number[]): void {