Skip to content

Commit c65103d

Browse files
committed
Translate panel.ts
1 parent 547d9fc commit c65103d

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

packages/labextension/src/panel.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Message } from '@lumino/messaging';
22
import { ISignal } from '@lumino/signaling';
3+
import {
4+
nullTranslator,
5+
ITranslator,
6+
TranslationBundle,
7+
} from '@jupyterlab/translation';
38
import { StackedPanel } from '@lumino/widgets';
49
import { LabIcon } from '@jupyterlab/ui-components';
510
import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
@@ -9,14 +14,19 @@ import tachometer from '../style/tachometer.svg';
914
const PANEL_CLASS = 'jp-KernelUsage-view';
1015

1116
export class KernelUsagePanel extends StackedPanel {
12-
constructor(props: {
13-
widgetAdded: ISignal<INotebookTracker, NotebookPanel | null>;
14-
currentNotebookChanged: ISignal<INotebookTracker, NotebookPanel | null>;
15-
}) {
17+
constructor(
18+
props: {
19+
widgetAdded: ISignal<INotebookTracker, NotebookPanel | null>;
20+
currentNotebookChanged: ISignal<INotebookTracker, NotebookPanel | null>;
21+
},
22+
translator?: ITranslator
23+
) {
1624
super();
25+
this.translator = translator || nullTranslator;
26+
this._trans = this.translator.load('jupyterlab');
1727
this.addClass(PANEL_CLASS);
1828
this.id = 'kernelusage-panel-id';
19-
this.title.caption = 'Kernel Usage';
29+
this.title.caption = this._trans.__('Kernel Usage');
2030
this.title.icon = new LabIcon({
2131
name: 'jupyterlab-kernel-usage:icon',
2232
svgstr: tachometer,
@@ -38,4 +48,7 @@ export class KernelUsagePanel extends StackedPanel {
3848
super.onCloseRequest(msg);
3949
this.dispose();
4050
}
51+
52+
protected translator: ITranslator;
53+
private _trans: TranslationBundle;
4154
}

0 commit comments

Comments
 (0)