@difizen/libro-jupyter 0.2.44 → 0.2.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"cell-execution-tip.d.ts","sourceRoot":"","sources":["../../src/components/cell-execution-tip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAoBpD,OAAO,cAAc,CAAC;AAEtB,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,kDAyF5D"}
1
+ {"version":3,"file":"cell-execution-tip.d.ts","sourceRoot":"","sources":["../../src/components/cell-execution-tip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAqBpD,OAAO,cAAc,CAAC;AAEtB,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,kDA0F5D"}
@@ -7,6 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { LoadingOutlined } from '@ant-design/icons';
8
8
  import { ExecutableCellView, CheckCircleOutlined, ExecutableCellModel } from '@difizen/libro-core';
9
9
  import { useObserve } from '@difizen/mana-app';
10
+ import { l10n } from '@difizen/mana-l10n';
10
11
  import classnames from 'classnames';
11
12
  import moment from 'moment';
12
13
  import { useState } from 'react';
@@ -49,7 +50,7 @@ export function CellExecutionTip(_ref) {
49
50
  children: [/*#__PURE__*/_jsx("div", {
50
51
  className: "libro-cell-execution-tip-border"
51
52
  }), /*#__PURE__*/_jsx(CheckCircleOutlined, {}), /*#__PURE__*/_jsx("p", {
52
- children: 'The execution took in ' + formatTime(Number(new Date(executeFinishTime).getTime()) - Number(new Date(executeStartTime).getTime())) + ', finished at ' + moment(new Date(executeFinishTime).getTime()).format('hh:mm a') + '.'
53
+ children: l10n.t('执行耗时 {0},结束于 {1}', formatTime(Number(new Date(executeFinishTime).getTime()) - Number(new Date(executeStartTime).getTime())), moment(new Date(executeFinishTime).getTime()).format('hh:mm a'))
53
54
  })]
54
55
  });
55
56
  } else if (kernelExecuting) {
@@ -65,7 +66,7 @@ export function CellExecutionTip(_ref) {
65
66
  color: 'rgba(24,144,255,1)'
66
67
  }
67
68
  }), /*#__PURE__*/_jsx("p", {
68
- children: 'It takes ' + formatTime(Date.now() - Number(new Date(executeStartTime).getTime())) + '.'
69
+ children: l10n.t('已过去 {0}', formatTime(Date.now() - Number(new Date(executeStartTime).getTime())))
69
70
  })]
70
71
  });
71
72
  } else if (waitingExecute) {
@@ -74,7 +75,7 @@ export function CellExecutionTip(_ref) {
74
75
  children: [/*#__PURE__*/_jsx("div", {
75
76
  className: "libro-cell-execution-tip-border"
76
77
  }), /*#__PURE__*/_jsx(InfoCircle, {}), /*#__PURE__*/_jsx("p", {
77
- children: 'execution queued.'
78
+ children: l10n.t('待执行')
78
79
  })]
79
80
  });
80
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-selector-dropdown.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-selector-dropdown.tsx"],"names":[],"mappings":";AAUA,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAsGD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EA0HlC,CAAC"}
1
+ {"version":3,"file":"kernel-selector-dropdown.d.ts","sourceRoot":"","sources":["../../src/toolbar/kernel-selector-dropdown.tsx"],"names":[],"mappings":";AAUA,OAAO,cAAc,CAAC;AAGtB,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AA2FD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EA2HlC,CAAC"}
@@ -13,6 +13,7 @@ import { useCallback, useEffect, useState } from 'react';
13
13
  import { LibroJupyterConfiguration } from "../config/index.js";
14
14
  import { LibroJupyterModel } from "../libro-jupyter-model.js";
15
15
  import "./index.less";
