@@ -146,91 +146,92 @@ const KernelUsage = (props: {
146
146
return ! usage . hostname ? (
147
147
< >
148
148
< h3 className = "jp-KernelUsage-section-separator" >
149
- props.trans.__('Kernel usage details are not available')
149
+ { props . trans . __ ( 'Kernel usage details are not available' ) }
150
150
</ h3 >
151
151
< div className = "jp-KernelUsage-section-separator" >
152
- props.trans.__('Please check with your system administrator that you
153
- running IPyKernel version 6.10.0 or above.')
152
+ { props . trans . __ (
153
+ 'Please check with your system administrator that you running IPyKernel version 6.10.0 or above.'
154
+ ) }
154
155
</ div >
155
156
</ >
156
157
) : (
157
158
< >
158
159
< h3 className = "jp-KernelUsage-section-separator" >
159
- props.trans.__('Kernel usage')
160
+ { props . trans . __ ( 'Kernel usage' ) }
160
161
</ h3 >
161
162
< div className = "jp-KernelUsage-separator" >
162
- props.trans.__('Kernel Host'): { usage . hostname }
163
+ { props . trans . __ ( 'Kernel Host' ) } : { usage . hostname }
163
164
</ div >
164
165
< div className = "jp-KernelUsage-separator" >
165
- props.trans.__('Notebook'): { path }
166
+ { props . trans . __ ( 'Notebook' ) } : { path }
166
167
</ div >
167
168
< div className = "jp-KernelUsage-separator" >
168
- props.trans.__('Kernel ID'): { kernelId }
169
+ { props . trans . __ ( 'Kernel ID' ) } : { kernelId }
169
170
</ div >
170
171
< div className = "jp-KernelUsage-separator" >
171
- props.trans.__('Timestamp'): { usage . timestamp ?. toLocaleString ( ) }
172
+ { props . trans . __ ( 'Timestamp' ) } : { usage . timestamp ?. toLocaleString ( ) }
172
173
</ div >
173
174
< div className = "jp-KernelUsage-separator" >
174
- props.trans.__('Process ID'): { usage . pid }
175
+ { props . trans . __ ( 'Process ID' ) } : { usage . pid }
175
176
</ div >
176
177
< div className = "jp-KernelUsage-separator" >
177
- props.trans.__('CPU'): { usage . kernel_cpu } % used
178
+ { props . trans . __ ( 'CPU' ) } : { usage . kernel_cpu } % used
178
179
</ div >
179
180
< div className = "jp-KernelUsage-separator" >
180
- props.trans.__('Memory'): { formatForDisplay ( usage . kernel_memory ) }
181
+ { props . trans . __ ( 'Memory' ) } : { formatForDisplay ( usage . kernel_memory ) }
181
182
</ div >
182
183
< hr className = "jp-KernelUsage-section-separator" > </ hr >
183
184
< h4 className = "jp-KernelUsage-section-separator" >
184
- props.trans.__('Host CPU')
185
+ { props . trans . __ ( 'Host CPU' ) }
185
186
</ h4 >
186
187
{ usage . host_cpu_percent && (
187
188
< div className = "jp-KernelUsage-separator" >
188
- { usage . host_cpu_percent . toFixed ( 1 ) } % props.trans.__('used on'){ ' ' }
189
+ { usage . host_cpu_percent . toFixed ( 1 ) } % { props . trans . __ ( 'used on' ) } { ' ' }
189
190
{ usage . cpu_count } CPUs
190
191
</ div >
191
192
) }
192
193
< h4 className = "jp-KernelUsage-section-separator" >
193
- props.trans.__('Host Virtual Memory')
194
+ { props . trans . __ ( 'Host Virtual Memory' ) }
194
195
</ h4 >
195
196
< div className = "jp-KernelUsage-separator" >
196
- props.trans.__('Active'):{ ' ' }
197
+ { props . trans . __ ( 'Active' ) } :{ ' ' }
197
198
{ formatForDisplay ( usage . host_virtual_memory . active ) }
198
199
</ div >
199
200
< div className = "jp-KernelUsage-separator" >
200
- props.trans.__('Available'):{ ' ' }
201
+ { props . trans . __ ( 'Available' ) } :{ ' ' }
201
202
{ formatForDisplay ( usage . host_virtual_memory . available ) }
202
203
</ div >
203
204
< div className = "jp-KernelUsage-separator" >
204
- props.trans.__('Free'):{ ' ' }
205
+ { props . trans . __ ( 'Free' ) } :{ ' ' }
205
206
{ formatForDisplay ( usage . host_virtual_memory . free ) }
206
207
</ div >
207
208
< div className = "jp-KernelUsage-separator" >
208
- props.trans.__('Inactive'):{ ' ' }
209
+ { props . trans . __ ( 'Inactive' ) } :{ ' ' }
209
210
{ formatForDisplay ( usage . host_virtual_memory . inactive ) }
210
211
</ div >
211
212
{ usage . host_virtual_memory . percent && (
212
213
< div className = "jp-KernelUsage-separator" >
213
- props.trans.__('Percent used'):{ ' ' }
214
+ { props . trans . __ ( 'Percent used' ) } :{ ' ' }
214
215
{ usage . host_virtual_memory . percent . toFixed ( 1 ) } %
215
216
</ div >
216
217
) }
217
218
< div className = "jp-KernelUsage-separator" >
218
- props.trans.__('Total'):{ ' ' }
219
+ { props . trans . __ ( 'Total' ) } :{ ' ' }
219
220
{ formatForDisplay ( usage . host_virtual_memory . total ) }
220
221
</ div >
221
222
< div className = "jp-KernelUsage-separator" >
222
- props.trans.__('Used'):{ ' ' }
223
+ { props . trans . __ ( 'Used' ) } :{ ' ' }
223
224
{ formatForDisplay ( usage . host_virtual_memory . used ) }
224
225
</ div >
225
226
< div className = "jp-KernelUsage-separator" >
226
- props.trans.__('Wired'):{ ' ' }
227
+ { props . trans . __ ( 'Wired' ) } :{ ' ' }
227
228
{ formatForDisplay ( usage . host_virtual_memory . wired ) }
228
229
</ div >
229
230
</ >
230
231
) ;
231
232
}
232
233
}
233
- return < h3 > props.trans.__('Kernel usage is not available')</ h3 > ;
234
+ return < h3 > { props . trans . __ ( 'Kernel usage is not available' ) } </ h3 > ;
234
235
} ;
235
236
236
237
export class KernelUsageWidget extends ReactWidget {
0 commit comments