Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12972+ Localized debug step PAUSED ON #12973

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions packages/debug/src/browser/model/debug-thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 <div className='theia-debug-thread' title='Thread'>
<span className='label'>{this.raw.name}</span>
<span className='status'>{status}</span>
</div>;
const localizedReason = this.getlocalizedReason(reason);

const status = this.stoppedDetails
? reason
? nls.localizeByDefault('Paused on {0}', localizedReason)
: nls.localizeByDefault('Paused')
: nls.localizeByDefault('Running');
return (
<div className="theia-debug-thread" title={nls.localizeByDefault('Session')}>
<span className="label">{this.raw.name}</span>
<span className="status">{status}</span>
</div>
);
}

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 'exception':
return nls.localize('theia/debug/exception', 'exception');
case 'pause':
return nls.localize('theia/debug/pause', 'pause');
case 'entry':
return nls.localize('theia/debug/entry', 'entry');
case 'goto':
return nls.localize('theia/debug/goto', 'goto');
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 '';
}
}

}
Loading