16
+ import { l10n } from '@difizen/mana-l10n';
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
19
  function getKernelList(kernelConnectionManager, kernelSpecManager) {
@@ -52,7 +53,7 @@ function getKernelListItems(preferredSessionKernelList, otherKernelList, allowPr
52
53
  var array = [{
53
54
  key: 'StartPreferredKernel',
54
55
  type: 'group',
55
- label: 'Start Preferred Kernel',
56
+ label: l10n.t('启动首选的 Kernel'),
56
57
  children: otherKernelList.map(function (item) {
57
58
  return {
58
59
  key: item.name,
@@ -62,36 +63,26 @@ function getKernelListItems(preferredSessionKernelList, otherKernelList, allowPr
62
63
  }, {
63
64
  key: 'UseNoKernel',
64
65
  type: 'group',
65
- label: 'Use No Kernel',
66
+ label: l10n.t('不使用 Kernel'),
66
67
  children: [{
67
68
  key: 'No Kernel',
68
- label: 'No Kernel'
69
+ label: l10n.t(' Kernel')
69
70
  }]
70
- }, {
71
- key: 'UseKernelFromPreferredSession',
72
- type: 'group',
73
- label: 'Use Kernel from Preferred Session',
74
- children: preferredSessionKernelList.map(function (item) {
75
- return {
76
- key: item.fileName,
77
- label: item.fileName
78
- };
79
- })
80
71
  }, {
81
72
  key: 'divider1',
82
73
  type: 'divider' // Must have
83
74
  }, {
84
75
  key: 'RestartKernel',
85
- label: 'Restart the Kernel'
76
+ label: l10n.t('重启 Kernel')
86
77
  }, {
87
78
  key: 'ShutDownKernel',
88
- label: 'Shut Down the Kernel'
79
+ label: l10n.t('关闭 Kernel')
89
80
  }];
90
81
  if (allowPreferredSession) {
91
82
  array.splice(2, 0, {
92
83
  key: 'UseKernelFromPreferredSession',
93
84
  type: 'group',
94
- label: 'Use Kernel from Preferred Session',
85
+ label: l10n.t('使用首选 Session Kernel'),
95
86
  children: preferredSessionKernelList.map(function (item) {
96
87
  return {
97
88
  key: item.fileName,
@@ -192,7 +183,7 @@ export var KernelSelector = function KernelSelector() {
192
183
  },
193
184
  trigger: ['click'],
194
185
  children: /*#__PURE__*/_jsxs(Space, {
195
- children: [libroModel !== null && libroModel !== void 0 && (_kernelConnection = libroModel.kernelConnection) !== null && _kernelConnection !== void 0 && _kernelConnection.isDisposed ? 'no kernel' : (libroModel === null || libroModel === void 0 || (_kernelConnection2 = libroModel.kernelConnection) === null || _kernelConnection2 === void 0 ? void 0 : _kernelConnection2.name) || 'no kernel', /*#__PURE__*/_jsx(CaretDownOutlined, {})]
186
+ children: [libroModel !== null && libroModel !== void 0 && (_kernelConnection = libroModel.kernelConnection) !== null && _kernelConnection !== void 0 && _kernelConnection.isDisposed ? l10n.t(' Kernel') : (libroModel === null || libroModel === void 0 || (_kernelConnection2 = libroModel.kernelConnection) === null || _kernelConnection2 === void 0 ? void 0 : _kernelConnection2.name) || l10n.t(' Kernel'), /*#__PURE__*/_jsx(CaretDownOutlined, {})]
196
187
  })
197
188
  });
198
189
  };
@@ -28,7 +28,7 @@ export var KernelStatusSelector = function KernelStatusSelector() {
28
28
  className: "libro-kernel-status-and-selector",
29
29
  children: [/*#__PURE__*/_jsx("span", {
30
30
  className: "kernel",
31
- children: l10n.t('kernel:')
31
+ children: l10n.t('Kernel:')
32
32
  }), /*#__PURE__*/_jsx(KernelSelector, {}), showBadge && (isKernelBusy ? /*#__PURE__*/_jsx(Badge, {
33
33
  className: "libro-kernel-badge",
34
34
  color: kernelStatus['busy'].color,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-jupyter",
3
- "version": "0.2.44",
3
+ "version": "0.2.45",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro"
@@ -37,22 +37,22 @@
37
37
  "dependencies": {
38
38
  "@ant-design/colors": "^7.0.0",
39
39
  "@ant-design/icons": "^5.1.0",
40
- "@difizen/libro-code-cell": "^0.2.44",
41
- "@difizen/libro-code-editor": "^0.2.44",
42
- "@difizen/libro-codemirror": "^0.2.44",
43
- "@difizen/libro-cofine-editor": "^0.2.44",
44
- "@difizen/libro-common": "^0.2.44",
45
- "@difizen/libro-core": "^0.2.44",
46
- "@difizen/libro-kernel": "^0.2.44",
47
- "@difizen/libro-l10n": "^0.2.44",
48
- "@difizen/libro-language-client": "^0.2.44",
49
- "@difizen/libro-lsp": "^0.2.44",
50
- "@difizen/libro-markdown-cell": "^0.2.44",
51
- "@difizen/libro-output": "^0.2.44",
52
- "@difizen/libro-raw-cell": "^0.2.44",
53
- "@difizen/libro-rendermime": "^0.2.44",
54
- "@difizen/libro-search": "^0.2.44",
55
- "@difizen/libro-search-code-cell": "^0.2.44",
40
+ "@difizen/libro-code-cell": "^0.2.45",
41
+ "@difizen/libro-code-editor": "^0.2.45",
42
+ "@difizen/libro-codemirror": "^0.2.45",
43
+ "@difizen/libro-cofine-editor": "^0.2.45",
44
+ "@difizen/libro-common": "^0.2.45",
45
+ "@difizen/libro-core": "^0.2.45",
46
+ "@difizen/libro-kernel": "^0.2.45",
47
+ "@difizen/libro-l10n": "^0.2.45",
48
+ "@difizen/libro-language-client": "^0.2.45",
49
+ "@difizen/libro-lsp": "^0.2.45",
50
+ "@difizen/libro-markdown-cell": "^0.2.45",
51
+ "@difizen/libro-output": "^0.2.45",
52
+ "@difizen/libro-raw-cell": "^0.2.45",
53
+ "@difizen/libro-rendermime": "^0.2.45",
54
+ "@difizen/libro-search": "^0.2.45",
55
+ "@difizen/libro-search-code-cell": "^0.2.45",
56
56
  "@difizen/mana-app": "latest",
57
57
  "@difizen/mana-l10n": "latest",
58
58
  "classnames": "^2.3.2",
@@ -6,6 +6,7 @@ import {
6
6
  ExecutableCellModel,
7
7
  } from '@difizen/libro-core';
8
8
  import { useObserve } from '@difizen/mana-app';
9
+ import { l10n } from '@difizen/mana-l10n';
9
10
  import classnames from 'classnames';
10
11
  import moment from 'moment';
11
12
  import { useState } from 'react';
@@ -64,14 +65,14 @@ export function CellExecutionTip({ cell }: { cell: CellView }) {
64
65
  <div className="libro-cell-execution-tip-border" />
65
66
  <CheckCircleOutlined />
66
67
  <p>
67
- {'The execution took in ' +
68
+ {l10n.t(
69
+ '执行耗时 {0},结束于 {1}',
68
70
  formatTime(
69
71
  Number(new Date(executeFinishTime).getTime()) -
70
72
  Number(new Date(executeStartTime).getTime()),
71
- ) +
72
- ', finished at ' +
73
- moment(new Date(executeFinishTime).getTime()).format('hh:mm a') +
74
- '.'}
73
+ ),
74
+ moment(new Date(executeFinishTime).getTime()).format('hh:mm a'),
75
+ )}
75
76
  </p>
76
77
  </div>
77
78
  );
@@ -89,9 +90,10 @@ export function CellExecutionTip({ cell }: { cell: CellView }) {
89
90
  <div className="libro-cell-execution-tip-border" />
90
91
  <LoadingOutlined style={{ color: 'rgba(24,144,255,1)' }} />
91
92
  <p>
92
- {'It takes ' +
93
- formatTime(Date.now() - Number(new Date(executeStartTime).getTime())) +
94
- '.'}
93
+ {l10n.t(
94
+ '已过去 {0}',
95
+ formatTime(Date.now() - Number(new Date(executeStartTime).getTime())),
96
+ )}
95
97
  </p>
96
98
  </div>
97
99
  );
@@ -105,7 +107,7 @@ export function CellExecutionTip({ cell }: { cell: CellView }) {
105
107
  >
106
108
  <div className="libro-cell-execution-tip-border" />
107
109
  <InfoCircle />
108
- <p>{'execution queued.'}</p>
110
+ <p>{l10n.t('待执行')}</p>
109
111
  </div>
110
112
  );
111
113
  }
@@ -9,6 +9,7 @@ import { useCallback, useEffect, useState } from 'react';
9
9
  import { LibroJupyterConfiguration } from '../config/index.js';
10
10
  import { LibroJupyterModel } from '../libro-jupyter-model.js';
11
11
  import './index.less';
12
+ import { l10n } from '@difizen/mana-l10n';
12
13
 
13
14
  export interface PreferredSessionKernelListElem {
14
15
  name: string;
@@ -62,7 +63,7 @@ function getKernelListItems(
62
63
  {
63
64
  key: 'StartPreferredKernel',
64
65
  type: 'group',
65
- label: 'Start Preferred Kernel',
66
+ label: l10n.t('启动首选的 Kernel'),
66
67
  children: otherKernelList.map((item) => {
67
68
  return {
68
69
  key: item.name,
@@ -73,43 +74,32 @@ function getKernelListItems(
73
74
  {
74
75
  key: 'UseNoKernel',
75
76
  type: 'group',
76
- label: 'Use No Kernel',
77
+ label: l10n.t('不使用 Kernel'),
77
78
  children: [
78
79
  {
79
80
  key: 'No Kernel',
80
- label: 'No Kernel',
81
+ label: l10n.t(' Kernel'),
81
82
  },
82
83
  ],
83
84
  },
84
- {
85
- key: 'UseKernelFromPreferredSession',
86
- type: 'group',
87
- label: 'Use Kernel from Preferred Session',
88
- children: preferredSessionKernelList.map((item) => {
89
- return {
90
- key: item.fileName,
91
- label: item.fileName,
92
- };
93
- }),
94
- },
95
85
  {
96
86
  key: 'divider1',
97
87
  type: 'divider', // Must have
98
88
  },
99
89
  {
100
90
  key: 'RestartKernel',
101
- label: 'Restart the Kernel',
91
+ label: l10n.t('重启 Kernel'),
102
92
  },
103
93
  {
104
94
  key: 'ShutDownKernel',
105
- label: 'Shut Down the Kernel',
95
+ label: l10n.t('关闭 Kernel'),
106
96
  },
107
97
  ];
108
98
  if (allowPreferredSession) {
109
99
  array.splice(2, 0, {
110
100
  key: 'UseKernelFromPreferredSession',
111
101
  type: 'group',
112
- label: 'Use Kernel from Preferred Session',
102
+ label: l10n.t('使用首选 Session Kernel'),
113
103
  children: preferredSessionKernelList.map((item) => {
114
104
  return {
115
105
  key: item.fileName,
@@ -237,8 +227,9 @@ export const KernelSelector: React.FC = () => {
237
227
  >
238
228
  <Space>
239
229
  {(libroModel as LibroJupyterModel)?.kernelConnection?.isDisposed
240
- ? 'no kernel'
241
- : (libroModel as LibroJupyterModel)?.kernelConnection?.name || 'no kernel'}
230
+ ? l10n.t(' Kernel')
231
+ : (libroModel as LibroJupyterModel)?.kernelConnection?.name ||
232
+ l10n.t('无 Kernel')}
242
233
  <CaretDownOutlined />
243
234
  </Space>
244
235
  </Dropdown>
@@ -30,7 +30,7 @@ export const KernelStatusSelector: React.FC = () => {
30
30
  return (
31
31
  <div className="libro-kernel-and-container-status">
32
32
  <div className="libro-kernel-status-and-selector">
33
- <span className="kernel">{l10n.t('kernel:')}</span>
33
+ <span className="kernel">{l10n.t('Kernel:')}</span>
34
34
  <KernelSelector />
35
35
  {showBadge &&
36
36
  (isKernelBusy ? (