@@ -186,7 +186,7 @@ export function Component(props: TabsProps): React.JSX.Element {
186
186
triggerProjectUpdate ( ) ;
187
187
} catch ( error ) {
188
188
console . error ( 'Error renaming module:' , error ) ;
189
- props . setAlertErrorMessage ( 'Failed to rename module' ) ;
189
+ props . setAlertErrorMessage ( t ( 'FAILED_TO_RENAME_MODULE' ) ) ;
190
190
}
191
191
192
192
setRenameModalOpen ( false ) ;
@@ -213,7 +213,7 @@ export function Component(props: TabsProps): React.JSX.Element {
213
213
214
214
if ( ! originalTab ) {
215
215
console . error ( 'Original tab not found for copying:' , key ) ;
216
- props . setAlertErrorMessage ( 'Original tab not found for copying' ) ;
216
+ props . setAlertErrorMessage ( t ( 'MODULE_NOT_FOUND_FOR_COPYING' ) ) ;
217
217
return ;
218
218
}
219
219
@@ -223,7 +223,7 @@ export function Component(props: TabsProps): React.JSX.Element {
223
223
triggerProjectUpdate ( ) ;
224
224
} catch ( error ) {
225
225
console . error ( 'Error copying module:' , error ) ;
226
- props . setAlertErrorMessage ( 'Failed to copy module' ) ;
226
+ props . setAlertErrorMessage ( t ( 'FAILED_TO_COPY_MODULE' ) ) ;
227
227
}
228
228
229
229
setCopyModalOpen ( false ) ;
@@ -260,11 +260,11 @@ export function Component(props: TabsProps): React.JSX.Element {
260
260
const titleToShow = currentTab ? currentTab . title : tab . title ;
261
261
262
262
modal . confirm ( {
263
- title : ` ${ t ( 'Delete' ) } ${ TabTypeUtils . toString ( tab . type ) } : ${ titleToShow } `,
264
- content : t ( 'Are you sure you want to delete this? This action cannot be undone. ' ) ,
265
- okText : t ( 'Delete ' ) ,
263
+ title : t ( 'DELETE_MODULE_CONFIRM' , { title : ` ${ TabTypeUtils . toString ( tab . type ) } : ${ titleToShow } ` } ) ,
264
+ content : t ( 'DELETE_CANNOT_BE_UNDONE ' ) ,
265
+ okText : t ( 'DELETE ' ) ,
266
266
okType : 'danger' ,
267
- cancelText : t ( 'Cancel ' ) ,
267
+ cancelText : t ( 'CANCEL ' ) ,
268
268
onOk : async ( ) : Promise < void > => {
269
269
const newTabs = props . tabList . filter ( ( t ) => t . key !== tab . key ) ;
270
270
props . setTabList ( newTabs ) ;
@@ -290,35 +290,35 @@ export function Component(props: TabsProps): React.JSX.Element {
290
290
const createTabContextMenuItems = ( tab : TabItem ) : any [ ] => [
291
291
{
292
292
key : 'close' ,
293
- label : t ( 'Close Tab ' ) ,
293
+ label : t ( 'CLOSE_TAB ' ) ,
294
294
onClick : ( ) => handleTabEdit ( tab . key , 'remove' ) ,
295
295
disabled : tab . type === TabType . ROBOT ,
296
296
icon : < CloseOutlined /> ,
297
297
} ,
298
298
{
299
299
key : 'close-others' ,
300
- label : t ( 'Close Other tabs ' ) ,
300
+ label : t ( 'CLOSE_OTHER_TABS ' ) ,
301
301
onClick : ( ) => handleCloseOtherTabs ( tab . key ) ,
302
302
disabled : props . tabList . length <= getMinTabsForCloseOthers ( tab . type ) ,
303
303
icon : < CloseCircleOutlined /> ,
304
304
} ,
305
305
{
306
306
key : 'rename' ,
307
- label : t ( 'Rename... ' ) ,
307
+ label : t ( 'RENAME_ELLIPSIS ' ) ,
308
308
disabled : tab . type === TabType . ROBOT ,
309
309
onClick : ( ) => handleOpenRenameModal ( tab ) ,
310
310
icon : < EditOutlined /> ,
311
311
} ,
312
312
{
313
313
key : 'delete' ,
314
- label : t ( 'Delete... ' ) ,
314
+ label : t ( 'DELETE_ELLIPSIS ' ) ,
315
315
disabled : tab . type === TabType . ROBOT ,
316
316
icon : < DeleteOutlined /> ,
317
317
onClick : ( ) => handleDeleteTab ( tab ) ,
318
318
} ,
319
319
{
320
320
key : 'copy' ,
321
- label : t ( 'Copy... ' ) ,
321
+ label : t ( 'COPY_ELLIPSIS ' ) ,
322
322
disabled : tab . type === TabType . ROBOT ,
323
323
icon : < CopyOutlined /> ,
324
324
onClick : ( ) => handleOpenCopyModal ( tab ) ,
@@ -366,17 +366,16 @@ export function Component(props: TabsProps): React.JSX.Element {
366
366
/>
367
367
368
368
< Antd . Modal
369
- title = { `Rename ${ currentTab ? TabTypeUtils . toString ( currentTab . type ) : '' } : ${ currentTab ? currentTab . title : ''
370
- } `}
369
+ title = { t ( 'RENAME_TYPE_TITLE' , { type : currentTab ? TabTypeUtils . toString ( currentTab . type ) : '' , title : currentTab ? currentTab . title : '' } ) }
371
370
open = { renameModalOpen }
372
371
onCancel = { ( ) => setRenameModalOpen ( false ) }
373
372
onOk = { ( ) => {
374
373
if ( currentTab ) {
375
374
handleRename ( currentTab . key , name ) ;
376
375
}
377
376
} }
378
- okText = { t ( 'Rename ' ) }
379
- cancelText = { t ( 'Cancel ' ) }
377
+ okText = { t ( 'RENAME ' ) }
378
+ cancelText = { t ( 'CANCEL ' ) }
380
379
>
381
380
{ currentTab && (
382
381
< ClassNameComponent
@@ -396,17 +395,16 @@ export function Component(props: TabsProps): React.JSX.Element {
396
395
</ Antd . Modal >
397
396
398
397
< Antd . Modal
399
- title = { `Copy ${ currentTab ? TabTypeUtils . toString ( currentTab . type ) : '' } : ${ currentTab ? currentTab . title : ''
400
- } `}
398
+ title = { t ( 'COPY_TYPE_TITLE' , { type : currentTab ? TabTypeUtils . toString ( currentTab . type ) : '' , title : currentTab ? currentTab . title : '' } ) }
401
399
open = { copyModalOpen }
402
400
onCancel = { ( ) => setCopyModalOpen ( false ) }
403
401
onOk = { ( ) => {
404
402
if ( currentTab ) {
405
403
handleCopy ( currentTab . key , name ) ;
406
404
}
407
405
} }
408
- okText = { t ( 'Copy ' ) }
409
- cancelText = { t ( 'Cancel ' ) }
406
+ okText = { t ( 'COPY ' ) }
407
+ cancelText = { t ( 'CANCEL ' ) }
410
408
>
411
409
{ currentTab && (
412
410
< ClassNameComponent
0 commit comments