From 2b508a3abd1f379d4cb776ac8e658c32118e28ba Mon Sep 17 00:00:00 2001 From: Pavel Nikolaev Date: Mon, 2 Oct 2023 17:17:10 +0300 Subject: [PATCH 1/3] 12972+ Localized debug step PAUSED ON --- .../debug/src/browser/model/debug-thread.tsx | 45 ++++++++++++++++--- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/packages/debug/src/browser/model/debug-thread.tsx b/packages/debug/src/browser/model/debug-thread.tsx index 6b5ba63bd0d2a..aa3bc040da55e 100644 --- a/packages/debug/src/browser/model/debug-thread.tsx +++ b/packages/debug/src/browser/model/debug-thread.tsx @@ -15,7 +15,7 @@ // ***************************************************************************** import * as React from '@theia/core/shared/react'; -import { CancellationTokenSource, Emitter, Event } from '@theia/core'; +import { CancellationTokenSource, Emitter, Event, nls } from '@theia/core'; import { DebugProtocol } from '@vscode/debugprotocol/lib/debugProtocol'; import { TreeElement } from '@theia/core/lib/browser/source-tree'; import { DebugStackFrame } from './debug-stack-frame'; @@ -230,11 +230,44 @@ export class DebugThread extends DebugThreadData implements TreeElement { render(): React.ReactNode { const reason = this.stoppedDetails && this.stoppedDetails.reason; - const status = this.stoppedDetails ? reason ? `Paused on ${reason}` : 'Paused' : 'Running'; - return
- {this.raw.name} - {status} -
; + const localizedReason = this.getlocalizedReason(reason); + + const status = this.stoppedDetails + ? reason + ? nls.localizeByDefault('Paused on {0}', localizedReason) + : nls.localizeByDefault('Paused') + : nls.localizeByDefault('Running'); + return ( +
+ {this.raw.name} + {status} +
+ ); + } + + private getlocalizedReason(reason: string | undefined): string{ + switch (reason) { + case 'step': + return nls.localize('theia/debug/step', 'step'); + case 'breakpoint': + return nls.localize('theia/debug/breakpoint', 'breakpoint'); + case 'breakpoint': + return nls.localize('theia/debug/exception', 'exception'); + case 'breakpoint': + return nls.localize('theia/debug/pause', 'pause'); + case 'breakpoint': + return nls.localize('theia/debug/entry', 'entry'); + case 'breakpoint': + return nls.localize('theia/debug/goto', 'goto'); + case 'breakpoint': + return nls.localize('theia/debug/function breakpoint', 'function breakpoint'); + case 'breakpoint': + return nls.localize('theia/debug/data breakpoint', 'data breakpoint'); + case 'breakpoint': + return nls.localize('theia/debug/instruction breakpoint', 'instruction breakpoint'); + default: + return ''; + } } } From 7a20dcb33431e4d8d2e55c5240ff63834957fa43 Mon Sep 17 00:00:00 2001 From: Pavel Nikolaev Date: Tue, 3 Oct 2023 09:22:10 +0300 Subject: [PATCH 2/3] 12972+ Corrects codestyle --- packages/debug/src/browser/model/debug-thread.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/debug/src/browser/model/debug-thread.tsx b/packages/debug/src/browser/model/debug-thread.tsx index aa3bc040da55e..9eb1f87f87616 100644 --- a/packages/debug/src/browser/model/debug-thread.tsx +++ b/packages/debug/src/browser/model/debug-thread.tsx @@ -245,7 +245,7 @@ export class DebugThread extends DebugThreadData implements TreeElement { ); } - private getlocalizedReason(reason: string | undefined): string{ + private getlocalizedReason(reason: string | undefined): string { switch (reason) { case 'step': return nls.localize('theia/debug/step', 'step'); From 6b318c788b8a420c9c0de66a294c8a6bc0cf6107 Mon Sep 17 00:00:00 2001 From: Pavel Nikolaev Date: Thu, 26 Oct 2023 10:24:49 +0300 Subject: [PATCH 3/3] 12972+ Corrects typos and mistakes --- .../debug/src/browser/model/debug-thread.tsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/debug/src/browser/model/debug-thread.tsx b/packages/debug/src/browser/model/debug-thread.tsx index 9eb1f87f87616..1b945cf16007a 100644 --- a/packages/debug/src/browser/model/debug-thread.tsx +++ b/packages/debug/src/browser/model/debug-thread.tsx @@ -238,33 +238,33 @@ export class DebugThread extends DebugThreadData implements TreeElement { : nls.localizeByDefault('Paused') : nls.localizeByDefault('Running'); return ( -
+
{this.raw.name} {status}
); } - private getlocalizedReason(reason: string | undefined): string { + protected getlocalizedReason(reason: string | undefined): string { switch (reason) { case 'step': return nls.localize('theia/debug/step', 'step'); case 'breakpoint': return nls.localize('theia/debug/breakpoint', 'breakpoint'); - case 'breakpoint': + case 'exception': return nls.localize('theia/debug/exception', 'exception'); - case 'breakpoint': + case 'pause': return nls.localize('theia/debug/pause', 'pause'); - case 'breakpoint': + case 'entry': return nls.localize('theia/debug/entry', 'entry'); - case 'breakpoint': + case 'goto': return nls.localize('theia/debug/goto', 'goto'); - case 'breakpoint': - return nls.localize('theia/debug/function breakpoint', 'function breakpoint'); - case 'breakpoint': - return nls.localize('theia/debug/data breakpoint', 'data breakpoint'); - case 'breakpoint': - return nls.localize('theia/debug/instruction breakpoint', 'instruction breakpoint'); + case 'function breakpoint': + return nls.localize('theia/debug/functionBreakpoint', 'function breakpoint'); + case 'data breakpoint': + return nls.localize('theia/debug/dataBreakpoint', 'data breakpoint'); + case 'instruction breakpoint': + return nls.localize('theia/debug/instructionBreakpoint', 'instruction breakpoint'); default: return ''; }