|
6 | 6 | import { promises as fs } from 'fs';
|
7 | 7 | import { createServer, Server } from 'net';
|
8 | 8 | import * as vscode from 'vscode';
|
9 |
| -import * as nls from 'vscode-nls'; |
10 | 9 |
|
11 | 10 | const enum State {
|
12 | 11 | Disabled = 'disabled',
|
13 | 12 | OnlyWithFlag = 'onlyWithFlag',
|
14 | 13 | Smart = 'smart',
|
15 | 14 | Always = 'always',
|
16 | 15 | }
|
17 |
| -const localize = nls.loadMessageBundle(); |
18 | 16 | const TEXT_STATUSBAR_LABEL = {
|
19 |
| - [State.Disabled]: localize('status.text.auto.attach.disabled', 'Auto Attach: Disabled'), |
20 |
| - [State.Always]: localize('status.text.auto.attach.always', 'Auto Attach: Always'), |
21 |
| - [State.Smart]: localize('status.text.auto.attach.smart', 'Auto Attach: Smart'), |
22 |
| - [State.OnlyWithFlag]: localize('status.text.auto.attach.withFlag', 'Auto Attach: With Flag'), |
| 17 | + [State.Disabled]: vscode.l10n.t('Auto Attach: Disabled'), |
| 18 | + [State.Always]: vscode.l10n.t('Auto Attach: Always'), |
| 19 | + [State.Smart]: vscode.l10n.t('Auto Attach: Smart'), |
| 20 | + [State.OnlyWithFlag]: vscode.l10n.t('Auto Attach: With Flag'), |
23 | 21 | };
|
24 | 22 |
|
25 | 23 | const TEXT_STATE_LABEL = {
|
26 |
| - [State.Disabled]: localize('debug.javascript.autoAttach.disabled.label', 'Disabled'), |
27 |
| - [State.Always]: localize('debug.javascript.autoAttach.always.label', 'Always'), |
28 |
| - [State.Smart]: localize('debug.javascript.autoAttach.smart.label', 'Smart'), |
29 |
| - [State.OnlyWithFlag]: localize( |
30 |
| - 'debug.javascript.autoAttach.onlyWithFlag.label', |
31 |
| - 'Only With Flag', |
32 |
| - ), |
| 24 | + [State.Disabled]: vscode.l10n.t('Disabled'), |
| 25 | + [State.Always]: vscode.l10n.t('Always'), |
| 26 | + [State.Smart]: vscode.l10n.t('Smart'), |
| 27 | + [State.OnlyWithFlag]: vscode.l10n.t('Only With Flag'), |
33 | 28 | };
|
34 | 29 | const TEXT_STATE_DESCRIPTION = {
|
35 |
| - [State.Disabled]: localize( |
36 |
| - 'debug.javascript.autoAttach.disabled.description', |
37 |
| - 'Auto attach is disabled and not shown in status bar', |
38 |
| - ), |
39 |
| - [State.Always]: localize( |
40 |
| - 'debug.javascript.autoAttach.always.description', |
41 |
| - 'Auto attach to every Node.js process launched in the terminal', |
42 |
| - ), |
43 |
| - [State.Smart]: localize( |
44 |
| - 'debug.javascript.autoAttach.smart.description', |
45 |
| - "Auto attach when running scripts that aren't in a node_modules folder", |
46 |
| - ), |
47 |
| - [State.OnlyWithFlag]: localize( |
48 |
| - 'debug.javascript.autoAttach.onlyWithFlag.description', |
49 |
| - 'Only auto attach when the `--inspect` flag is given', |
50 |
| - ), |
| 30 | + [State.Disabled]: vscode.l10n.t('Auto attach is disabled and not shown in status bar'), |
| 31 | + [State.Always]: vscode.l10n.t('Auto attach to every Node.js process launched in the terminal'), |
| 32 | + [State.Smart]: vscode.l10n.t("Auto attach when running scripts that aren't in a node_modules folder"), |
| 33 | + [State.OnlyWithFlag]: vscode.l10n.t('Only auto attach when the `--inspect` flag is given') |
51 | 34 | };
|
52 |
| -const TEXT_TOGGLE_WORKSPACE = localize('scope.workspace', 'Toggle auto attach in this workspace'); |
53 |
| -const TEXT_TOGGLE_GLOBAL = localize('scope.global', 'Toggle auto attach on this machine'); |
54 |
| -const TEXT_TEMP_DISABLE = localize('tempDisable.disable', 'Temporarily disable auto attach in this session'); |
55 |
| -const TEXT_TEMP_ENABLE = localize('tempDisable.enable', 'Re-enable auto attach'); |
56 |
| -const TEXT_TEMP_DISABLE_LABEL = localize('tempDisable.suffix', 'Auto Attach: Disabled'); |
| 35 | +const TEXT_TOGGLE_WORKSPACE = vscode.l10n.t('Toggle auto attach in this workspace'); |
| 36 | +const TEXT_TOGGLE_GLOBAL = vscode.l10n.t('Toggle auto attach on this machine'); |
| 37 | +const TEXT_TEMP_DISABLE = vscode.l10n.t('Temporarily disable auto attach in this session'); |
| 38 | +const TEXT_TEMP_ENABLE = vscode.l10n.t('Re-enable auto attach'); |
| 39 | +const TEXT_TEMP_DISABLE_LABEL = vscode.l10n.t('Auto Attach: Disabled'); |
57 | 40 |
|
58 | 41 | const TOGGLE_COMMAND = 'extension.node-debug.toggleAutoAttach';
|
59 | 42 | const STORAGE_IPC = 'jsDebugIpcState';
|
@@ -318,9 +301,9 @@ function updateStatusBar(context: vscode.ExtensionContext, state: State, busy =
|
318 | 301 |
|
319 | 302 | if (!statusItem) {
|
320 | 303 | statusItem = vscode.window.createStatusBarItem('status.debug.autoAttach', vscode.StatusBarAlignment.Left);
|
321 |
| - statusItem.name = localize('status.name.auto.attach', "Debug Auto Attach"); |
| 304 | + statusItem.name = vscode.l10n.t("Debug Auto Attach"); |
322 | 305 | statusItem.command = TOGGLE_COMMAND;
|
323 |
| - statusItem.tooltip = localize('status.tooltip.auto.attach', "Automatically attach to node.js processes in debug mode"); |
| 306 | + statusItem.tooltip = vscode.l10n.t("Automatically attach to node.js processes in debug mode"); |
324 | 307 | context.subscriptions.push(statusItem);
|
325 | 308 | }
|
326 | 309 |
|
|
0 commit comments